Merge pull request #3945 from ahocevar/popup-on-icon
Simplify icon example and show popup at clicked position
This commit is contained in:
@@ -1,6 +1,3 @@
|
|||||||
#map {
|
#map {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
#popup {
|
|
||||||
padding-bottom: 45px;
|
|
||||||
}
|
|
||||||
+1
-3
@@ -71,9 +71,7 @@ map.on('click', function(evt) {
|
|||||||
return feature;
|
return feature;
|
||||||
});
|
});
|
||||||
if (feature) {
|
if (feature) {
|
||||||
var geometry = feature.getGeometry();
|
popup.setPosition(evt.coordinate);
|
||||||
var coord = geometry.getCoordinates();
|
|
||||||
popup.setPosition(coord);
|
|
||||||
$(element).popover({
|
$(element).popover({
|
||||||
'placement': 'top',
|
'placement': 'top',
|
||||||
'html': true,
|
'html': true,
|
||||||
|
|||||||
Reference in New Issue
Block a user