worldmap/worldmap.js
function doGeojson(g) {
    console.log("GEOJSON",g);
    if (!basemaps["geojson"]) {
        var opt = { style: function(feature) {
                var st = { stroke:true, color:"#910000", weight:2, fill:true, fillColor:"#910000", fillOpacity:0.3 };
                if (feature.hasOwnProperty("properties")) {
                    console.log("GPROPS", feature.properties)
                }
                if (feature.hasOwnProperty("style")) {
                    console.log("GSTYLE", feature.style)
                }
                return st;
            }
        }
        opt.onEachFeature = function (f,l) {
            if (f.properties) { l.bindPopup('<pre>'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>'); }
        }
        overlays["geojson"] = L.geoJson(g,opt);
        layercontrol.addOverlay(overlays["geojson"],"geojson");
    }
    overlays["geojson"].addData(g);
}
function doGeojson(g) {
    console.log("GEOJSON",g);
    if (!basemaps["geojson"]) {
        var opt = { style: function(feature) {
                var st = { stroke:true, color:"#910000", weight:2, fill:true, fillColor:"#910000", fillOpacity:0.3 };
                if (feature.hasOwnProperty("properties")) {
                    console.log("GPROPS", feature.properties)
                }
                if (feature.hasOwnProperty("style")) {
                    console.log("GSTYLE", feature.style)
                }
                return st;
            }
        }
        opt.onEachFeature = function (f,l) {
            if (f.properties) { l.bindPopup('<pre>'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>'); }
        }
        overlays["geojson"] = L.geoJson(g,opt);
        layercontrol.addOverlay(overlays["geojson"],"geojson");
    }
    overlays["geojson"].addData(g);
}
function doGeojson ( g ) { console . log ( "GEOJSON" , g ) ; if ( ! basemaps [ "geojson" ] ) { var opt = { style : function ( feature ) { var st = { stroke : true , color : "#910000" , weight : 2 , fill : true , fillColor : "#910000" , fillOpacity : 0.3 } ; if ( feature . hasOwnProperty ( "properties" ) ) { console . log ( "GPROPS" , feature . properties ) } if ( feature . hasOwnProperty ( "style" ) ) { console . log ( "GSTYLE" , feature . style ) } return st ; } } opt . onEachFeature = function ( f , l ) { if ( f . properties ) { l . bindPopup ( '<pre>' + JSON . stringify ( f . properties , null , ' ' ) . replace ( / [\{\}"] / g , '' ) + '</pre>' ) ; } } overlays [ "geojson" ] = L . geoJson ( g , opt ) ; layercontrol . addOverlay ( overlays [ "geojson" ] , "geojson" ) ; } overlays [ "geojson" ] . addData ( g ) ; }
handle any incoming GEOJSON directly - may style badly
handle any incoming GEOJSON directly - may style badly