Last active
April 18, 2017 12:48
-
-
Save geog4046instructor/66727bf4b79e1a2c8bc9 to your computer and use it in GitHub Desktop.
Leaflet - Get external GeoJSON
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
/* Get GeoJSON data from an external website using jQuery's getJSON function. | |
* | |
* function: getJSON | |
* documentation: http://api.jquery.com/jquery.getjson/ | |
* | |
* See the Leaflet documentation on using GeoJSON | |
* http://leafletjs.com/examples/geojson/ | |
*/ | |
jQuery.getJSON( "http://example.com/layer1.geojson", function( geojsonFeature ) { | |
// code to do something with geojsonFeatures goes here, such as the L.geoJson function with the onEachFeature option | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment