@lugg/maps 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -769,7 +769,11 @@ class GoogleMapProvider(private val context: Context) :
769
769
 
770
770
  private fun processPendingMarkers() {
771
771
  if (googleMap == null) return
772
- pendingMarkerViews.forEach { addMarkerViewToMap(it) }
772
+ pendingMarkerViews.forEach {
773
+ // markerViewDidLayout adds it once the bitmap can be drawn
774
+ if (it.hasCustomView && !it.didLayout) return@forEach
775
+ addMarkerViewToMap(it)
776
+ }
773
777
  pendingMarkerViews.clear()
774
778
  }
775
779
 
@@ -103,6 +103,7 @@ using namespace luggmaps::events;
103
103
  [_iconView insertSubview:childComponentView atIndex:index];
104
104
  }
105
105
  _didLayout = NO;
106
+ [self setNeedsLayout];
106
107
  }
107
108
 
108
109
  - (void)unmountChildComponentView:
@@ -114,6 +115,7 @@ using namespace luggmaps::events;
114
115
  [childComponentView removeFromSuperview];
115
116
  }
116
117
  _didLayout = NO;
118
+ [self setNeedsLayout];
117
119
  }
118
120
 
119
121
  - (void)layoutSubviews {
@@ -185,7 +185,19 @@ static MKMapRect LuggStaticFittedMapRect(CLLocationCoordinate2D center,
185
185
  _poiEnabled, _poiFilterMode, _poiFilterCategories);
186
186
  mapView.overrideUserInterfaceStyle =
187
187
  [self snapshotTraitCollection].userInterfaceStyle;
188
- [mapView setVisibleMapRect:self.mapRect
188
+ // MKMapView fits the rect into the layout-margin viewport, and mapRect
189
+ // is already inset-shifted for the whole view: pass its viewport slice so
190
+ // the fit puts mapRect over the full view, matching the overlay projection
191
+ MKMapRect mapRect = self.mapRect;
192
+ CGSize size = self.projectedSize;
193
+ UIEdgeInsets insets = self.edgeInsets;
194
+ double scale = mapRect.size.width / size.width;
195
+ MKMapRect viewportRect =
196
+ MKMapRectMake(mapRect.origin.x + insets.left * scale,
197
+ mapRect.origin.y + insets.top * scale,
198
+ (size.width - insets.left - insets.right) * scale,
199
+ (size.height - insets.top - insets.bottom) * scale);
200
+ [mapView setVisibleMapRect:viewportRect
189
201
  edgePadding:UIEdgeInsetsZero
190
202
  animated:NO];
191
203
  _warmupMapView = mapView;
@@ -667,6 +667,11 @@ LuggInterfaceStyleFromTheme(facebook::react::LuggMapViewTheme theme) {
667
667
  if (!_mapView)
668
668
  return;
669
669
 
670
+ // Custom icons rasterize from layout; adding before that shows the SDK's
671
+ // default pin until markerViewDidLayout re-syncs.
672
+ if (markerView.hasCustomView && !markerView.didLayout)
673
+ return;
674
+
670
675
  GMSAdvancedMarker *marker = [[GMSAdvancedMarker alloc] init];
671
676
  marker.position = markerView.coordinate;
672
677
  marker.title = markerView.title.length > 0 ? markerView.title : nil;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lugg/maps",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Universal maps for React Native.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -78,9 +78,9 @@
78
78
  "@eslint/eslintrc": "^3.3.1",
79
79
  "@eslint/js": "^9.35.0",
80
80
  "@expo/config-plugins": "^56.0.8",
81
- "@react-native/babel-preset": "0.85.3",
82
- "@react-native/eslint-config": "0.85.3",
83
- "@react-native/jest-preset": "0.85.3",
81
+ "@react-native/babel-preset": "0.86.3",
82
+ "@react-native/eslint-config": "0.86.3",
83
+ "@react-native/jest-preset": "0.86.3",
84
84
  "@release-it/conventional-changelog": "^10.0.1",
85
85
  "@types/jest": "^29.5.14",
86
86
  "@types/react": "^19.2.0",
@@ -94,14 +94,14 @@
94
94
  "lefthook": "^2.0.3",
95
95
  "prettier": "^2.8.8",
96
96
  "react": "19.2.3",
97
- "react-native": "0.85.3",
97
+ "react-native": "0.86.3",
98
98
  "react-native-builder-bob": "^0.40.13",
99
99
  "release-it": "^19.0.4",
100
100
  "turbo": "^2.5.6",
101
101
  "typescript": "^5.9.2"
102
102
  },
103
103
  "resolutions": {
104
- "@lodev09/react-native-true-sheet": "3.11.0-beta.10"
104
+ "@lodev09/react-native-true-sheet": "4.0.0-beta.20"
105
105
  },
106
106
  "peerDependencies": {
107
107
  "@vis.gl/react-google-maps": ">=1.0.0",