Skip to content
Snippets Groups Projects
Commit a6afd603 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'hotline#143830_bug_carte_du_territoire' into 'master'

hotline #143830 call links event binding on openSteetMap popup

See merge request !4436
parents 8217462c 22c3c95a
Branches
Tags
1 merge request!4436hotline #143830 call links event binding on openSteetMap popup
Pipeline #17165 passed with stage
in 40 minutes and 9 seconds
......@@ -24,6 +24,11 @@
var loadMap = function() {
var container = widget.find('.leaflet_osm');
container.innerHTML = '';
if(null != (initialized = L.DomUtil.get(container.attr('id'))))
initialized._leaflet_id = null;
var disable_zoom_animation = container.data('osm-disable-zoom-animation');
var map = L.map(container.attr('id'),
......@@ -37,7 +42,7 @@
if (1 == container.attr('data-osm-layer'))
L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png',
{attribution: '&copy;<a href="https://osm.org/copyright">OpenStreetMap</a> contributors'})
{attribution: '&copy;<a href="https://osm.org/copyright">OpenStreetMap</a> contributors'})
.addTo(map);
var clusterize_markers = (undefined != L.markerClusterGroup);
......@@ -116,6 +121,14 @@
map.fitBounds(markers_group.getBounds(), {padding: [1, 1]});
}
var initBokehAnchors = function() {
if ( typeof initializePopups === 'function')
initializePopups();
if ( typeof setupAnchorsTarget === 'function')
setupAnchorsTarget();
}
map.on('popupclose', function() {
if (clusterize_markers || relative_zoom)
return;
......@@ -125,20 +138,20 @@
map.on('popupopen', function(event) {
$('.leaflet-popup-content img').on('load', function() {
$('.leaflet-popup-content img').on('load', function(e) {
event.popup.update();
})
event.popup.update();
});
widget.on('mouseover', function(e) {
if ( ! widget.find('.leaflet-popup-content a[data-popup]').length)
return;
if ( typeof initializePopups === 'function')
initializePopups();
initBokehAnchors();
});
if ( typeof setupAnchorsTarget === 'function')
setupAnchorsTarget();
initBokehAnchors();
});
originalPosition();
if (relative_zoom)
map.zoomIn(relative_zoom);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment