views:

23

answers:

1

Is there any possibility to highlight a street using the Google Maps API? I want to set a color on a street, similar as it is done in the navigation function of Google Maps.

If there is no generic implementation for this - and I guess there probably isn't - is there any good/simple solution for this? The only thing I could think of was reverse geocoding coordinates and see if those coordinates resolve to the street I want to color and if they did I would then draw some color on to those points. But this is a really ugly solution. ;-)

I hope some clever genious can help me!

A: 

Is there any possibility to highlight a street using the Google Maps API?

Not the Android one. It may or may not be possible using the Web-based Google Maps -- I am not familiar with what it can all do. If you find the Web-based maps do support this, you can always embed one of those in your app via WebView.

If there is no generic implementation for this - and I guess there probably isn't - is there any good/simple solution for this?

I suspect there is no solution for this, simple or otherwise. Your reverse-geocoding solution would take a very long time, just due to Internet overhead.

CommonsWare
Any idea about how third-party navigation apps do this?
crapper
@crapper: There should be no "third-party navigation apps" for Google Maps on Android, as IMHO that would violate the Maps add-on terms of service (of course, IANAL). To make this work, as you have already determined, you need a bunch of coordinates that represent the street. Given that you have these, highlighting the street is a matter of an `Overlay`. However, there is nothing in Android that will give you this street-coordinate data. Third-party navigation apps presumably have licensed their own street-coordinate data, from wherever, and possibly at substantial cost.
CommonsWare
Ok, thank you. I just stumbled upon My Tracks for Android, which is Open Source and seemingly is highlighting paths. I will have to take a look at that.
crapper
@crapper: AFAIK, it is recording coordinates as you walk, and so it can use that to draw the paths.
CommonsWare
Yes, seems so. My application will also be recording coordinates; I will have to snap those to the nearest street, since it is impossible not to be on a street with my application. I suppose it's best to resolve the coordinates to an address and then resolve them back to coordinates in order to snap them to the street. I just was doubtful if connecting those coordinates will really overlay the street with a good accuracy.
crapper
@crapper: "since it is impossible not to be on a street with my application" -- your application blows up the phone if you leave the street? :-)
CommonsWare