This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Android and the fly likes Layers on Maps/images Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Layers on Maps/images" Watch "Layers on Maps/images" New topic
Author

Layers on Maps/images

amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 511
Hello Authors,
I have done few basic Android apps but nothing yet that actual uses Location services and maps or images. I believe there is something called as "layers" which we can use to superimpose what we have in image or map. Just being curious to understand if this book would help me gaining information on this topic.

Also if you can please list few real-world examples those has been given in the book, it might be handy.

Appreciate your time.

Regards,
Amit
D. Smith
Author
Greenhorn

Joined: Jan 11, 2013
Posts: 25
    
    5

Hello Amit -

Yes, that Android Google Maps SDK does allow you to place content on top of the map itself. The term the SDK uses for this is Overlays. The book does contain several recipes for dealing with the Maps SDK, including adding Overlay items for specific location points as well as for the user's current location. Unfortunately, however it deals only with v1 of the Maps SDK (which has been around since ~1.5).

Google released shortly after the book went to publishing (thanks Google...) Maps API v2 (https://developers.google.com/maps/documentation/android/) which is not referenced directly in the book given its release date. While this API is not exactly the same, it is built on the same concepts. In the newer API, overlay data points are referred to as Markers. Maps v2 has some higher device requirements than v1 (OpenGL ES2, for example) so you may find yourself still needing to use v1 for the time being, but if you can jump to v2 the Google documentation will be the best resource for now.


Android Recipes: A Problem Solution Approach: http://www.apress.com/9781430246145
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 511
Hello,
Thank you for your reply.
I believe MAPS API V2 must be available for phones with ICS or higher. Not sure about this, might need to check. So if I still want to do something with maps and overlays then I believe MAPS API V1 is still useful.

Will it be possible for you to outline very few of your real-world examples included in the book ?

Regards,
Amit
D. Smith
Author
Greenhorn

Joined: Jan 11, 2013
Posts: 25
    
    5

Actually, support for the new Maps API is determined by the version of Google Play the user has on their device, via the new Google Play Services library. Devices as old as v2.2 support the ability to get Google Play Services updates, so as long as the device has that minimum version of Android and supports the other hardware requirements (OpenGL) it can work with the latest maps API.

One of the examples in the book illustrates using a custom ItemizedOverlay subclass called LocationOverlay to display a list of small image icons on top of the map at particular locations. Here is a snippet of code from the example:



The source for LocationOverlay and how to add it to a visible map is in the full example.
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 511
Hello,

Thank you once again for your response. It is certainly useful.

Regards,
Amit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Layers on Maps/images
 
Similar Threads
google maps and web application
Injecting a Map in enum through Spring
Custom scope using Spring 2.x
Layer vs Tier - JAA book
JSLT and apache MultiKey Map