Highlighting whole street with some maps API
Asked Answered
A

3

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

Aerotherapeutics answered 28/1, 2010 at 14:9 Comment(2)
Hey @Aerotherapeutics , I have a similar need. Were you able to get what you want? Share some code if you achieve it.Changeful
Likewise- Did you find a solution?Hedvige
W
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:

Washedup answered 28/1, 2010 at 14:17 Comment(3)
I want to hightlight a street on Tap see my question here #24796932Changeful
Example not updated for new version of Google Maps API, but I found this: developers.google.com/maps/documentation/roads/snap or this: jsfiddle.net/HG7SV/15Irrecoverable
Could you update the links? They are outdated. ThxLadyinwaiting
N
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

Nina answered 29/6, 2010 at 5:44 Comment(0)
L
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

Laky answered 6/1, 2022 at 23:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.