Question

The problem I have is that I would like to highlight the whole street from beginning to the end. For example if I enter Av. Montaigne, Paris, France in Google Maps, I want the whole street to be highlighted. It seems that Google Maps does not support this option and I would have to implement algorithm to mark the street by using polylines. However, I am not sure if there is a somewhat easy way to get information about how the street looks like, because the street could be curved so it is a problem.

Is it possible to get information that would be simple to use to highlight the street from beginning to end by just passing street name to API? The maps that I would use do not have to be Google maps, they can be Yahoo, Bing on OpenStreetMap.

The goal is actually something like this:

enter image description here

No correct solution

OTHER TIPS

As far as I know, none of the common web map APIs offer this facility. Two possible approaches come to mind, although neither one is straightforward or reliable:

a.) Download from OpenStreetMap a local set of all the road data that you want to be able to highlight in your application. Then, when your user enters the street name they are searching for, search the OSM data and construct a polyline from the relevant coordinate points and plot it on the map. The problem with this approach is that it requires you to host and maintain a complete set of road data, and also implement the appropriate parsing algorithm to deal with misspellings of street names etc. You may often find that road names as they appear on Google Maps will be spelled differently than they are in OSM, for example.

b.) Use a routing service to calculate a route from one end of the street to the other, and then plot a polyline that follows the points of the route. e.g. Using the Bing Maps Routes API (http://msdn.microsoft.com/en-us/library/ff701717.aspx), you could plot a route between the two intersections at either end of the road in question - e.g. "Av. Montaigne & Rond-point des Champs-Élysées" to "Av. Montaigne & Place de L'Alma". You could then plot a polyline from the route points as follows:

Highlight street in Bing Maps

There are two problems with this approach: first, you need to know the names of the roads with which the street intersects at either end (or some other way of identifying the ends of the street in question), and secondly, the route chosen between those two intersections may not actually follow the street itself (for example, if the street is one-way and you try to calculate a route in the other direction).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top