Skip to content

Instantly share code, notes, and snippets.

@cspanring
Created June 13, 2012 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cspanring/2923720 to your computer and use it in GitHub Desktop.
Save cspanring/2923720 to your computer and use it in GitHub Desktop.
MAPC basemap integration

MAPC basemap integration

This document explains how you can integrate a MAPC tile layer.

First, download or include our layer definitions:

<script type="text/javascript" src="http://tiles.mapc.org/layers.js"></script>

Then, follow the instructions below to add a MAPC layer to your JavaScript map:

ModestMaps:

var map = new MM.Map(...);
var layer = new MM.MAPCTileLayer("basemap");
map.addLayer(layer);

Leaflet:

var map = new L.Map(...);
var layer = new L.MAPCTileLayer("basemap");
map.addLayer(layer);

OpenLayers:

var map = new OpenLayers.Map(...);
var layer = new OpenLayers.Layer.MAPC("basemap");
map.addLayer(layer);

Google Maps V3:

var map = new google.maps.Map(...);
map.mapTypes.set("toner", new google.maps.MAPCMapType ("basemap"));
map.setMapTypeId("basemap");

jQuery Geo:

$("#map").geomap( {
    services: $.geo.MAPC( [ "basemap" ] ),
    center: [ -71.037598, 42.363281 ],
    zoom: 10
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment