Determine building your Android device is pointing at

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Determine building your Android device is pointing at

Postby ryang1428 » Tue Apr 19, 2011 8:25 pm

I have a MapView in which I am drawing buildings on using geopoints. Currently, the app determines the closest building to you by just checking your long/lat and comparing to the buildings; but what I want to be able to do is point my device at a building and have that buildings info pop up, even if it isn't the closest building to you.

I have looked up how to accomplish this and I would be using the azimuth direction received from the ORIENTATION sensor listener. I am having trouble using that azimuth direction and determining if it is intercepting one of the buildings on the map.

I have also attempted to calculate the bearing using this formula:
map-tutorials-f18/calculate-distance-and-bearing-t1465.html
between your current location and a building close to you to see if I could solve this problem that way, but I got nowhere.

Would I be using the ORIENTATION or MAGNETIC_FIELD sensor to accomplish this? How would I go about implementing this? Any help appreciated!
ryang1428
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Apr 19, 2011 8:04 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 1 guest