1

I am building an android application whose functionality is to display a map of an indoor location with people around the application user. I have the following issues:

  1. How to embed a map in android? I have found many references to embedding Google Maps but none to embedding a static map. I need to deal with my map as collection of pixels so I can add overlay items on top of it.

  2. When the user zooms in and out, how do I obtain the zoom parameters? For example, assume my map consists of four consecutive rooms. The user is initially focused on room1 and sees all people in that room. He then zooms out so that his view becomes room1 and room2. How does my application detect that his view has changed to span room1 and 2? If this was a mathematical problem, my zoom parameters would be the coordinates of the upper-left-corner and the lower-right-corner of the current view. Given these parameters and the coordinates of all people, I can decide which people to display on the screen.

Could you please share some sample code that tackles issues 1 and 2.

NewToAndroid
  • 581
  • 7
  • 25

1 Answers1

0

I don't think anyone will give you sample code to something as complex as this, it's just not how this website works.

How to embed a map in android? I have found many references to embedding Google Maps but none to embedding a static map.

Now if you are talking Google Maps, you can get a static map of an area using the Google Static Maps api.

If you are using you own image on the other hand, I think you can start referring to the Google I/O's example, they've used a WebView. You can set your image on the Webview for the free zooming functionality.

otherwise :

When the user zooms in and out, how do I obtain the zoom parameters?

Graeme has written an excellent post on how to zoom properly on a custom image view.

Community
  • 1
  • 1
Reno
  • 33,594
  • 11
  • 89
  • 102
  • 1
    I understand that no body would provide me with code so complex but I was really looking for pointers. I did wasn't sure where to start. I built my own map of an indoor location and would like to embed it in my application. Graeme's post was indeed useful. Thanks for sharing it. – NewToAndroid Nov 29 '11 at 08:48