Skip to content
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

pydeck 0.8.0: viewport does not return bounds #9226

Open
1 of 7 tasks
prusswan opened this issue Oct 25, 2024 · 0 comments
Open
1 of 7 tasks

pydeck 0.8.0: viewport does not return bounds #9226

prusswan opened this issue Oct 25, 2024 · 0 comments
Labels

Comments

@prusswan
Copy link

Description

I tried to follow the event handling example using pydeck 0.8.0. The example references 'nw' and 'se' attributes that are no longer present in the payload, so how should we figure out the current bounds of the map view?

Attributes in payload:

© [CARTO](https://carto.com/about-carto/), © [OpenStreetMap](http://www.openstreetmap.org/about/) contributors

last_payload['data']['viewport']

{'_frustumPlanes': {},
'id': 'MapView',
'x': 0,
'y': 0,
'width': 784,
'height': 500,
'zoom': 14.078189967439624,
'distanceScales': {'unitsPerMeter': [1.2793877345341609e-05,
1.2793877345341609e-05,
1.2793877345341609e-05],
'metersPerUnit': [78162.38760207522, 78162.38760207522, 78162.38760207522],
'unitsPerDegree': [1.4222222222222223,
1.4226080837056239,
1.2793877345341609e-05],
'degreesPerUnit': [0.703125, 0.7029342877028998, 78162.38760207522]},
'focalDistance': 1.5,
'position': [0, 0, 0],
'modelMatrix': None,
'isGeospatial': True,
'scale': 17296.46947929418,
'center': [403.75017433281226, 257.8981356964472, 0],
'viewMatrixUncentered': [34.59293895858836,
0,
0,
0,
0,
34.59293895858836,
0,
0,
0,
0,
34.59293895858836,
0,
0,
0,
-1.5,
1],
'viewMatrix': [34.59293895858836,
0,
0,
0,
0,
34.59293895858836,
0,
0,
0,
0,
34.59293895858836,
0,
-13966.905135214385,
-8921.454465680936,
-1.5,
1],
'projectionMatrix': [1.913265306122449,
0,
0,
0,
0,
3,
0,
0,
0,
0,
-1.1413427561837457,
-1,
0,
0,
-0.2141342756183746,
0],
'viewProjectionMatrix': [66.18546994627876,
0,
0,
0,
0,
103.77881687576509,
0,
0,
0,
0,
-39.48240029549132,
-34.59293895858836,
-26722.395029109153,
-26764.363397042805,
1.497879858657244,
1.5],
'viewMatrixInverse': [0.028907633468122276,
0,
0,
0,
0,
0.028907633468122276,
0,
0,
0,
0,
0.028907633468122276,
0,
403.7501743328122,
257.8981356964472,
0.04336145020218341,
1],
'cameraPosition': [403.7501743328122, 257.8981356964472, 0.04336145020218341],
'pixelProjectionMatrix': [25944.70421894127,
0,
0,
0,
0,
-25944.70421894127,
0,
0,
-13560.432071766638,
-8648.23473964709,
-39.48240029549132,
-34.59293895858836,
-10474590.851410788,
6691465.849260702,
1.497879858657244,
1.5],
'pixelUnprojectionMatrix': [3.85435112908297e-05,
0,
0,
0,
0,
-3.85435112908297e-05,
0,
0,
-1885.4999890459694,
-1204.37578221278,
-0.20249654137323259,
-4.669966996699665,
2151.986645225723,
1374.6152106295117,
0.2022103271804789,
5.330033003300325],
'latitude': 1.3345059847136809,
'longitude': 103.8868413277586,
'pitch': 0,
'bearing': 0,
'altitude': 1.5,
'fovy': 36.86989764584402,
'orthographic': False,
'_subViewports': None,
'_pseudoMeters': False}

It seems that the projection related functions in deck.gl (https://github.com/visgl/deck.gl/blob/c7f1a66e47062eee85ce30cfe1216d6fb8287aae/modules/core/src/viewports/viewport.ts) have yet to be ported to pydeck?

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CartoLayer
  • ArcGIS

Expected Behavior

No response

Steps to Reproduce

refer to description

Environment

pydeck 0.8.0

Logs

No response

@prusswan prusswan added the bug label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant