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 17391bf commit 7cefd3c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CHANGELOG

- Fix: filters choices can raise exception in lists and not updated until application restart (#3812)
- Fix missing geometries for HD `view_points` in APIv2's `/poi/` and `/site/` routes (#3701)
- Fix cannot click on objects after customizing map styles (#3800)


2.101.3 (2023-10-26)
Expand All @@ -24,7 +25,6 @@ CHANGELOG

**Bug fixes**

- Fix UI bug when customizing intervention map style (#3800)
- Fix Aggregator fails when updating Tour steps order (#3793)
- Fix services list display error (refs ##3795)

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[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/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 @@ -5,9 +5,11 @@ $(window).on('entity:map', function (e, data) {
var loaded_course = false;
// Show outdoor layers in application maps
$.each(['site', 'course'], function (i, modelname) {
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) {
map.layerscontrol.addOverlay(layer, tr(modelname), tr('Outdoor'));
Expand Down
5 changes: 4 additions & 1 deletion geotrek/sensitivity/static/sensitivity/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ $(window).on('entity:map', function (e, data) {
var map = data.map;

// Show sensitiveare 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
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
5 changes: 4 additions & 1 deletion geotrek/tourism/static/tourism/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@ $(window).on('entity:map', function (e, data) {
var map = data.map;
var loaded_event = false;
var loaded_touristic = false;

// Show tourism layer in application maps
$.each(['touristiccontent', 'touristicevent'], function (i, modelname) {
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){
map.layerscontrol.addOverlay(layer, tr(modelname), tr('Tourism'));
Expand Down

0 comments on commit 7cefd3c

Please sign in to comment.