diff --git a/src/views/feature/Feature_detail.vue b/src/views/feature/Feature_detail.vue index c1a5260d995a927fe087fbad2379afa4a0fb723d..5cdbeaacb831e7cf17fe59460daebe4ec721ce84 100644 --- a/src/views/feature/Feature_detail.vue +++ b/src/views/feature/Feature_detail.vue @@ -599,7 +599,7 @@ export default { if (feature) { const currentFeature = [feature]; const featureGroup = mapUtil.addFeatures(currentFeature); - mapUtil.getMap().fitBounds(featureGroup.getBounds()); + mapUtil.getMap().fitBounds(featureGroup.getBounds(), { padding: [25, 25] }); } }) .catch((error) => { diff --git a/src/views/feature/Feature_edit.vue b/src/views/feature/Feature_edit.vue index bf455ac417517635948694ad077698dda856b37a..65eb44840e24b0c3c507f70d9085caa684b52e76 100644 --- a/src/views/feature/Feature_edit.vue +++ b/src/views/feature/Feature_edit.vue @@ -838,7 +838,7 @@ export default { } else if (geomType === "polygon") { L.polygon(geomJSON.coordinates).addTo(this.drawnItems); } - this.map.fitBounds(this.drawnItems.getBounds()); + this.map.fitBounds(this.drawnItems.getBounds(), { padding: [25, 25] }); } else { this.map.setView( this.$store.state.configuration.DEFAULT_MAP_VIEW.center, diff --git a/src/views/feature/Feature_list.vue b/src/views/feature/Feature_list.vue index 875f26881acfdaa661b329806197baa587022db8..32a31531158d2232ae46a9301bca0bc8fb0531f4 100644 --- a/src/views/feature/Feature_list.vue +++ b/src/views/feature/Feature_list.vue @@ -603,7 +603,9 @@ export default { this.featureGroup.clearLayers(); this.featureGroup = mapUtil.addFeatures(features, {}); if (features.length > 0) { - mapUtil.getMap().fitBounds(this.featureGroup.getBounds()); + mapUtil + .getMap() + .fitBounds(this.featureGroup.getBounds(), { padding: [25, 25] }); } }, @@ -639,7 +641,9 @@ export default { (this.lat === "" || this.lng === "" || this.zoom === "") && this.geojsonFeatures.length > 0 ) { - mapUtil.getMap().fitBounds(this.featureGroup.getBounds()); + mapUtil + .getMap() + .fitBounds(this.featureGroup.getBounds(), { padding: [25, 25] }); } this.form.type.choices = [ //* converting Set to an Array with spread "..." @@ -666,6 +670,8 @@ export default { var mapDefaultViewZoom = this.$store.state.configuration.DEFAULT_MAP_VIEW.zoom; + console.log("MAP : ", document.getElementById("map")); + this.map = mapUtil.createMap({ zoom: this.zoom, lat: this.lat, diff --git a/src/views/project/Project_detail.vue b/src/views/project/Project_detail.vue index ddff358b08a2ed0bdacf60f88b1f951ce7f11252..b7fbff0231327a8f1606f9182f26e87add209dc2 100644 --- a/src/views/project/Project_detail.vue +++ b/src/views/project/Project_detail.vue @@ -589,7 +589,9 @@ export default { const features = response.data.features; const featureGroup = mapUtil.addFeatures(features); if (featureGroup && featureGroup.getLayers().length > 0) { - mapUtil.getMap().fitBounds(featureGroup.getBounds()); + mapUtil + .getMap() + .fitBounds(featureGroup.getBounds(), { padding: [25, 25] }); self.$store.commit("map/SET_GEOJSON_FEATURES", features); } })