I created a script to store dynamic map inputs by appending attributes to a Static Maps URL (so we can refer back to it after a user submits).
For reasons I can't yet determine, the Polygon is not rendering at all with the basic static maps URL, but it works with a 3rd party site's static maps function. According to Static Maps API examples there should be no issue, but I can't seem to recreate the Polygon.
Working version (with same attributes in URL, though it ignores Satellite and zoom resolution) from 3rd Party site.
Desired version missing the polygon.
The question is: Am I missing some parameter? I do have an API key which I removed from the URL, so that must not be the issue..
Your original Desired Version uses a parameter that Google does not support. Removing just opacity:0|
and it works:
http://maps.googleapis.com/maps/api/staticmap?center=33.402285,-111.94271500000002&zoom=20&size=600x600&maptype=satellite&sensor=false&path=color%3ared|weight:1|fill%3awhite|33.4022475,-111.9426775|33.4022475,-111.9427525|33.4023225,-111.9427525|33.4023225,-111.9426775|33.4022475,-111.9426775
Opacity on google maps is set in the color as a 32-bit hexadecimal value, so
So I think this is what you are looking for (or really close):
http://maps.googleapis.com/maps/api/staticmap?center=33.402285,-111.942715&zoom=20&size=600x600&maptype=satellite&sensor=false&path=color:red|weight:1|fillcolor:white|33.4022475,-111.9426775|33.4022475,-111.9427525|33.4023225,-111.9427525|33.4023225,-111.9426775|33.4022475,-111.9426775
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With