Skip to content

Commit

Permalink
🐛 [BUG] Fix cannot click on objects after customizing map styles (refs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chatewgne committed Nov 3, 2023
1 parent 6cf5f1f commit 1795689
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CHANGELOG
**Bug fixes**

- Fix: filters choices can raise exception in lists and not updated until application restart (#3812)
- Fix cannot click on objects after customizing map styles (#3800)


2.101.3 (2023-10-26)
Expand Down
4 changes: 3 additions & 1 deletion geotrek/feedback/static/feedback/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ $(window).on('entity:map', function (e, data) {
var map = data.map;

// Show report layer in application maps
var style = L.Util.extend({ clickable: false },
window.SETTINGS.map.styles[landLayer.id] || {});
var layer = new L.ObjectsLayer(null, {
modelname: modelname,
style: L.Util.extend(window.SETTINGS.map.styles[modelname] || {}, { clickable: false }),
style: style,
});

if (data.modelname != modelname) {
Expand Down
4 changes: 3 additions & 1 deletion geotrek/infrastructure/static/infrastructure/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ $(window).on('entity:map', function (e, data) {
var map = data.map;

// Show infrastructure layer in application maps
var style = L.Util.extend({ clickable: false },
window.SETTINGS.map.styles[modelname] || {});
var layer = new L.ObjectsLayer(null, {
modelname: modelname,
style: L.Util.extend(window.SETTINGS.map.styles[modelname] || {}, { clickable:false }),
style: style,
});

if (data.modelname != modelname){
Expand Down
4 changes: 3 additions & 1 deletion geotrek/outdoor/static/outdoor/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ $(window).on('entity:map', function (e, data) {
var loaded_site = false;
var loaded_course = false;
// Show outdoor layers in application maps
var style = L.Util.extend({ clickable: false },
window.SETTINGS.map.styles[modelname] || {});
$.each(['site', 'course'], function (i, modelname) {
var layer = new L.ObjectsLayer(null, {
modelname: modelname,
style: L.Util.extend(window.SETTINGS.map.styles[modelname] || {}, { clickable: false }),
style: style,
});
if (data.modelname != modelname) {
map.layerscontrol.addOverlay(layer, tr(modelname), tr('Outdoor'));
Expand Down
4 changes: 3 additions & 1 deletion geotrek/sensitivity/static/sensitivity/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ $(window).on('entity:map', function (e, data) {
var map = data.map;

// Show sensitiveare layer in application maps
var style = L.Util.extend(window.SETTINGS.map.styles[modelname] || {}, {clickable: false})

var layer = new L.ObjectsLayer(null, {
modelname: modelname,
style: L.Util.extend(window.SETTINGS.map.styles[modelname] || {}, {clickable: false}),
style: style,
});

if (data.modelname != modelname) {
Expand Down
5 changes: 3 additions & 2 deletions geotrek/signage/static/signage/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ $(window).on('entity:map', function (e, data) {
var url = window.SETTINGS.urls[layername];
var loaded_infrastructure = false;
var map = data.map;

var style = L.Util.extend({ clickable: false },
window.SETTINGS.map.styles[modelname] || {});
// Show infrastructure layer in application maps
var layer = new L.ObjectsLayer(null, {
modelname: modelname,
style: L.Util.extend(window.SETTINGS.map.styles[modelname] || {}, { clickable:false }),
style: style,
});

if (data.modelname != modelname){
Expand Down
4 changes: 3 additions & 1 deletion geotrek/tourism/static/tourism/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ $(window).on('entity:map', function (e, data) {
var map = data.map;
var loaded_event = false;
var loaded_touristic = false;
var style = L.Util.extend({ clickable: false },
window.SETTINGS.map.styles[modelname] || {});
// Show tourism layer in application maps
$.each(['touristiccontent', 'touristicevent'], function (i, modelname) {
var layer = new L.ObjectsLayer(null, {
modelname: modelname,
style: L.Util.extend(window.SETTINGS.map.styles[modelname] || {}, {clickable:false}),
style: style,
});
if (data.modelname != modelname){
map.layerscontrol.addOverlay(layer, tr(modelname), tr('Tourism'));
Expand Down

0 comments on commit 1795689

Please sign in to comment.