Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Static Maps API: Generating a static map with paths
    primarykey
    data
    text
    <p>I'm trying to generate a static google map with some points on it, and some lines connecting these points (I'm soon going to make the lines correspond with the driving directions, but that comes later). Right now I've got code like this to generate the URL:</p> <pre><code>def getStaticMapAddress(self, route): url = "http://maps.google.com/maps/api/staticmap?center="+str(route[0].location.lat)+","+str(route[0].location.lng)+"&amp;zoom=6&amp;size=400x400&amp;markers=" i=0 while i&lt;len(route): url += str(route[i].location.lat)+","+str(route[i].location.lng) i=i+1 if (i &lt; len(route)): url += "|" url += "&amp;path=color:0xff0000ff&amp;weight:5" i=0 while i&lt;len(route): url += "|"+str(route[i].location.lat)+","+str(route[i].location.lng) i+=1 url += "&amp;sensor=false" return url </code></pre> <p>In this function, the 'route' is a list of users with associated locations. With my test data, this URL was generated:</p> <pre><code>http://maps.google.com/maps/api/staticmap?center=50.8202008,-0.1324898&amp;zoom=6&amp;size=400x400&amp;markers=50.8202008,-0.1324898|51.447341,-0.0761212|51.4608947,-2.5884312&amp;path=color:0xff0000ff&amp;weight:5|50.8202008,-0.1324898|51.447341,-0.0761212|51.4608947,-2.5884312&amp;sensor=false </code></pre> <p>If you look at that static map, you can see the markers but not the paths. I've been looking at the documentation for this (http://code.google.com/apis/maps/documentation/staticmaps/#Paths) and I can't see where I've gone wrong. Looking at the examples my URL seems to have the exact same format as the examples. Does anyone know what I'm doing wrong?</p> <p>Thanks</p> <p>Ben</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload