Late last year, Google announced that their Maps API and Google Maps Imagery would become a charged ser­vice for high vol­ume users. Any­one host­ing more than 25,000 daily map views would incur charges accord­ing to this pric­ing scheme. It is impor­tant to note that, not only is the API restricted, but the imagery (google maps lay­ers) is restricted in the same fash­ion. For those that use any other API but still call upon Google base lay­ers, the restric­tion of 25,000 daily map views still holds true. Now, this web­site cer­tainly won’t gen­er­ate that kind of traf­fic any­time in the near future, but there cer­tainly are those kinds of web­sites on the inter­net that have well over a mil­lion page views a day. Those that first come to mind are travel ser­vice providers and real-estate agen­cies. Both ser­vices use maps as spa­tial deci­sion sup­port tools (eg. where should I live? where should we visit?). I am tak­ing this oppor­tu­nity to round up the APIs that I am famil­iar with and would rec­om­mend to those mak­ing the move away from Google.

OpenLayers

I was first intro­duced to web-mapping with Open­Lay­ers and I con­tinue to return to their exten­sively devel­oped API. Open­Lay­ers is one of the most pop­u­lar open source web map­ping libraries due to its long devel­op­ment life (old­est), also because it is a com­plex and well doc­u­mented library. I have used Open­Lay­ers for Geo­J­SON, KML and XML data over­lays, as well as sim­ple maps that call upon WMS and WFS services.

Open­Lay­ers Hello World Example:

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OpenLayers Hello World Example</title>
    <link rel="stylesheet" href="script/openlayers/theme/default/style.css" type="text/css">
    <script src="script/openlayers/OpenLayers.js"></script>
    <style type="text/css">
    #map {width:500px; height:200px; border: 1px black solid;}
    </style>
    <script type="text/javascript">
        var map, layer;
        
        function init(){
            map = new OpenLayers.Map( 'map' );
            
            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
                    "http://vmap0.tiles.osgeo.org/wms/vmap0",
                    {layers: 'basic'} );
                    
            map.addLayer(layer);
            
            map.zoomToMaxExtent();
        }
    </script>
  </head>
  <body onload="init()">
    <div id="map"></div>
  </body>
</html>

 

 
 

Leaflet

Leaflet is a new library that pro­vides a great vari­ety of use­ful tra­di­tional web map­ping fea­tures, as well as some unique exten­si­bil­ity (such as con­nec­tiv­ity to Car­toDB). The web-maps pro­duced by Leaflet are some of the most beau­ti­ful maps straight out of the box. Leaflet uti­lizes HTML5 and CSS3 for many of its fea­tures, which con­tributes to its mod­ern look. If you are look­ing for a mod­ern, light­weight (21kb gzip vs OpenLayers@770kb gzip) and mobile friendly library, this ones for you!

Leaflet Hello World Example:

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Leaflet Hello World Example</title>
	<link rel="stylesheet" href="script/leaflet/leaflet.css" />
	<!--[if lte IE 8]><link rel="stylesheet" href="script/leaflet/leaflet.ie.css" /><![endif]-->
    <style type="text/css">
    #map {width:500px; height:200px; border: 1px black solid;}
    </style>
</head>
<body>
	<div id="map"></div>
	<script src="script/leaflet/leaflet.js"></script>
	<script>
		var map = new L.Map('map');

		var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
			cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
			cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
			
		map.setView(new L.LatLng(0, 0), 0).addLayer(cloudmade);
	</script>
</body>
</html>

 

 
 

Polymaps

One of the few libraries that uses vec­tor graph­ics to dis­play infor­ma­tion, Polymaps allows devel­op­ers to use famil­iar css3 to very eas­ily style map over­lay ele­ments. Zoom­ing in and out on a Polymaps map feels and looks dif­fer­ent than the pre­vi­ously men­tioned libraries because Polymaps doesn’t force the browser to ren­der zoom lev­els. Zoom­ing now becomes a con­tin­u­ous scale from ‘0’ to ‘max’, which vec­tor ele­ments have no trou­ble with. Scaleable vec­tor graph­ics don’t lose qual­ity as they scale up or down in size mak­ing them ideal data layer types for map­ping purposes.

