Reputation: 39
In this example how to fix popup position when I zoom ?
Upvotes: 0
Views: 1702
Reputation: 3142
The popup (an ol.Overlay
) is already fixed to a given coordinate, the one you click. When zoomed, the visual distance between the popup and the marker changes but they are still at their given coordinates.
If you don't want two objects to move apart when zoomed in, make sure that they are positioned on the same coordinates.
You can set the clicked features coordinates as the overlay coordinates, and still show it X number of pixels above the point by using the offset
option on the overlay.
Upvotes: 1