Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Layers on Maps/images

 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 25
5
Android IntelliJ IDE Objective C
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 25
5
Android IntelliJ IDE Objective C
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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

Regards,
Amit
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic