autopan with openlayers 3.10 and popover

المشرف العام

Administrator
طاقم الإدارة
I have a map made with ol3.10, there's an OSM layer and a GeoJSON layer with some points. I added an overlay with bootstrap popover to have popups that show points properties. At this point the problem is the popup position so, starting from this example, I can get popups with autopan function, but now the popup is split into two



The problem is that my part of code related to the popup content is different from the example. In the example there is

var content = document.getElementById('popup-content');and the popup content

content.innerHTML = 'You clicked here:

;Instead, in my map the the popup content is

var feature = map.forEachFeatureAtPixel(evt.pixel, function(feature, layer) { return feature; });if (feature) { $(element).popover('destroy'); popup.setPosition(coordinate); $(element).popover({ 'placement': 'auto top', 'animation': false, 'html': true, 'content':''+feature.get('nome')+'

}); $(element).popover('show');} else { $(element).popover('destroy'); }})How can I solve this?



أكثر...
 
أعلى