mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix non-native geometries not visible in map layout (#10308)
* Fix non-native geometries not showing up in map layout * Don't add bbox to edited and parsed geometries
This commit is contained in:
@@ -257,7 +257,7 @@ export default defineComponent({
|
||||
...(mapboxKey ? { accessToken: mapboxKey } : {}),
|
||||
});
|
||||
if (controls.geocoder) {
|
||||
map.addControl(controls.geocoder, 'top-right');
|
||||
map.addControl(controls.geocoder as any, 'top-right');
|
||||
controls.geocoder.on('result', (event: any) => {
|
||||
location.value = event.result.center;
|
||||
});
|
||||
@@ -336,7 +336,8 @@ export default defineComponent({
|
||||
|
||||
function fitDataBounds(options: CameraOptions & AnimationOptions) {
|
||||
if (map && currentGeometry) {
|
||||
map.fitBounds(currentGeometry.bbox! as LngLatBoundsLike, {
|
||||
const bbox = getBBox(currentGeometry);
|
||||
map.fitBounds(bbox as LngLatBoundsLike, {
|
||||
padding: 80,
|
||||
maxZoom: 8,
|
||||
...options,
|
||||
@@ -432,7 +433,6 @@ export default defineComponent({
|
||||
} else {
|
||||
result = geometries[geometries.length - 1];
|
||||
}
|
||||
result!.bbox = getBBox(result!);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user