Last active
May 2, 2016 19:45
-
-
Save jgravois/4c78fc0b5947d6a29404c51e3666992f to your computer and use it in GitHub Desktop.
static token feature layer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Esri Leaflet Debugging Sample</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<!-- Load Leaflet --> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.1/leaflet.css" /> | |
<script src="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.1/leaflet-src.js"></script> | |
<!-- Load Esri Leaflet from source--> | |
<script src="https://cdn.jsdelivr.net/leaflet.esri/2.0.0/esri-leaflet-debug.js"></script> | |
<style> | |
body { | |
margin:0; | |
padding:0; | |
} | |
#map { | |
position: absolute; | |
top:0; | |
bottom:0; | |
right:0;left:0; | |
} | |
#info-pane { | |
position: absolute; | |
top: 10px; | |
right: 10px; | |
z-index: 1000; | |
padding: 1em; | |
background: white; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="map"></div> | |
<div id="info-pane" class="leaflet-bar"> | |
<label> | |
sample application for debugging | |
</label> | |
</div> | |
<script> | |
var map = L.map('map').setView([40, -100], 4); | |
L.esri.basemapLayer('Topographic').addTo(map); | |
var fl = L.esri.featureLayer({ | |
url:'https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3', | |
/* | |
https://sampleserver6.arcgisonline.com/arcgis/tokens/generateToken | |
user: user1, password: user1, referer: https://bl.ocks.org/jgravois/ | |
*/ | |
token: 'CzWaFDnjfibZEdGs8eiqTkqstDaNDqiij5ZDDollIDLsSkc1KrI_flpg9_sYDKKapqqdFA1eyom0nVX2MQq05A..' | |
}).addTo(map); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment