Skip to content

Commit

Permalink
Add removed code again
Browse files Browse the repository at this point in the history
  • Loading branch information
PON authored and PON committed Sep 4, 2023
1 parent 00c28d9 commit 766d1e7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions mapentity/static/mapentity/mapentity.forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 766d1e7

Please sign in to comment.