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:
1 parent
d4d3555a88
commit
da3d8952da
2 files changed
+1
-6
No files matched your search
@@ -1,6 +1,3 @@
|
||||
#map {
|
||||
position: relative;
|
||||
}
|
||||
#popup {
|
||||
padding-bottom: 45px;
|
||||
}
|
||||
+1
-3
@@ -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