Last active
August 29, 2015 14:17
-
-
Save amarinelli/ac52f8ba003d8ca9ac31 to your computer and use it in GitHub Desktop.
Leaflet GeoJSON (esri): Leaflet AJAX // source http://jsbin.com/debolatopa
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"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=1024, user-scalable=no"> | |
<style> | |
html { height: 100% } | |
body { height: 100%; margin: 0; padding: 0;} | |
#map{ height: 100% } | |
</style> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script> | |
<script type="text/javascript" src="https://rawgit.com/calvinmetcalf/leaflet-ajax/master/dist/leaflet.ajax.js"></script> | |
<title>Leaflet AJAX</title> | |
</head> | |
<body> | |
<div id="map"></div> | |
<script type="text/javascript"> | |
var m = L.map('map').setView([37.35, -112.99], 10); | |
var osmDataAttr = 'Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'; | |
var osm = L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:osmDataAttr}); | |
osm.addTo(m); | |
var geojson = new L.GeoJSON.AJAX("http://services.arcgis.com/AtfpSdJcsnQiIRhL/arcgis/rest/services/Ranger/FeatureServer/0/query?where=1%3D1&outFields=*&outSR=4326&f=geojson", {}); | |
geojson.addTo(m); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment