소스 검색

add padding on leaflet map 'fitBounds' execution

Olivier Massot 4 년 전
부모
커밋
4f92b3585f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      components/Ui/Map/Structures.vue

+ 1 - 1
components/Ui/Map/Structures.vue

@@ -140,7 +140,7 @@ export default Vue.extend({
       this.map.addLayer(clusters)
     },
     setMapBounds (bounds: L.LatLngBoundsExpression): void {
-      this.map.fitBounds(bounds) // << without this, the new bounds may not be properly set when the current view overlaps the new bounds.
+      this.map.fitBounds(bounds, { padding: [100, 60] }) // << without this, the new bounds may not be properly set when the current view overlaps the new bounds.
     },
     resetBounds (): void {
       this.setMapBounds(this.defaultBounds)