MCPcopy Create free account
hub / github.com/alyssaxuu/mapus / exportGeoJSON

Function exportGeoJSON

src/main.js:1196–1211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1194
1195 // Export GeoJSON
1196 function exportGeoJSON() {
1197 var tempgroup = new L.FeatureGroup();
1198 map.addLayer(tempgroup);
1199 map.eachLayer(function(layer) {
1200 if (layer instanceof L.Marker || layer instanceof L.Polyline || layer instanceof L.Polygon) {
1201 layer.addTo(tempgroup);
1202 }
1203 });
1204
1205 // Download GeoJSON locally
1206 var a = document.createElement("a");
1207 var file = new Blob([JSON.stringify(tempgroup.toGeoJSON())], {type: "application/json"});
1208 a.href = URL.createObjectURL(file);
1209 a.download = "geojson";
1210 a.click();
1211 }
1212
1213 // Render user cursors
1214 function renderCursors(snapshot, key) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected