diff --git a/mapentity/static/mapentity/mapentity.forms.js b/mapentity/static/mapentity/mapentity.forms.js index 489877f35..c00f121b4 100644 --- a/mapentity/static/mapentity/mapentity.forms.js +++ b/mapentity/static/mapentity/mapentity.forms.js @@ -37,6 +37,29 @@ MapEntity.GeometryField = L.GeometryField.extend({ this._addExtraLayers(map); }, + _addExtraControls: function (map) { + /* + * Allow to load files locally. + */ + var pointToLayer = function (feature, latlng) { + return L.circleMarker(latlng, {style: window.SETTINGS.map.styles.filelayer}) + .setRadius(window.SETTINGS.map.styles.filelayer.radius); + }, + onEachFeature = function (feature, layer) { + if (feature.properties.name) { + layer.bindLabel(feature.properties.name); + } + }, + filecontrol = L.Control.fileLayerLoad({ + fitBounds: true, + layerOptions: {style: window.SETTINGS.map.styles.filelayer, + pointToLayer: pointToLayer, + onEachFeature: onEachFeature} + }); + map.filecontrol = filecontrol; + map.addControl(filecontrol); + }, + _addExtraLayers: function (map) { // Layer with objects of same type var objectsLayer = this.buildObjectsLayer();