google-mapsgoogle-maps-api-3google-maps-markersgoogle-maps-urls

Link to Google maps with dynamic path


I want to link to Google Maps with a lat & long :
For that, I Used : http://maps.google.com/maps?q=48.819141912303,2.2297863639837

I'm wondering if I can add a Path to this Google Maps ?
I used it in a static map and Can I do that with this Google maps link ? https://maps.googleapis.com/maps/api/staticmap?path=48.819141912303,2.2297863639837|48.81863290356,2.2312122798508|48.818734654467,2.2313515376389&scale=true&size=600x300&maptype=roadmap&format=png&visual_refresh=true


Solution

  • I don't think that this is possible to open a map with an arbitrary polyline on it. You should use APIs for this purpose.

    However, you can open the map with driving directions that pass through specified waypoints.

    Just create Maps URLs for directions with origin, destination and waypoints.

    For example,

    https://www.google.com/maps/dir/?api=1&origin=48.819141912303,2.2297863639837&waypoints=48.81863290356,2.2312122798508&destination=48.818734654467,2.2313515376389&travelmode=walking

    Have a look at Maps URLs documentation for further details.