Skip to content

Commit

Permalink
fix: force map resize on container size change
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Mar 14, 2023
1 parent c90ff4a commit 6da6f23
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/Map/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div :class="(hideControl || !map) && 'map-controls-hidden'">
<mapbox
v-if="style"
id="map"
access-token=""
:map-options="{
bounds: bounds,
Expand Down Expand Up @@ -204,6 +205,10 @@ export default Vue.extend({
}
this.emitStyleLoad()
new ResizeObserver((entries) => {
this.map?.resize()
}).observe(document.getElementById('map')!)
},
setStyle(mapStyle: MapStyleEnum) {
Expand Down

0 comments on commit 6da6f23

Please sign in to comment.