Skip to content
Snippets Groups Projects

hotline #143830 call links event binding on openSteetMap popup

Merged Ghislain Loas requested to merge hotline#143830_bug_carte_du_territoire into master
Compare and
1 file
+ 23
10
Preferences
Compare changes
@@ -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);