Tuesday, March 8, 2011

Expanded version of Static Maps Creator

Wouldn't be easier to edit static maps on Google Maps' My Maps screen? Yes it is!
And since Pamela Fox published her "My Maps -> Static Maps converter" it became possible.

But it lacked many feature that I implemented in my version:

  • Polygon simplification
    When the generated URL exceeds 2048 characters, the polyline resolution is reduced to fit this limit. You can see that the following msid works in this version while it didn't in Pamela's: 204800902137920655010.000497ccb8f8082d2c1fd
  • Additional output formats for changes propagation
    With Pamela's version you had to copy the image URL and paste in your site. Any changes you made to your Map wouldn't replicate to your site. It accepts the following outputs:
    • HTML output: iframe it
    • URL output: retrieve the url
    • JSONC output: retrieve a XSS compatible JSON. It accepts the `callback` parameter indicating which function should be called. The default value is `callback`.
    • Image: a JS that inserts the map in the same position as the "script" tag is in the HTML
    • ImageTest: a live HTML demo for the /image output
  • Parameter forwarding
    The following parameters are now forwarded to the Static Maps API
    • sensor (default = false)
    • size (default = 640x640)
    • maptype
    • language
    • format
    • center
    • zoom

    The current implementation also forwards the `color` and `fillcolor` parameters, but those should be read from the KML in the future.


Remco said...

Hi Jader,

I was very happy to find your version of the static map converter, because Pamelas version got me errors because of too long urls.
However, the link to the source code is no longer working.
Could you please fix the link or add it here?

thanks a lot!


Jader Dias said...

Hi Remco,

I updated the site to link the new repository URL.
Thank you for your feedback.

Jader Dias

Remco said...

Hi Jader,

thanks a lot!