Skip to content

Commit

Permalink
add-logging-to-test-validation-map
Browse files Browse the repository at this point in the history
  • Loading branch information
srbgs committed Mar 19, 2024
1 parent 90cec2f commit 1d881d1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/static/css/htmlView.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
/* Styling for HTML validation result viewer plugin */

#resultPopup{
display:block;
display:block;
border:1px solid #CCCCCC;
background-color:#FAFAFA;
margin:5px;
margin:5px;
padding:0px;
}
}

/* close button */
#resultPopup>h2>input{
Expand Down
11 changes: 9 additions & 2 deletions app/static/js/htmlView.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ agsHtml.parseValidationError=function(xhr){

agsHtml.parseValidationResponse=function(jData){
// validation success - show results
console.log("agsHtml.parseValidationResponse");
console.log(jData);
var i=0;
var fileResult={};
$("#res_Summary").html(jData.msg);
Expand All @@ -210,6 +212,9 @@ agsHtml.parseValidationResponse=function(jData){
};

agsHtml.displayFileResult=function(fileResult,ix){
console.log("agsHtml.displayFileResult");
console.log(fileResult);
console.log(ix);
var xhtml="";
var i=0;
var errGroups=[];
Expand Down Expand Up @@ -281,12 +286,14 @@ agsHtml.displayFileResult=function(fileResult,ix){
agsHtml.resetValidationMap();

if(fileResult.geojson && fileResult.geojson.type){
console.log("GOT GeoJSON");
// show GeoJSON if returned + pass through filename for popup
agsHtml.showOnValidationMap(fileResult.geojson,fileResult.filename,ix);
// enable download button
$("#downloadGeoJSONBtn").prop("disabled",false);
}
else{
console.log("NO GeoJSON");
// otherwise hide validation map + disable download button
agsHtml.hideValidationMap();
$("#downloadGeoJSONBtn").prop("disabled",true);
Expand All @@ -295,9 +302,7 @@ agsHtml.displayFileResult=function(fileResult,ix){
return true;
};


agsHtml.setupCollapsibles=function(){
console.log("agsHtml.setupCollapsibles");
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++){
Expand Down Expand Up @@ -325,11 +330,13 @@ agsHtml.showOnValidationMap=function(geoJSON,ix){
};

agsHtml.resetValidationMap=function(){
console.log("agsHtml.resetValidationMap");
vMap.resetValidationMap();
return true;
};

agsHtml.hideValidationMap=function(){
console.log("agsHtml.hideValidationMap");
vMap.hideValidationMap();
return true;
};
Expand Down
7 changes: 7 additions & 0 deletions app/static/js/validation-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ vMap.map={
};

vMap.setupValidationMap=function(){
console.log("vMap.setupValidationMap");
var baseLayers={};
var overlays={};
var mapOpts={
Expand All @@ -36,6 +37,10 @@ vMap.setupValidationMap=function(){
};

vMap.showOnValidationMap=function(geoJSON,fileName,ix){
console.log("vMap.showOnValidationMap");
console.log(geoJSON);
console.log(fileName);
console.log(ix);
// show GeoJSON features on map - add popups and tooltips
L.geoJSON(geoJSON,{
"pointToLayer":function(feature,latlng){
Expand All @@ -50,6 +55,7 @@ vMap.showOnValidationMap=function(geoJSON,fileName,ix){
};

vMap.fitValidationMap=function(){
console.log("vMap.fitValidationMap");
// fit bounds of validation GeoJSON layer(s)
vMap.map.lMap.fitBounds(vMap.map.lyrs.GeoJSON.getBounds());
return true;
Expand Down Expand Up @@ -92,6 +98,7 @@ vMap.pointToLayer=function(feature,latlng,ix){
};

vMap.resetValidationMap=function(){
console.log("vMap.resetValidationMap");
// force map redraw when showing map and clear out any existing layers
vMap.map.lyrs.GeoJSON.clearLayers();
vMap.map.lMap.invalidateSize();
Expand Down

0 comments on commit 1d881d1

Please sign in to comment.