mapbox / mapboxgl-powerbi

Mapbox Visual for Power BI - High performance, custom map visuals for Power BI dashboards. This version of Mapbox Visual for Microsoft Power BI is no longer maintained. You can find the live and maintained version of the plugin at: https://github.com/starschema/mapboxgl-powerbi.
MIT License
127 stars 52 forks source link

Overzooming on chloropleth #344

Closed stephshadwell closed 1 year ago

stephshadwell commented 5 years ago

when i don't have a filter selected, the chloropleth map seems to zoom in on the top right hand area of the map. See screen shot below.

image

However, if i filter, this then filters on the area correctly

image

And then once you unselect, and have no filters selected, it seems to zoom out as expected

image

Therefore the over zoom issue, seems to be isolated to solely when the visualisation first loads

otravers commented 5 years ago

@stephshadwell looks like you're using a custom shapefile correct? If yes, is it displaying when you're furthest zoomed out? This might be your issue: https://github.com/mapbox/mapboxgl-powerbi/issues/331

stephshadwell commented 5 years ago

Thanks @otravers , but i don't believe this is the issue as it doesn't default to zooming out on the whole shapefile, but a small upper right section of it. Once you have selected a filter, the auto zoom works correctly, and then when you clear your filter it zooms out to include the whole area (which works), which is what i would expect it to do on the original load.

The original version is currently published to the web (we are currently updating the underlying dataset), which now also seems to be exhibiting this behaviour. Link below: (page 14 National catchment map) https://app.powerbi.com/view?r=eyJrIjoiYjBiMWY3YzEtM2RhNS00N2M1LWJkZTItM2E1M2MxNzk3MDZjIiwidCI6ImVlNGUxNDk5LTRhMzUtNGIyZS1hZDQ3LTVmM2NmOWRlODY2NiIsImMiOjh9

otravers commented 5 years ago

@stephshadwell you're right, seems it's a different behavior, though still in the same general idea of unexpected interactions between filter context and zoom level.

Do you have values hard-coded for Zoom/Longitude/Latitude in Viz Settings by any chance, rather than auto-zoom? If yes, that would explain it. If not, you might try playing around with that as a way to get the intended zoom level and centering on the original load.

image