Skip to content

Instantly share code, notes, and snippets.

@maptastik
Last active August 29, 2015 14:24
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 maptastik/0a2226b81f5623b67ffb to your computer and use it in GitHub Desktop.
Save maptastik/0a2226b81f5623b67ffb to your computer and use it in GitHub Desktop.
Esri-Leaflet with feature service and clicky popup
<html>
<head>
<meta charset=utf-8 />
<title>Esri-Leaflet | Simple Feature Layer + Clicky!</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="//cdn.jsdelivr.net/leaflet/0.7.3/leaflet.css" />
<script src="//cdn.jsdelivr.net/leaflet/0.7.3/leaflet.js"></script>
<!-- Load Esri Leaflet from CDN -->
<script src="//cdn.jsdelivr.net/leaflet.esri/1.0.0/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([38.317236, -84.564147], 15);
L.esri.basemapLayer('DarkGray').addTo(map);
var parcels = L.esri.featureLayer({
url: 'http://gis.gscplanning.com/arcgis/rest/services/Parcels/FeatureServer/0',
style: ({
color: 'red',
weight: 1,
fillOpacity: 0
})
}).addTo(map);
parcels.bindPopup(function (feature) {
return L.Util.template('<p>{GIS_MapID}', feature.properties);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment