Issue
I need a section of my application to have an interactive map of a square area that consists of about 10 buildings. You have to be able to click on a building and receive some information about it. I know there are a couple of ways to go about this, but I'm hoping someone with some background in this can give me some tips.
Here are some ways that I can think about accomplishing this.
Google Maps
I already implemented Google Maps API and it works quite well, but doesn't really have the effect I was looking for. Google Maps requires an internet connection and gives you access to the entire map. I need it to be locked into one area.
Webviews
This seems like a great alternative. I'm sure I can come up with a simple image map that will give you more information when you click a certain building. The only problem with this is that you also need an internet connection.
OpenGL?
I've never really looked into this too much, but I heard it is difficult and a pain to implement. It would be able to run locally, but is it worth it?
Are there any other way to go about developing an interactive map? Something to keep in mind is that I would also like to someday port this over to iOS (if anyone has any experience with that as well)
Solution
If you want full control and are comfortable using html and javascript, I would highly recommend using the open source OpenLayers library. You can create an html page, save it in assets and run it locally on the device. You can create your own set of map tiles or even use one single jpeg file and then 'map' the buildings you want on it and then use the simple but extensive OpenLayers API to allow for building selection and information display. It even has multi-touch functionality built in for panning and zooming. Works great on and off mobile.
You can see a list of examples here. Doing a simple view source on any of the examples will give you a very clear idea of what they are doing. You can also take a look at this example which plots a bunch of image thumbnails on the map area from flicker with the ability to click for more details. This example uses an online feed, but you can easily use a local one.. even one passed in from the app to the webview.
ps. I have no affiliation to OpenLayers other than actively using it for my projects.
Answered By - MindWire
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.