I am using “togeojson” and “Leaflet.FileLayer” for File upload in my leaflet draw using below Code:
L.Control.FileLayerLoad.LABEL = '<img class="icon" src="folder.svg" alt="file icon"/>';
var style = {color:'red', opacity: 1.0, fillOpacity: 1.0, weight: 2, clickable: false};
var LoadFile = L.Control.fileLayerLoad({
position: 'topright',
layer: L.geoJson,
// See http://leafletjs.com/reference.html#geojson-options
layerOptions: {style: {color:'red'}},
// Add to map after loading (default: true) ?
addToMap: true,
// File size limit in kb (default: 1024) ?
fileSizeLimit: 1024,
// Restrict accepted file formats (default: .geojson, .kml, and .gpx) ?
formats: [
'.geojson',
'.kml',
'.gpx'
]
}).addTo(map);
How do I access upload file data so I can put it into editable layer and edit uploaded draw and save as geojson?
I have previously load geojson to leaflet draw and edite json + save to database but not success to get upload from directory.