Make Maps into Static Images

In a single image, maps can communicate a lot about the world around us. Whether it’s directions from point A to point B, or a glimpse at all of your customers in a region, a map tells a story. Like the picture that’s worth 1,000 words, a map can be the same. And while we obviously love interactive maps, there are situations where a static map image does as good or better.

For example, say you want to embed a map on Facebook or Twitter or even email. An interactive map won’t work there, for technical reasons. Instead you need an image version of the map. There are several services that can generate maps, complete with marker icons, into static images. In this post, we’ll share several of these options and discuss the pros and cons of each.

Differences in Static Map Generators

We’ll go into detail about each of the map generators in the next sections, but first it’s good to get an idea of the common themes. There are three main areas to consider when comparing static map generators:

  • How data is sent: In many cases you need to know the map coordinates, the latitude/longitude pairs that describe a location on a map. However, others allow you to send the human-readable names or addresses, and do the geocoding conversion to coordinates for you.
  • Style of the maps: Usually the ways the maps and markers look are already decided for you by the mapping provider. However, in a couple circumstances you can customize the look. The tradeoff, of course, is in complexity and the time it takes to set up.
  • Requirements: While every provider mentioned here offers free versions, some have advanced features available for a cost. And, in many cases, even the free versions require you to register for an account and/or an “API Key,” that identifies your static map requests as yours.

With these issues covered, we’ll get into what’s possible with each of these static map generators.

BatchGeo

Every interactive map made with BatchGeo also has a corresponding static map badge, an image you can use with or without the larger map. There are no API Keys or URL patterns required, though you do need to use the BatchGeo editor to make updates to your image map.

To create a map, follow these steps:

  1. Paste your spreadsheet data into the map builder and make sure to enter your email address when saving.
  2. You should receive an email shortly after saving your map with details on how to edit it.
  3. Click to the edit link, and scroll down to the “map badge” code section.
  4. Copy/paste the code onto your web page, you are done!

The image itself does have a few optional tweaks you can make to the URL, which looks like this:
https://static.batchgeo.com/map/png/?i=national-parks&width=284&height=142

To adjust the size or shape of the image, just change the width= and height= fields in the URL before saving the file.

BatchGeo also includes a number of ways to customize the style of your map. When creating your map, choose “Validate and Set Options,” then select “Advanced Options” to change the color and shape of the markers, as well as select from six underlying map styles.

Google

The de facto choice for interactive maps also has static image mapping available. While the search giant refers to this tool as the Static Maps API, it’s not an API in the usual tech sense. That’s because you can use it without writing a single line of code. Rather, all of the inputs needed to create a static map with Google come through the URL.

Consider the above image, which was generated from this URL:
https://maps.googleapis.com/maps/api/staticmap?center=37.819722,-122.478611&zoom=12&size=400×300&markers=37.819722,-122.478611&markers=37.799,-122.4664

Each parameter can be changed and will update the map in some way. While this example uses latitude and longitude coordinates, one of the best features of Google’s static maps are the built in geocoding. For example, here is the URL for a similar map, using human-friendly values:
https://maps.googleapis.com/maps/api/staticmap?center=Golden+Gate+Bridge+San+Francisco+CA&zoom=12&size=400×300&markers=Golden+Gate+Bridge+San+Francisco+CA&markers=Presidio+San+Francisco+CA

The result is a bit longer, but much easier to update. While this example uses two landmarks, you can also use city names, postal codes, and full addresses, right in the image URL.

In addition, Google supports a bunch of advanced features, like marker colors, marker labels, and entire map style changes. Everything can be set from the URL, though for these more advanced uses, you’ll definitely need an API Key to identify yourself. You can find out more about all of this in Google’s documentation.

MapBox

MapBox is a lesser-known mapping provider that also appeared on our list of 3 ways to style maps. While its speciality is extremely customized control of how the map looks, including the ability to bring your own underlying data, it also has a static map service for its stock data.

The above image, similar to the Google example, was generated with this URL:
https://api.mapbox.com/styles/v1/mapbox/streets-v10/static/pin-m(-122.478611,37.819722),pin-m(-122.4664,37.799)/-122.478611,37.819722,11/400×300?access_token=TOKEN

All aspects of the map are generated from the data passed in the URL. If you look closely, you’ll find the center of the map, the points for the two markers, the zoom level, and the size of the image. Unlike Google’s states maps, MapBox does not use URL fields, but rather its own format of describing points, paths, and other “overlays” (mapping speak for any objects that can be added atop the base map). MapBox also supports an advanced overlay format in GeoJSON, a standard popular in web cartography circles.

Something to note about MapBox that is different from all the other providers: the coordinates to designate a place must be passed in “longitude,latitude” order. If you get that wrong, you could find yourself in the wrong quadrant of the world (or with an error about latitude out of range).

Looking at that URL, you may have also noticed the access_token field. MapBox requires an API key. With a free MapBox account, you can retrieve a public token here.

Of course, as you would expect with the customizability of MapBox, you can load any styles stored in your account. You can find all the options and details in the full documentation.

MapQuest

Are you surprised that this map granddaddy has a static map offering? Yes, the original web map has a robust developer platform, including interactive maps. While the underlying map cannot be changed, there are still many options available that make MapQuest a contender.

To generate the map above, use this simple URL:
https://www.mapquestapi.com/staticmap/v4/getmap?size=400,300&pois=default,37.819722,-122.478611|default,37.799,-122.4664&key=KEY

One thing MapQuest has going for it is smart defaults. When a map contains markers (which it calls POIs—points of interest), a center and zoom level are not needed. In fact, in our tests, the center field is ignored in favor of a centroid calculated from the markers on the map. This ensures that everything meant to be visible is part of the image. Other providers have this option, but it’s a requirement with MapQuest.

As with others, you can see that the API Key is a requirement. There are generous free limits available once you create an API Key.

Among the features most interesting in MapQuest is marker labels. You can replace “default” in the URL above to get any number of letter you want in the marker. Other customization options and examples are available in the documentation.

Bing Maps

Don’t count Microsoft out of this mapping fun. Through its search brand, Bing, there is an API for Bing Maps. Among the options in the Bing Maps suite is static maps.

That map looking familiar yet? Here’s how you can create it with Bing Maps:
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/37.819722,-122.478611/12?mapSize=400,300&pushpin=37.819722,-122.478611&pushpin=37.799,-122.4664&key=KEY

While not called out as fields, the map type, center location, and zoom level are all included before the question mark in the URL. Like Google, you set multiple markers by duplicating the field (in this case, called “pushpin”). There are additional marker options to change the style and add labels.

Again, with Bing you’ll need an API Key. You can register and create one for free using the Bing Maps Portal. For all the various options available, see Bing’s static maps documentation.

Comparison Table

Feature BatchGeo Google MapBox MapQuest Bing
Human-readable names Yes Yes No No No
Coordinates style Two columns Lat,Lng Lng,Lat Lat,Lng Lat,Lng
Change map style Yes Yes Yes No No
API Key required Never Sometimes Always Always Always
Spreadsheet upload Yes No No No No

Beautiful, High Resolution, Printable Maps

Static maps are a great choice for websites where you don’t need interactivity, but you want to communicate the locations. You can also reuse them in social media, emails, and other places where interactive maps are not possible. Yet, sometimes what you need is something in higher resolution. For example, you may want to print a map or share a high quality PDF.

Every BatchGeo Pro account comes with unlimited high resolution maps for you and your entire team. Plus, you get lightning-fast map creation with support for interactive and static maps with up to 20,000 locations. Try it now!