Fixed
Status Update
Comments
ch...@gmail.com <ch...@gmail.com> #3
Um, STRONG SUPPORT! :) (This is the main thing missing that I can see from Static Maps.
th...@gmail.com <th...@gmail.com> #4
[Comment deleted]
th...@gmail.com <th...@gmail.com> #5
if processing encoded polylines/polygons is too cpu-consuming on the server, Google
can impose a daily per IP limit on the number of points used. That will encourage us
developers to store the static map images in our own servers.
I believe this is the most efficient way of using the static map service.
~newton
can impose a daily per IP limit on the number of points used. That will encourage us
developers to store the static map images in our own servers.
I believe this is the most efficient way of using the static map service.
~newton
da...@gmail.com <da...@gmail.com> #6
polyline/polygons on the static map are great!
Not sure whether this is a new request. At least quite close to the topic above:
What about other geometric figures (with filling), for e.g. a circle with defined
center and radius? Would be very helpful to display zones on the map.
Not sure whether this is a new request. At least quite close to the topic above:
What about other geometric figures (with filling), for e.g. a circle with defined
center and radius? Would be very helpful to display zones on the map.
cr...@gmail.com <cr...@gmail.com> #7
Would very much like to see this added.
Additionally it would be helpful to auto center and zoom to fit the whole path in the
image.
Additionally it would be helpful to auto center and zoom to fit the whole path in the
image.
ma...@gmail.com <ma...@gmail.com> #8
I'd like too to see this feature implemented.
sr...@gmail.com <sr...@gmail.com> #9
+1
ma...@wwarby.com <ma...@wwarby.com> #10
I second this request I also second crudson's request to centre and zoom to fit a
path by omitting the lat/lng and zoom parameters.
path by omitting the lat/lng and zoom parameters.
ma...@wwarby.com <ma...@wwarby.com> #12
@Pam: Any update on this feature request? It's the fourth most starred open issue,
and it seems like a fairly easy feature to implement, yet it's been outstanding for
almost a year...
and it seems like a fairly easy feature to implement, yet it's been outstanding for
almost a year...
pa...@gmail.com <pa...@gmail.com> #13
I'll update the issue if/when the feature becomes implemented. As a policy, we don't
reveal timelines or give guarantees for feature requests.
reveal timelines or give guarantees for feature requests.
vi...@gmail.com <vi...@gmail.com> #14
This feature will be nice!
ha...@gmail.com <ha...@gmail.com> #15
This would be a fantastic feature!
ch...@gmail.com <ch...@gmail.com> #16
hoping that it gets added. Would be an awesome addition
co...@gmail.com <co...@gmail.com> #17
This feature is the main thing missing from static maps.
ma...@gmail.com <ma...@gmail.com> #18
Yes, please, add this feature... We need it...
av...@gmail.com <av...@gmail.com> #19
please add this feature
av...@gmail.com <av...@gmail.com> #20
please add this feature. This is very much required for mobile maps.
ch...@gmail.com <ch...@gmail.com> #21
been 1 and a quarter years now, safe to say it aint going to happen?
pa...@gmail.com <pa...@gmail.com> #22
Changing status of "Accepted" issues to "Acknowledged", to clarify their
state.
We may not be able to resolve all bugs or fulfill all feature requests, but
we do thank you for filing them, and we will continually revisit all
acknowledged issues and evaluate their feasibility. Thanks!
state.
We may not be able to resolve all bugs or fulfill all feature requests, but
we do thank you for filing them, and we will continually revisit all
acknowledged issues and evaluate their feasibility. Thanks!
ch...@gmail.com <ch...@gmail.com> #23
which translates to dont hold your breath?
pa...@gmail.com <pa...@gmail.com> #24
It translates to "you never know" -- but for this one, I can tell you that we're
working on it. We admitted as much at Google I/O last week.
working on it. We admitted as much at Google I/O last week.
ch...@gmail.com <ch...@gmail.com> #25
thanks for the clarification :) I will be holding my breath :) will really enhance my
website and can't wait.
cheers
website and can't wait.
cheers
rt...@gmail.com <rt...@gmail.com> #26
[Comment deleted]
pa...@gmail.com <pa...@gmail.com> #27
le...@gmail.com <le...@gmail.com> #28
yay! seriously, yay!
na...@gmail.com <na...@gmail.com> #29
finally... thx team!
th...@gmail.com <th...@gmail.com> #30
Many Thanks for making this happened!
ch...@gmail.com <ch...@gmail.com> #31
Google Error
Request-URI Too Large
The requested URL /maps/api/staticmap... is too large to process.
bugga :)
Request-URI Too Large
The requested URL /maps/api/staticmap... is too large to process.
bugga :)
an...@gtempaccount.com <an...@gtempaccount.com> #32
I have an encoded polyline which is 10880 bytes long. Obviously when I try to create
a static image, it gives an error:
<img
src="http://maps.google.com/maps/api/staticmap?size=400x400&path=fillcolor:0xAA000033|color:0xFFFFFF00|enc:MY_ENCODED_DATA&key=MAPS_API_KEY "
/>
returns: 414 Request-URI Too Large
The requested URL /maps/api/staticmap... is too large to process.
I tried to send a POST request but that also threw an error:
<form action="http://maps.google.com/maps/api/staticmap " method="post">
<input type="hidden" name="size" value="400x400" />
<input type="hidden" name="path"
value="fillcolor:0xAA000033|color:0xFFFFFF00|enc:MY_ENCODED_DATA" />
<input type="hidden" name="key" value="MAPS_API_KEY" />
<input type="submit" />
</form>
returns: 400 Bad Request
Your client has issued a malformed or illegal request.
Does anybody know if it is possible to create static maps with complex encoded
polygons consisting of hundreds of points?
The attached file shows the 10880-bytes long encoded polyline.
Thanks!
a static image, it gives an error:
<img
src="
/>
returns: 414 Request-URI Too Large
The requested URL /maps/api/staticmap... is too large to process.
I tried to send a POST request but that also threw an error:
<form action="
<input type="hidden" name="size" value="400x400" />
<input type="hidden" name="path"
value="fillcolor:0xAA000033|color:0xFFFFFF00|enc:MY_ENCODED_DATA" />
<input type="hidden" name="key" value="MAPS_API_KEY" />
<input type="submit" />
</form>
returns: 400 Bad Request
Your client has issued a malformed or illegal request.
Does anybody know if it is possible to create static maps with complex encoded
polygons consisting of hundreds of points?
The attached file shows the 10880-bytes long encoded polyline.
Thanks!
ma...@wwarby.com <ma...@wwarby.com> #33
@Antonio,
There's no way to make that work. Requesting an image as POST will never work as
browsers are not capable of requesting images in the POST method and there is no HTML
attribute to specify the request method for an image and most importantly, the Google
API is not designed to accept requests in this format even if you hacked around the
limitations of HTML and browser implementations using a JavaScript XmlHTTPRequest for
example. The limitation on the GET method length is a feature of the browser, not the
API. I believe the limit in modern browsers is 2048 characters which may or may not
include the domain name - I can't remember, and there is no way to circumvent the
limit (I've tried).
Your only option is to reduce the complexity of your polygons. Unfortunately this is
not an easy job if you want to get it just under the limit - I found that because
some of my co-ordinates were 4 decimals and others were 5, some had a "-" (I live in
London on the Greenwich meridian) I had to just keep plucking one vertex at a time
until I got under the limit. I wrote a program to work though my polygons
intelligently removing points for minimum negative effect (taking into account
distances and angles to next vertices). However, I did this before the encoded
polyline format was supported. If you have 10,000+ bytes of encoded polygon, that is
surely WAY more complex than you need for a static map. I suggest you could get that
down to 1,000 bytes and barely see any loss of fidelity in your polygon. The trouble
is where you get your polygons from though. I have the luxury of being able to change
mine - if you don't, you're pretty much screwed.
There's no way to make that work. Requesting an image as POST will never work as
browsers are not capable of requesting images in the POST method and there is no HTML
attribute to specify the request method for an image and most importantly, the Google
API is not designed to accept requests in this format even if you hacked around the
limitations of HTML and browser implementations using a JavaScript XmlHTTPRequest for
example. The limitation on the GET method length is a feature of the browser, not the
API. I believe the limit in modern browsers is 2048 characters which may or may not
include the domain name - I can't remember, and there is no way to circumvent the
limit (I've tried).
Your only option is to reduce the complexity of your polygons. Unfortunately this is
not an easy job if you want to get it just under the limit - I found that because
some of my co-ordinates were 4 decimals and others were 5, some had a "-" (I live in
London on the Greenwich meridian) I had to just keep plucking one vertex at a time
until I got under the limit. I wrote a program to work though my polygons
intelligently removing points for minimum negative effect (taking into account
distances and angles to next vertices). However, I did this before the encoded
polyline format was supported. If you have 10,000+ bytes of encoded polygon, that is
surely WAY more complex than you need for a static map. I suggest you could get that
down to 1,000 bytes and barely see any loss of fidelity in your polygon. The trouble
is where you get your polygons from though. I have the luxury of being able to change
mine - if you don't, you're pretty much screwed.
ma...@gmail.com <ma...@gmail.com> #34
You might try overlaying the map with a polygon drawn directly with JavaScript....
re...@gmail.com <re...@gmail.com> #35
I had the same problem so I made a script to trim off the points which were closest together.
It's a recursive function which will repetitively remove the top 5% of closest points.
The function takes 4 parameters:
fix_len($l,$markers,$remove_percent=5,$round=4,$max_len=1500);
$l is an array of latitude and longitudes:
Array
(
[0] => Array
(
[0] => 52.65994
[1] => -0.38431
)
}
$markers is an array of markers to add to the map:
Array
(
[0] => markers=color:green|label:A|52.65994,-0.38431
[1] => markers=color:blue|label:B|55.65994,-0.31431
[2] => markers=color:red|label:C|57.65994,-0.36431
)
$remove_percent: will remove the x% closest markers each time.
$round: will round the latitude and longitudes to x decimal places.
$max_len: is the maximum length of the static maps GET request.
<?php
//long long list
$l[0][0] = '52.123';
$l[0][1] = '-0.39234';
$l[1][0] = '52.123123';
$l[1][1] = '-0.39234123';
$l[2][0] = '52.123456';
$l[2][1] = '-0.39234456';
$l[3][0] = '52.123678';
$l[3][1] = '-0.39234678';
//not so long list
$markers[] = 'markers=color:red|label:A|52.123,-0.39234';
$markers[] = 'markers=color:red|label:A|52.456,-0.39256';
$markers[] = 'markers=color:red|label:A|52.678,-0.39278';
echo fix_len($l,$markers);
function fix_len($l,$markers,$remove_percent=5,$round=4,$max_len=1500)
{
foreach($l as $id => $ll)
{
if(is_array($last))
{
$d[0] = abs($last[0] - $ll[0]);
$d[1] = abs($last[1] - $ll[1]);
$dif[$id] = $d[0]+$d[1];
}
$last[0] = $ll[0];
$last[1] = $ll[1];
}
asort($dif);
foreach(array_slice($dif,0,floor(count($dif)/(100/$remove_percent)),true) as $id => $d)
{
unset($l[$id]);
}
foreach($l as $id => $ll)
{
$pix[] = round($ll[0], $round).','.round($ll[1], $round);
}
$str = 'https://maps.googleapis.com/maps/api/staticmap?path=color:0x0000ff|weight:5|'.implode('| ',$pix).'&size=512x512&'.implode("&",$markers).'&sensor=false';
if(strlen($str)>$max_len)
{
return fix_len(array_values($l),$markers,$remove_percent);
}else{
return($str);
}
}
?>
It's a recursive function which will repetitively remove the top 5% of closest points.
The function takes 4 parameters:
fix_len($l,$markers,$remove_percent=5,$round=4,$max_len=1500);
$l is an array of latitude and longitudes:
Array
(
[0] => Array
(
[0] => 52.65994
[1] => -0.38431
)
}
$markers is an array of markers to add to the map:
Array
(
[0] => markers=color:green|label:A|52.65994,-0.38431
[1] => markers=color:blue|label:B|55.65994,-0.31431
[2] => markers=color:red|label:C|57.65994,-0.36431
)
$remove_percent: will remove the x% closest markers each time.
$round: will round the latitude and longitudes to x decimal places.
$max_len: is the maximum length of the static maps GET request.
<?php
//long long list
$l[0][0] = '52.123';
$l[0][1] = '-0.39234';
$l[1][0] = '52.123123';
$l[1][1] = '-0.39234123';
$l[2][0] = '52.123456';
$l[2][1] = '-0.39234456';
$l[3][0] = '52.123678';
$l[3][1] = '-0.39234678';
//not so long list
$markers[] = 'markers=color:red|label:A|52.123,-0.39234';
$markers[] = 'markers=color:red|label:A|52.456,-0.39256';
$markers[] = 'markers=color:red|label:A|52.678,-0.39278';
echo fix_len($l,$markers);
function fix_len($l,$markers,$remove_percent=5,$round=4,$max_len=1500)
{
foreach($l as $id => $ll)
{
if(is_array($last))
{
$d[0] = abs($last[0] - $ll[0]);
$d[1] = abs($last[1] - $ll[1]);
$dif[$id] = $d[0]+$d[1];
}
$last[0] = $ll[0];
$last[1] = $ll[1];
}
asort($dif);
foreach(array_slice($dif,0,floor(count($dif)/(100/$remove_percent)),true) as $id => $d)
{
unset($l[$id]);
}
foreach($l as $id => $ll)
{
$pix[] = round($ll[0], $round).','.round($ll[1], $round);
}
$str = '
if(strlen($str)>$max_len)
{
return fix_len(array_values($l),$markers,$remove_percent);
}else{
return($str);
}
}
?>
re...@gmail.com <re...@gmail.com> #36
Oh, you might need this to decode your poly line first.
function decodePolylineToArray($encoded)
{
$length = strlen($encoded);
$index = 0;
$points = array();
$lat = 0;
$lng = 0;
while ($index < $length)
{
$b = 0;
$shift = 0;
$result = 0;
do
{
$b = ord(substr($encoded, $index++)) - 63;
$result |= ($b & 0x1f) << $shift;
$shift += 5;
}
while ($b >= 0x20);
$dlat = (($result & 1) ? ~($result >> 1) : ($result >> 1));
$lat += $dlat;
$shift = 0;
$result = 0;
do
{
$b = ord(substr($encoded, $index++)) - 63;
$result |= ($b & 0x1f) << $shift;
$shift += 5;
}
while ($b >= 0x20);
$dlng = (($result & 1) ? ~($result >> 1) : ($result >> 1));
$lng += $dlng;
$points[] = array($lat * 1e-5, $lng * 1e-5);
}
return $points;
}
function decodePolylineToArray($encoded)
{
$length = strlen($encoded);
$index = 0;
$points = array();
$lat = 0;
$lng = 0;
while ($index < $length)
{
$b = 0;
$shift = 0;
$result = 0;
do
{
$b = ord(substr($encoded, $index++)) - 63;
$result |= ($b & 0x1f) << $shift;
$shift += 5;
}
while ($b >= 0x20);
$dlat = (($result & 1) ? ~($result >> 1) : ($result >> 1));
$lat += $dlat;
$shift = 0;
$result = 0;
do
{
$b = ord(substr($encoded, $index++)) - 63;
$result |= ($b & 0x1f) << $shift;
$shift += 5;
}
while ($b >= 0x20);
$dlng = (($result & 1) ? ~($result >> 1) : ($result >> 1));
$lng += $dlng;
$points[] = array($lat * 1e-5, $lng * 1e-5);
}
return $points;
}
Description