Skip to content

Commit f19df7f

Browse files
fix: map not centered after zoom (#652)
2 parents 380148a + 2129ed4 commit f19df7f

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

packages/pluggableWidgets/maps-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We fixed an issue where the marker was not at the center of the map after you zoom in to the marker. Now after you zoom in to a marker, the map will be centered around the marker.
12+
913
## [3.2.0] - 2023-06-05
1014

1115
### Changed

packages/pluggableWidgets/maps-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/maps-web",
33
"widgetName": "Maps",
4-
"version": "3.2.0",
4+
"version": "3.2.1",
55
"description": "Show locations on Maps",
66
"copyright": "© Mendix Technology BV 2023. All rights reserved.",
77
"license": "Apache-2.0",

packages/pluggableWidgets/maps-web/src/components/LeafletMap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function SetBoundsComponent(props: Pick<LeafletProps, "autoZoom" | "currentLocat
4242

4343
if (bounds.isValid()) {
4444
if (autoZoom) {
45-
map.fitBounds(bounds, { padding: [0.5, 0.5] }).invalidateSize();
45+
map.flyToBounds(bounds, { padding: [0.5, 0.5], animate: false }).invalidateSize();
4646
} else {
4747
map.panTo(bounds.getCenter(), { animate: false });
4848
}

packages/pluggableWidgets/maps-web/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="Maps" version="3.2.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="Maps" version="3.2.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="Maps.xml" />
66
</widgetFiles>

0 commit comments

Comments
 (0)