-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FixedPopup: Allows fixing the popup on coordinates #1098
Conversation
The FixedPopup class is a subclass of the Popup class that inherits from Ovelays. It override the |
I've pushed a commit that just call the root class method (super) when the fixed property is set to false: |
With the fixed set to false now, the popup goes back to the camera icon's position on the map and cannot be moved elsewhere. My intended behaviour was to keep it fixed on the map position it is moved to, hence addition of Would it be possible to have the popup retain the new position it is on without modifying the root methods? I attempted to use the Popup class as well but FixedPopup was more fitting as I needed the popup to be movable, but static on different coordinates. Thanks! |
OK I see |
I finally get your code but rename the method 'hook' to be more readable. |
Nice, thank you! Added minor fixes to the options so when they change both open popups are updated. Currently if you have two popup's open (with shift+click) and change the options they are only applied to the first popup. |
Purpose
Allow FixedPopup class to be fixed on map coordinates. Similar to a popup, while retaining the functionality to be moved around on the map. This is an enhancement to the fixed popup.
How
A new parameter "fixedPosition" is passed when creating the popup, if set to true it saves the coordinates of the popup and updates pixel position of the popup accordingly when the map is moved so the popup stays on the saved coordinates.
Also addresses the minor point of options on the example html page not applying to the second popup. (see lines 138 & 141 @
fixedpopup.html
)