Simplify icon example and show popup at clicked position
By using the event's coordinate instead of the feature's, we make sure that the popup is shown where the user clicked when on a wrapped world.
This commit is contained in:
@@ -71,9 +71,7 @@ map.on('click', function(evt) {
|
||||
return feature;
|
||||
});
|
||||
if (feature) {
|
||||
var geometry = feature.getGeometry();
|
||||
var coord = geometry.getCoordinates();
|
||||
popup.setPosition(coord);
|
||||
popup.setPosition(evt.coordinate);
|
||||
$(element).popover({
|
||||
'placement': 'top',
|
||||
'html': true,
|
||||
|
||||
Reference in New Issue
Block a user