All Downloads are FREE. Search and download functionalities are using the official Maven repository.

webapp.admin.js.geojson.js Maven / Gradle / Ivy

The newest version!
var GJ = (function () {
    var fromPolygon = function(layer) {
        var latlngs = layer.getLatLngs();
        var a = []
        for(var i = 0; i < latlngs.length; i++ ) { 
            a.push([latlngs[i].lat,latlngs[i].lng]) 
        }

        return JSON.stringify({ 
            "type" : "Feature",
            "properties" : {},
            "geometry" : {
                "type" : "Polygon",
                "coordinates" : [a]
            }
        })
    }
    return {
        // Creates GeoJson from a leaflet Polygon.
        fromPolygon : fromPolygon
    }
})();




© 2015 - 2025 Weber Informatics LLC | Privacy Policy