Skip to content

Instantly share code, notes, and snippets.

@davestacey
Last active August 29, 2015 14:08
Show Gist options
  • Save davestacey/5397dc43a173b2a92db4 to your computer and use it in GitHub Desktop.
Save davestacey/5397dc43a173b2a92db4 to your computer and use it in GitHub Desktop.
getJSON
$(settings.leaflet).each(function() {
var geoJsonFile = 'http://' + window.location.hostname + '/geoJSON';
//var geoJsonFile = basePath + '/data/newjson.geojson';
console.log('geoJsonFile PATH', geoJsonFile);
// Load the overlay Data - FeatureCollection
$.getJSON(geoJsonFile, function(data) {
console.log( "getJSON success, data=", data );
weHaveJSONData(data);
})//function(data)
.done(function(data) {
//console.log( "second success-done", data );
})
.fail(function() {
console.log( "getJSON error!" );
})
.always(function() {
//console.log( "complete" );
});//$.getJSON
// Process the overlay data - Controller
function weHaveJSONData(featureData){
console.log('we Have Overlay Features', featureData);
featureCollection = featureData;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment