Skip to content

Instantly share code, notes, and snippets.

@vgeorge
Last active April 14, 2016 17:10
Show Gist options
  • Save vgeorge/c16c57d4fd9f4a3062146aed25da7f1e to your computer and use it in GitHub Desktop.
Save vgeorge/c16c57d4fd9f4a3062146aed25da7f1e to your computer and use it in GitHub Desktop.
An example of using esri-leaflet plugin to display a map from a MapService
<html>
<head>
<meta charset=utf-8 />
<title>Example</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/1.0.0-beta.2/leaflet.css" />
<script src="https://cdn.jsdelivr.net/leaflet/1.0.0-beta.2/leaflet.js"></script>
<!-- Load Esri Leaflet from CDN -->
<script src="https://cdn.jsdelivr.net/leaflet.esri/2.0.0-beta.8/esri-leaflet.js"></script>
<style>
body { margin:0; padding:0; }
#map { position: absolute; top:0; bottom:0; right:0; left:0; }
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map('map').setView([ 0, 0], 0);
L.esri.tiledMapLayer({
url: "http://tiles.arcgis.com/tiles/RTK5Unh1Z71JKIiR/arcgis/rest/services/overall_risk/MapServer"
}).addTo(map);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment