Merge pull request #3945 from ahocevar/popup-on-icon

Simplify icon example and show popup at clicked position
This commit is contained in:
Andreas Hocevar
2015-07-31 11:24:58 +02:00
2 changed files with 1 additions and 6 deletions
-3
View File
@@ -1,6 +1,3 @@
#map { #map {
position: relative; position: relative;
} }
#popup {
padding-bottom: 45px;
}
+1 -3
View File
@@ -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,