DSContEd / IntroWebDevelopment

At the end of the course, students will be able to plan, design, and implement a web site using current standards and best practices.
1 stars 1 forks source link

Web Services: Where is the map data coming from in index.html? #9

Open TonyGoodDay2 opened 7 years ago

TonyGoodDay2 commented 7 years ago

Where is the map data coming from in index.html?

jjsahn commented 7 years ago

Retrieves the JSON data from the calls to the url var

//Retrieve JSON Data from call //DEV var url = "ExtendedConvertedGeoJSON/" + countryParam + ".json"; //STAGE/PROD Environment //var url = '/forms/mapjson_public/?country='+countryParam;

var data = {}; var PSNUData = $.getJSON(url);

$.when(PSNUData).done(function(aResult) { //console.log("aResult:", aResult); data = aResult; //console.log("data:", data); if (1 === 1) { jsonDatafromURL = data; var recordCollection = jQuery.parseJSON(JSON.stringify(jsonDatafromURL)); initializeGeoData(recordCollection); var geoDataFile = recordCollection;

    drawMap(geoDataFile);
} else {
    console.log("failed to load JSON DATA")
}
cmitchell74 commented 7 years ago

//Retrieve JSON Data from call //DEV var url = "ExtendedConvertedGeoJSON/" + countryParam + ".json"; //STAGE/PROD Environment //var url = '/forms/mapjson_public/?country='+countryParam;

var data = {}; var PSNUData = $.getJSON(url);

$.when(PSNUData).done(function(aResult) { //console.log("aResult:", aResult); data = aResult; //console.log("data:", data); if (1 === 1) { jsonDatafromURL = data; var recordCollection = jQuery.parseJSON(JSON.stringify(jsonDatafromURL)); initializeGeoData(recordCollection); var geoDataFile = recordCollection;

    drawMap(geoDataFile);
} else {
    console.log("failed to load JSON DATA")
}