18

Is there any way to highlight/display on Google/Bing/(any other map provider) Maps whole street (from the beginning of the street to the end of)?

I know the existence of Polyline in Google Maps API, but it's just connecting two latitude points, and there is no way of making it automatic so I could display any street in some city.

Also I was thinking about Directions, but many street are 2 way, there is no guarante that you will mark whole street and it's just now user friendly. Example

Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
SubZeroFX
  • 490
  • 3
  • 5
  • 17

3 Answers3

12

You may want to check Mike Williams' article on how to snap points and polylines to streets with the Google Maps API:

Especially this example:

Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
  • I want to hightlight a street on Tap see my question here http://stackoverflow.com/questions/24796432/highlighting-a-street-on-google-map-in-android – Zar E Ahmer Jul 18 '14 at 07:15
  • Example not updated for new version of Google Maps API, but I found this: https://developers.google.com/maps/documentation/roads/snap or this: http://jsfiddle.net/HG7SV/15/ – Luckylooke Feb 06 '17 at 12:59
  • Could you update the links? They are outdated. Thx – Peter VARGA Oct 12 '21 at 11:09
6

Take a look at OpenStreetMap. (Google and Bing won't let you access their underlying street data.)

You can show a map with OSM tiles, and use the API to query for the features you're interested in displaying on the map. OpenLayers is a javascript mapping library that could support this.

Here's a view of Chicago showing street vectors and other features overlaid on top of the map tiles:

http://www.openstreetmap.org/?lat=41.902104&lon=-87.626441&zoom=18&layers=B000FTTT

tcarobruce
  • 3,773
  • 21
  • 33
0

In Azure Maps you could access the vector tile road layers and use a data driven style based on the name of the road. Here is a tool that inspects the underlying data in the map tiles and highlights things that you click on. This has a lot of the basic functionality that you would need to achieve what you are asking for: https://azuremapscodesamples.azurewebsites.net/?search=inspect&sample=Inspect%20features%20under%20the%20mouse

rbrundritt
  • 16,570
  • 2
  • 21
  • 46