-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add pixel_bounds to Map #616
Add pixel_bounds to Map #616
Conversation
Is it the size in pixels of the map? |
No, its bounds in pixels. |
In screen pixels? Is it the size of the map? |
Yes, screen pixels. You can get the size of the map from it. |
But that does not work when having multiple views with different sizes |
As for the bounds, we take the biggest view. |
I see :) ok |
@@ -1032,6 +1032,11 @@ def _default_options(self): | |||
east = Float(def_loc[1], read_only=True).tag(sync=True) | |||
west = Float(def_loc[1], read_only=True).tag(sync=True) | |||
|
|||
bottom = Int(0, read_only=True).tag(sync=True) | |||
top = Int(9007199254740991, read_only=True).tag(sync=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the biggest Number
. We need this initial value in order to play well with the min
.
Similar to the
bounds
read-only attribute, but in projected pixel coordinates instead of lat/lon coordinates (see https://leafletjs.com/reference-1.0.3.html#map-getpixelbounds).While
bounds
is((south, west), (north, east))
,pixel_bounds
is((left, top), (right, bottom))
to respect the Leaflet convention.