{"_id":"586d8f521c014819000ea67a","category":{"_id":"586d8f511c014819000ea663","__v":0,"project":"56d629f02417921500c46716","version":"586d8f511c014819000ea65d","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-03-25T01:10:14.029Z","from_sync":false,"order":6,"slug":"integration-examples","title":"Examples"},"parentDoc":null,"project":"56d629f02417921500c46716","version":{"_id":"586d8f511c014819000ea65d","project":"56d629f02417921500c46716","__v":2,"createdAt":"2017-01-05T00:12:01.865Z","releaseDate":"2017-01-05T00:12:01.865Z","categories":["586d8f511c014819000ea65e","586d8f511c014819000ea65f","586d8f511c014819000ea660","586d8f511c014819000ea661","586d8f511c014819000ea662","586d8f511c014819000ea663","586d8f511c014819000ea664","587977f57a58130f00303d4e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"adams","version_clean":"2.0.0","version":"2.0"},"githubsync":"","__v":0,"user":"56d62986b30acf150053be43","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-25T02:22:55.578Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":8,"body":"[block:html]\n{\n  \"html\": \"<p>You can easily use <a href=\\\"http://developer.digitalglobe.com/maps-api/\\\">DigitalGlobe Maps API</a> with <a href=\\\"https://www.mapbox.com/mapbox.js/api/v2.2.2/\\\" target=\\\"_blank\\\">Mapbox.js,</a> a <a href=\\\"https://en.wikipedia.org/wiki/JavaScript\\\" target=\\\"_blank\\\">Javascript</a> library for fast &amp; interactive maps. Mapbox.js is built on top of <em><a href=\\\"http://www.leafletjs.com\\\" target=\\\"_blank\\\">Leaflet</a></em>, an open-source map library. Mapbox.js is available on <a href=\\\"https://github.com/mapbox/mapbox.js/\\\" target=\\\"_blank\\\">GitHub</a>, and is browser-tested with IE8+ and all <a href=\\\"http://browsehappy.com/\\\" target=\\\"_blank\\\">modern browsers</a>.</p>\\n\\n<p>The javascript code snippet below details how to integrate DigitalGlobe Maps API with <em>Mapbox.js</em>:</p>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// You will need to replace the 'L.mapbox.accessToken' and all 'L.mapbox.TileLayer' ID's with your own. get your keys here: http://platform.digitalglobe.com/maps-api\\n\\nL.mapbox.accessToken = 'ENTER YOUR MAPS API ACCESS TOKEN HERE';\\n\\nvar map = L.mapbox.map('map', null, {\\n        maxZoom: 19\\n}).setView([41.89, 12.486], 16);\\n\\nvar layers = {\\n        \\\"DG Maps API: Recent Imagery\\\": L.mapbox.tileLayer('digitalglobe.nal0g75k'),\\n        \\\"DG Maps API: Terrain Map\\\": \\nL.mapbox.tileLayer('digitalglobe.nako1fhg'),\\n        \\\"DG Maps API: Street Map\\\": \\nL.mapbox.tileLayer('digitalglobe.nako6329')\\n};\\n\\nvar base = L.mapbox.tileLayer('digitalglobe.nal0g75k').addTo(map);\\n\\nL.control.layers(layers, null, {\\n    collapsed: false\\n}).addTo(map);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"maps-api-mapboxjs","type":"basic","title":"Maps API + Mapbox.js"}

Maps API + Mapbox.js


[block:html] { "html": "<p>You can easily use <a href=\"http://developer.digitalglobe.com/maps-api/\">DigitalGlobe Maps API</a> with <a href=\"https://www.mapbox.com/mapbox.js/api/v2.2.2/\" target=\"_blank\">Mapbox.js,</a> a <a href=\"https://en.wikipedia.org/wiki/JavaScript\" target=\"_blank\">Javascript</a> library for fast &amp; interactive maps. Mapbox.js is built on top of <em><a href=\"http://www.leafletjs.com\" target=\"_blank\">Leaflet</a></em>, an open-source map library. Mapbox.js is available on <a href=\"https://github.com/mapbox/mapbox.js/\" target=\"_blank\">GitHub</a>, and is browser-tested with IE8+ and all <a href=\"http://browsehappy.com/\" target=\"_blank\">modern browsers</a>.</p>\n\n<p>The javascript code snippet below details how to integrate DigitalGlobe Maps API with <em>Mapbox.js</em>:</p>" } [/block] [block:code] { "codes": [ { "code": "// You will need to replace the 'L.mapbox.accessToken' and all 'L.mapbox.TileLayer' ID's with your own. get your keys here: http://platform.digitalglobe.com/maps-api\n\nL.mapbox.accessToken = 'ENTER YOUR MAPS API ACCESS TOKEN HERE';\n\nvar map = L.mapbox.map('map', null, {\n maxZoom: 19\n}).setView([41.89, 12.486], 16);\n\nvar layers = {\n \"DG Maps API: Recent Imagery\": L.mapbox.tileLayer('digitalglobe.nal0g75k'),\n \"DG Maps API: Terrain Map\": \nL.mapbox.tileLayer('digitalglobe.nako1fhg'),\n \"DG Maps API: Street Map\": \nL.mapbox.tileLayer('digitalglobe.nako6329')\n};\n\nvar base = L.mapbox.tileLayer('digitalglobe.nal0g75k').addTo(map);\n\nL.control.layers(layers, null, {\n collapsed: false\n}).addTo(map);", "language": "javascript" } ] } [/block]