0

I am trying to create a google map using the static google map API. I want walking and driving static map.

Bellow is the path i am using : http://maps.google.com/maps/api/staticmap?maptype=roadmap&zoom=14&size=400x250&markers=color:green|label:A|30.7261629,76.7596221&markers=color:red|label:B|30.7226447,76.7681678&path=color:0xff0000ff|weight:3|30.7261629,76.7596221|30.7226447,76.7681678&sensor=false

  • 1
    What you have tried, can you provide the code you tried? – Falaque Sep 09 '15 at 10:48
  • I am trying to show the map by just using the path : http://maps.google.com/maps/api/staticmap?maptype=roadmap&zoom=14&size=400x250&markers=color:green|label:A|30.7261629,76.7596221&markers=color:red|label:B|30.7226447,76.7681678&path=color:0xff0000ff|weight:3|30.7261629,76.7596221|30.7226447,76.7681678&sensor=false – user2940248 Sep 09 '15 at 10:57
  • Can you modify this path in such a way that it can generate a map with driving route from A to B. ? – user2940248 Sep 09 '15 at 10:58
  • related question: [google maps static map polyline passing throught lakes, river, mountains](http://stackoverflow.com/questions/32255380/google-maps-static-map-polyline-passing-throught-lakes-river-mountains/32257219#32257219) – geocodezip Sep 09 '15 at 12:50

1 Answers1

1

Static map api support only marker not direction.

If you want to use direction with Static map, you need to use direction api.

How to do: how to create a static api map with directions

Basically what the up-voted answer is saying:

1. Use direction api to get encoded path.
2. In static map use this encoded path.
Community
  • 1
  • 1
Falaque
  • 886
  • 2
  • 12
  • 27