May 11, 2011

Get Creative with the Open Static Maps API

As many of you are aware, MapQuest has had a Static Maps API Service using licensed data for quite some time now. So, it’s only fair that we now provide the same service using open data for the open community!

What does the API do then? The Open Static Map Service enables the user to create beautiful static map images generated via an HTTP request for their website or publication. The simplest example requires only a few key parameters:

  • key – your MapQuest AppKey
  • center – center of map in latitude/longitude
  • size – size of map in pixels
  • zoom – zoom level of map

For example, http://open.mapquestapi.com/staticmap/v4/getmap?key=Kmjtd%7Cluu7n162n1%2C22%3Do5-h61wh&size=600,200&zoom=15&center=41.862648,-87.615549 will result in the following image:

But what if you need to plot POI locations? On satellite imagery? Easy.
http://open.mapquestapi.com/staticmap/v4/getmap?key=Kmjtd%7Cluu7n162n1%2C22%3Do5-h61wh&size=600,200&zoom=3&center=35.60395,-98.906248&type=sat&pois=yellow_1,33.748867,-84.388185,0,0|yellow_1,29.763066,-95.363351,0,0

How about a route? No problem.
http://open.mapquestapi.com/staticmap/v4/getmap?key=Kmjtd%7Cluu7n162n1%2C22%3Do5-h61wh&size=600,200&zoom=14&shapeformat=cmp&center=40.770021,-73.984003&shape=y_zwFjsrbMxWkz@??}DoC??a@}CyBt@ySiN??fDeP&scenter=40.77069,-73.992378&ecenter=40.770935,-73.97644

Multiple features, plus an automatic ‘declutter’ option? You got it!
http://open.mapquestapi.com/staticmap/v4/getmap?key=Kmjtd%7Cluu7n162n1%2C22%3Do5-h61wh&declutter=true&size=600,200&center=40.720212,-74.066627&zoom=5&pois=yellow_1,40.037661,-76.305977,0,0|orange_1,41.761715,-72.686376,0,0|orange_1,41.394906,-73.454489,0,0|orange_1,41.380665,-73.420447,0,0

Now that you’ve seen a few examples, don’t be shy! Get creative by dynamically producing static maps for your website, adding your own custom icons, and more!

Visit the Open Static Map Developer’s Guide to learn about additional request parameters and options available. Or if you’re just a beginner, perhaps you’ll want to head straight to the Open Static Map Wizard.

As always, find us on Twitter @MapQuestTech or the Developer Network to provide feedback!

Follow @MapQuestTech on Twitter

MapQuest DevBlog RSS

Want to stay updated on all the latest advances? Subscribe to our blog feed and be among the first to receive the news!