Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
editor.editLayer.events.register('featureadded', this, function(object, element) {
localStorage['ole.map.features'] = geoJSON.write(editor.editLayer.features);
});
editor.editLayer.events.register('featureremoved', this, function(object, element) {
localStorage['ole.map.features'] = geoJSON.write(editor.editLayer.features);
});
editor.editLayer.events.register('afterfeaturemodified', this, function(object, element) {
localStorage['ole.map.features'] = geoJSON.write(editor.editLayer.features);
});
if (parseInt(localStorage['ole.map.zoom']) >= 0) {
map.setCenter(
new OpenLayers.LonLat(
parseFloat(localStorage['ole.map.center.lon']),
parseFloat(localStorage['ole.map.center.lat'])
),
parseInt(localStorage['ole.map.zoom'])
);
editor.editLayer.addFeatures(geoJSON.read(localStorage['ole.map.features']));
}
}
});
map.events.register('moveend', this, function(object, element) {
localStorage['ole.map.zoom'] = map.zoom;
localStorage['ole.map.center.lat'] = map.center.lat;
localStorage['ole.map.center.lon'] = map.center.lon;
});