Forum Discussion

Malick's avatar
Malick
Regular Visitor
1 year ago

Mapbox visual with multiple countries does not zoom in to the selected country

Hello,

I am struggling with my mapbox visual zoom in. I have the mapbox tile with 20 countries (each country at a sub-national level), where I show level of severity on a scale of 1 to 5. When I select the country from a Power BI slicer, the mapbox visual does not zoom in to the selected country? I have the field called 'comp_key' in the LOCATION field and also listed it as "Vector Propoerty Levle 1" in the choroplet setting part of the mapbox visual. This field actually contains the unique codes of each sub-national locations.

 When I manually zoom in , the visual does show the choropleth map at sub-national level. What could be the issue here, I will really appreciate if anyone can help provide guidance on resolving this problem, I will really be grateful. Thanks. 

7 Replies

  • Hi Malick - Your issue with the Mapbox visual in Power BI not zooming in automatically to the selected country is likely related to the configuration of the "comp_key" field and its interaction with Mapbox’s dynamic zoom functionality.

    In the Power BI Mapbox visual, make sure that “Auto-Zoom” is enabled in the visualization settings if this option is available. This setting ensures that the map zooms into the area relevant to the filter selection.

    If you don’t see an “Auto-Zoom” option, check if Mapbox updates have introduced any specific instructions on how to use location-based zoom with Power BI.

    Mapbox doesn’t automatically recognize filters from Power BI to trigger zooming. You can try using a Power Automate integration to explicitly control the map view, but that requires custom scripting.

    Mapbox provides documentation on using custom tilesets and Power BI integration

    below link FYR:

    Tilesets | Mapbox Docs | Mapbox

    If these steps don’t resolve the issue, there may be a limitation in the Power BI integration with Mapbox, and you could consider reaching out to Power BI or Mapbox support for further assistance.

     

    Hope this information helps.

     

     

    • Malick's avatar
      Malick
      Regular Visitor

      Thanks for replying rajendraongole1 . The auto zoom is enabled. I have tried importing a new tileset with just the country boundaries to see if the issue was with the 'comp_key' which is a unique identifier for each location in the tileset, but unfortunately, the zoom in does not work with country boundary as well. I wonder if there is any solution to this problem or should I be using another approach / visual type to show data at sub-national level. 

      • rajendraongole1's avatar
        rajendraongole1
        Icon for Super User rankSuper User

        Hi Malick - Since auto-zoom and using the comp_key as a unique identifier for each sub-national location haven't resolved the issue, it might indeed be worth exploring alternative visuals or approaches.

        alternatives like ArcGIS Maps for Power BI and Drill Down Map visuals are likely the most straightforward alternatives if automatic zooming with slicers is essential for you. These alternatives often provide better zooming and filtering at sub-national levels without extensive setup. Let me know if you'd like detailed guidance on any of these specific approaches!

         

        Feel free to mark the right answer as solution and I wouldn't mind kudos. thank you

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Malick ,

     

    Thanks for the reply from rajendraongole1. I noticed that rajendraongole1 has already provided some excellent suggestions and alternative solutions.Thank you for your attention to this issue.

    If there is an answer that helped you, please accept it as a solution. This will be of great help to other users who have similar problems as you.

    If you have any questions please feel free to let us know.

     

    Best Regards,

    Bof

    • Malick's avatar
      Malick
      Regular Visitor

      Hi Anonymous , thank you for the message. I was looking for a solution for the Mapbox zoom in issue. Unfortunately that issue is still there.