richardfogaca commented on code in PR #38374:
URL: https://github.com/apache/superset/pull/38374#discussion_r2897923435


##########
superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.tsx:
##########
@@ -100,6 +103,12 @@ class MapBox extends Component<MapBoxProps, MapBoxState> {
       ({ latitude, longitude, zoom } = mercator);
     }
 
+    // Override with explicit viewport props when provided (e.g., saved chart 
controls)

Review Comment:
   This looks like it may change the default behavior for MapBox charts, not 
just make saved viewport controls functional.
   
   These viewport controls already have defaults in controlPanel, and Explore 
populates missing form_data keys from control defaults before transformProps 
runs. With that in place, this override will win over fitBounds even when the 
user never explicitly saved a viewport, so charts may open on the hard-coded 
default viewport instead of fitting to their data.
   
   Was the intent to change the default UX for all MapBox charts? If not, we 
probably need to distinguish between "user explicitly set a viewport" and 
"formData only contains control defaults".



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to