Skip to content

Commit

Permalink
Fix bug in map extent visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jan 5, 2025
1 parent b67495d commit 45cd37c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/components/maps/MapExtentViewer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :id="id">
<div :id="id" class="map-extent">
<ProgressControl ref="progress" :map="map" />
</div>
</template>
Expand All @@ -20,6 +20,15 @@ export default {
// geometry: GeoJSON Object (WGS84)
type: [Array, Object],
default: () => null
},
fill: {
type: Boolean,
default: true
}
},
watch: {
footprint() {
this.renderMap();
}
},
methods: {
Expand Down Expand Up @@ -53,7 +62,7 @@ export default {
await this.createMap(isWebMercatorCompatible ? "EPSG:3857" : "EPSG:4326");
this.addBasemaps();
this.addExtent(value);
this.addExtent(value, this.fill);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/maps/MapMixin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default {
// Make a bigger extent visible so that user can get a better overview
var size = this.map.getSize();
if (size && paddingPc > 0) {
fitOptions.padding = [size[0]*paddingPc/100, size[1]*paddingPc/100, size[0]*paddingPc/100, size[1]*paddingPc/100];
fitOptions.padding = [size[1]*paddingPc/100, size[0]*paddingPc/100, size[1]*paddingPc/100, size[0]*paddingPc/100];
}
else {
fitOptions.padding = [30,30,30,30];
Expand Down

0 comments on commit 45cd37c

Please sign in to comment.