• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using a marker with onLocationChanged(Location location)

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd like to utilize a marker within my override for onLocationChanged(). Presently a string is being used to post the coordinates on-screen using Toast. I'm confused by the Location Listener. What is the return? How is it passed along to the map as a marker?



Current override for onLocationChanged:

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "return value"? The method is declared void, so there is no return value.

What do you mean by "it" in "How is it passed along..."? There is no connection between this listener and your code, unless you create one. If you want to set a marker on a map as a result of this method being called, I would expect the code to call a method somewhat like "setMyMarker(location)".
 
Jared Snyder
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf, thanks for replying!

After considering my issue further, it dawned on me that my question is moot, because I don't actually need to do anything special to show a marker for the user's current location. The Google Maps v2 API offers .setMyLocationEnabled() method. When set to true, the user's current location will be placed on the map and updated accordingly. The only catch is that this is but a layer on the map and does not return the coordinates of the location. It is simply visual. That's fine, though, because I can use my method to get the coordinates.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic