Skip to content

Instantly share code, notes, and snippets.

@rjmackay
Created June 12, 2013 01:10
Show Gist options
  • Select an option

  • Save rjmackay/5762195 to your computer and use it in GitHub Desktop.

Select an option

Save rjmackay/5762195 to your computer and use it in GitHub Desktop.

Revisions

  1. rjmackay created this gist Jun 12, 2013.
    14 changes: 14 additions & 0 deletions main.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    requirejs.config({
    shim: {
    'http://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.js': {
    exports: 'L'
    }
    }
    });

    require(["http://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.js"], function(mapbox) {

    var map = L.mapbox.map('map', 'examples.map-4l7djmvo')
    .setView([40, -74.50], 9);

    });
    20 changes: 20 additions & 0 deletions map.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    <!DOCTYPE html>
    <html>
    <head>
    <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
    <!-- data-main attribute tells require.js to load
    scripts/main.js after require.js loads. -->
    <script data-main="main" src="http://requirejs.org/docs/release/2.1.6/minified/require.js"></script>
    <link href='http://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.css' rel='stylesheet' />
    <!--[if lte IE 8]>
    <link href='http://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.ie.css' rel='stylesheet' >
    <![endif]-->
    <style>
    body { margin:0; padding:0; }
    #map { position:absolute; top:0; bottom:0; width:100%; }
    </style>
    </head>
    <body>
    <div id='map'></div>
    </body>
    </html>