Polymaps Hello World Example:

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Polymaps Hello World Example</title>
	<link rel="stylesheet" href="script/polymaps/polymaps.css" />
    <style type="text/css">
    #map {width:500px; height:200px; border: 1px black solid;}
    </style>
</head>
<body>
	<div id="map"></div>
	<script src="script/polymaps/polymaps.min.js"></script>
	<script>
        var po = org.polymaps;
        
        var map = po.map()
            .container(document.getElementById("map").appendChild(po.svg("svg")))
            .center({lat: 0, lon: 0})
            .zoom(0)
            .add(po.interact())
            .add(po.hash());
        
        map.add(po.image()
            .url(po.url("http://{S}tile.cloudmade.com"
            + "/BC9A493B41014CAABB98F0471D759707"
            + "/998/256/{Z}/{X}/{Y}.png")
            .hosts(["a.", "b.", "c.", ""])));
        
        map.add(po.compass()
            .pan("none"));
	</script>
</body>
</html>

 

 
 

Other Popular Alternatives

Open Web Map Services

As noted in the intro­duc­tion, the Google Imagery base lay­ers are also part of the 25,000 map view limit. A move towards open WMS is needed for those exceed­ing this amount. The Open­Lay­ers exam­ple uti­lizes the Metacarta WMS pro­vided by OSGeo. The Leaflet and Polymaps exam­ples uti­lize the Cloud­made WMS, which is a tiled map ser­vice based on Open­StreetMap data.

The two WMS/Tiles that I tend to use most often:

Any ques­tions? Just ask!

 
 
If this post helped you and you enjoy my site I would hap­pily accept Lite­coin dona­tions:
 
LKPfT772e9HxvXYcA8LVDctTmENoqQxQF3
 

Thank you!

  7 Responses to “Alternatives to Google Maps”

  1. Hello Michael,

    Thank you very much for this well-designed and infor­ma­tive site and posts.

    I’m a Cer­tifi­cate in Spa­tial Geog­ra­phy and GIS stu­dent at Ryerson.

    In pre­vi­ous lives I was a geol­o­gist, IT man­ager, photographer…

    Peter Feib­ert

    • Hi Peter!

      Thanks for brows­ing the blog and tak­ing the time to com­ment, it means a lot to me.

      Say hi if you see me in the lab, always happy to meet new peo­ple and put faces to names.

      Cheers,
      Michael

  2. Thanks for this look at some alter­na­tives to Google Maps.

  3. […] Leaflet Hello World Exam­ple #map {width:500px; height:200px; bor­der: 1px black solid;} var map = new L.Map(‘map’); var cloud­madeUrl = ‘http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png’, cloud­madeAt­tri­bu­tion = ‘Map data © 2011 Open­StreetMap con­trib­u­tors, Imagery © 2011 Cloud­Made’, cloud­made = new L.TileLayer(cloudmadeUrl, {max­Zoom: 18, attri­bu­tion: cloud­madeAt­tri­bu­tion}); map.setView(new L.LatLng(0, 0), 0).addLayer(cloudmade); Polymaps Alter­na­tives to Google Maps | Spa­tial Analysis […]

  4. Map­Box is a good alter­na­tive :)
    http://mapbox.com/

    • Hi Julien!

      Map­Box is a great alter­na­tive and I hope to write a blog post on their ser­vices in the near future. I have been using Tilemill and Tilestream (although, not com­mer­cially), and they have proven to be super intu­itive and very pow­er­ful for cre­at­ing and serv­ing map data. If any­one has access to a server from which they can host a TileStream ser­vice, I would def­i­nitely rec­om­mend it!

  5. Hey there, You have per­formed an incred­i­ble job.
    I will def­i­nitely digg it and for my part sug­gest to my friends.
    I am con­fi­dent they’ll be ben­e­fited from this site.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>