@lugg/maps 0.2.0-alpha.16 → 0.2.0-alpha.18

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.
@@ -146,10 +146,7 @@ class LuggGoogleMapView(private val reactContext: ThemedReactContext) :
146
146
  view.onCreate(null)
147
147
  view.onResume()
148
148
  view.getMapAsync(this)
149
- mapWrapperView?.addView(
150
- view,
151
- LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
152
- )
149
+ mapWrapperView?.addView(view)
153
150
  }
154
151
  }
155
152
 
@@ -241,9 +238,7 @@ class LuggGoogleMapView(private val reactContext: ThemedReactContext) :
241
238
  }
242
239
 
243
240
  if (markerView.hasCustomView) {
244
- // Recreate marker with custom view
245
- markerView.marker?.remove()
246
- addMarkerViewToMap(markerView)
241
+ markerView.updateIcon { addMarkerViewToMap(markerView) }
247
242
  } else {
248
243
  syncMarkerView(markerView)
249
244
  }
@@ -276,9 +271,6 @@ class LuggGoogleMapView(private val reactContext: ThemedReactContext) :
276
271
  snippet = markerView.description
277
272
  setAnchor(markerView.anchorX, markerView.anchorY)
278
273
  zIndex = markerView.zIndex
279
- if (!markerView.hasCustomView) {
280
- iconView = null
281
- }
282
274
  }
283
275
  }
284
276
 
@@ -291,29 +283,23 @@ class LuggGoogleMapView(private val reactContext: ThemedReactContext) :
291
283
 
292
284
  private fun addMarkerViewToMap(markerView: LuggMarkerView) {
293
285
  val map = googleMap ?: run {
294
- RNLog.w(reactContext, "Lugg: addMarkerViewToMap called without a map")
286
+ RNLog.w(reactContext, "LuggMaps: addMarkerViewToMap called without a map")
295
287
  return
296
288
  }
297
289
 
298
290
  val position = LatLng(markerView.latitude, markerView.longitude)
299
- val iconView = markerView.iconView
300
-
301
- (iconView.parent as? ViewGroup)?.removeView(iconView)
302
291
 
303
292
  val options = AdvancedMarkerOptions()
304
293
  .position(position)
305
294
  .title(markerView.title)
306
295
  .snippet(markerView.description)
307
296
 
308
- if (markerView.hasCustomView) {
309
- options.iconView(iconView)
310
- }
311
-
312
297
  val marker = map.addMarker(options) as AdvancedMarker
313
298
  marker.setAnchor(markerView.anchorX, markerView.anchorY)
314
299
  marker.zIndex = markerView.zIndex
315
300
 
316
301
  markerView.marker = marker
302
+ markerView.applyIconToMarker()
317
303
  }
318
304
 
319
305
  // endregion
@@ -380,7 +366,7 @@ class LuggGoogleMapView(private val reactContext: ThemedReactContext) :
380
366
  if (value.isNullOrEmpty()) return
381
367
 
382
368
  if (mapView != null) {
383
- RNLog.w(reactContext, "Lugg: mapId cannot be changed after map is initialized")
369
+ RNLog.w(reactContext, "LuggMaps: mapId cannot be changed after map is initialized")
384
370
  return
385
371
  }
386
372
 
@@ -450,7 +436,8 @@ class LuggGoogleMapView(private val reactContext: ThemedReactContext) :
450
436
  fun moveCamera(latitude: Double, longitude: Double, zoom: Double, duration: Int) {
451
437
  val map = googleMap ?: return
452
438
  val position = LatLng(latitude, longitude)
453
- val cameraUpdate = CameraUpdateFactory.newLatLngZoom(position, zoom.toFloat())
439
+ val targetZoom = if (zoom > 0) zoom.toFloat() else map.cameraPosition.zoom
440
+ val cameraUpdate = CameraUpdateFactory.newLatLngZoom(position, targetZoom)
454
441
  when {
455
442
  duration < 0 -> map.animateCamera(cameraUpdate)
456
443
  duration > 0 -> map.animateCamera(cameraUpdate, duration, null)
@@ -17,23 +17,4 @@ class LuggMapWrapperView(context: ThemedReactContext) : ReactViewGroup(context)
17
17
  it.layout(0, 0, width, height)
18
18
  }
19
19
  }
20
-
21
- override fun onLayout(
22
- changed: Boolean,
23
- left: Int,
24
- top: Int,
25
- right: Int,
26
- bottom: Int
27
- ) {
28
- super.onLayout(changed, left, top, right, bottom)
29
- val w = right - left
30
- val h = bottom - top
31
- getChildAt(0)?.let {
32
- it.measure(
33
- MeasureSpec.makeMeasureSpec(w, MeasureSpec.EXACTLY),
34
- MeasureSpec.makeMeasureSpec(h, MeasureSpec.EXACTLY)
35
- )
36
- it.layout(0, 0, w, h)
37
- }
38
- }
39
20
  }
@@ -1,10 +1,16 @@
1
1
  package com.luggmaps
2
2
 
3
3
  import android.content.Context
4
+ import android.graphics.Bitmap
5
+ import android.graphics.Canvas
4
6
  import android.view.View
7
+ import android.view.ViewGroup
8
+ import androidx.core.graphics.createBitmap
5
9
  import androidx.core.view.isNotEmpty
6
10
  import com.facebook.react.views.view.ReactViewGroup
7
11
  import com.google.android.gms.maps.model.AdvancedMarker
12
+ import com.google.android.gms.maps.model.BitmapDescriptor
13
+ import com.google.android.gms.maps.model.BitmapDescriptorFactory
8
14
 
9
15
  interface LuggMarkerViewDelegate {
10
16
  fun markerViewDidUpdate(markerView: LuggMarkerView)
@@ -36,23 +42,91 @@ class LuggMarkerView(context: Context) : ReactViewGroup(context) {
36
42
  var zIndex: Float = 0f
37
43
  private set
38
44
 
45
+ var rasterize: Boolean = true
46
+ private set
47
+
39
48
  var didLayout: Boolean = false
40
49
  private set
41
50
 
51
+ var isPendingUpdate: Boolean = false
52
+
42
53
  val hasCustomView: Boolean
43
54
  get() = iconView.isNotEmpty()
44
55
 
45
- val iconView: ReactViewGroup = object : ReactViewGroup(context) {
46
- override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
47
- var maxWidth = 0
48
- var maxHeight = 0
49
- for (i in 0 until childCount) {
50
- val child = getChildAt(i)
51
- if (child.width > maxWidth) maxWidth = child.width
52
- if (child.height > maxHeight) maxHeight = child.height
56
+ val iconView: ReactViewGroup = ReactViewGroup(context)
57
+
58
+ private fun measureIconViewBounds(): Pair<Int, Int> {
59
+ var maxWidth = 0
60
+ var maxHeight = 0
61
+ for (i in 0 until iconView.childCount) {
62
+ val child = iconView.getChildAt(i)
63
+ val childRight = child.left + child.width
64
+ val childBottom = child.top + child.height
65
+ if (childRight > maxWidth) maxWidth = childRight
66
+ if (childBottom > maxHeight) maxHeight = childBottom
67
+ }
68
+ return Pair(maxWidth, maxHeight)
69
+ }
70
+
71
+ private fun createIconBitmap(): BitmapDescriptor? {
72
+ val (width, height) = measureIconViewBounds()
73
+ if (width <= 0 || height <= 0) return null
74
+
75
+ val bitmap = createBitmap(width, height)
76
+ val canvas = Canvas(bitmap)
77
+ iconView.draw(canvas)
78
+ return BitmapDescriptorFactory.fromBitmap(bitmap)
79
+ }
80
+
81
+ private fun createIconViewWrapper(): View {
82
+ val (width, height) = measureIconViewBounds()
83
+
84
+ (iconView.parent as? ViewGroup)?.removeView(iconView)
85
+
86
+ return object : ReactViewGroup(context) {
87
+ init {
88
+ addView(iconView)
53
89
  }
54
90
 
55
- setMeasuredDimension(maxWidth, maxHeight)
91
+ override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
92
+ setMeasuredDimension(width, height)
93
+ }
94
+ }
95
+ }
96
+
97
+ fun applyIconToMarker() {
98
+ val m = marker ?: return
99
+ if (!hasCustomView) return
100
+
101
+ if (rasterize) {
102
+ m.iconView = null
103
+ createIconBitmap()?.let { m.setIcon(it) }
104
+ } else {
105
+ m.iconView = createIconViewWrapper()
106
+ }
107
+ }
108
+
109
+ fun updateIcon(onAddMarker: () -> Unit) {
110
+ if (!hasCustomView) return
111
+ if (isPendingUpdate) return
112
+ isPendingUpdate = true
113
+
114
+ if (rasterize) {
115
+ post {
116
+ isPendingUpdate = false
117
+ if (marker == null) {
118
+ onAddMarker()
119
+ } else {
120
+ applyIconToMarker()
121
+ }
122
+ }
123
+ } else {
124
+ marker?.remove()
125
+ marker = null
126
+ post {
127
+ isPendingUpdate = false
128
+ onAddMarker()
129
+ }
56
130
  }
57
131
  }
58
132
 
@@ -92,6 +166,7 @@ class LuggMarkerView(context: Context) : ReactViewGroup(context) {
92
166
  bottom: Int
93
167
  ) {
94
168
  super.onLayout(changed, left, top, right, bottom)
169
+
95
170
  if (changed && !didLayout) {
96
171
  didLayout = true
97
172
  delegate?.markerViewDidLayout(this)
@@ -120,6 +195,10 @@ class LuggMarkerView(context: Context) : ReactViewGroup(context) {
120
195
  this.zIndex = zIndex
121
196
  }
122
197
 
198
+ fun setRasterize(rasterize: Boolean) {
199
+ this.rasterize = rasterize
200
+ }
201
+
123
202
  fun setName(name: String?) {
124
203
  this.name = name
125
204
  }
@@ -133,8 +212,4 @@ class LuggMarkerView(context: Context) : ReactViewGroup(context) {
133
212
  delegate = null
134
213
  iconView.removeAllViews()
135
214
  }
136
-
137
- companion object {
138
- private const val TAG = "Lugg"
139
- }
140
215
  }
@@ -69,6 +69,11 @@ class LuggMarkerViewManager :
69
69
  view.setZIndex(zIndex)
70
70
  }
71
71
 
72
+ @ReactProp(name = "rasterize", defaultBoolean = true)
73
+ override fun setRasterize(view: LuggMarkerView, value: Boolean) {
74
+ view.setRasterize(value)
75
+ }
76
+
72
77
  companion object {
73
78
  const val NAME = "LuggMarkerView"
74
79
  }
@@ -267,7 +267,13 @@ using namespace luggmaps::events;
267
267
  UIView *iconView = markerView.iconView;
268
268
  CGRect frame = iconView.frame;
269
269
  if (frame.size.width > 0 && frame.size.height > 0) {
270
- annotationView.frame = frame;
270
+ if (markerView.rasterize) {
271
+ annotationView.image = [markerView createIconImage];
272
+ annotationView.frame =
273
+ CGRectMake(0, 0, frame.size.width, frame.size.height);
274
+ } else {
275
+ annotationView.frame = frame;
276
+ }
271
277
 
272
278
  CGPoint anchor = markerView.anchor;
273
279
  annotationView.centerOffset =
@@ -478,15 +484,19 @@ using namespace luggmaps::events;
478
484
  annotationView.zPriority = markerView.zIndex;
479
485
 
480
486
  UIView *iconView = markerView.iconView;
481
- [iconView removeFromSuperview];
482
- [annotationView addSubview:iconView];
483
-
484
- // Set frame and centerOffset based on iconView
485
487
  CGRect frame = iconView.frame;
488
+
489
+ if (markerView.rasterize) {
490
+ annotationView.image = [markerView createIconImage];
491
+ } else {
492
+ [iconView removeFromSuperview];
493
+ [annotationView addSubview:iconView];
494
+ iconView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
495
+ }
496
+
486
497
  if (frame.size.width > 0 && frame.size.height > 0) {
487
498
  annotationView.frame =
488
499
  CGRectMake(0, 0, frame.size.width, frame.size.height);
489
- iconView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
490
500
 
491
501
  CGPoint anchor = markerView.anchor;
492
502
  annotationView.centerOffset =
@@ -537,16 +547,18 @@ using namespace luggmaps::events;
537
547
  return;
538
548
  }
539
549
 
550
+ double targetZoom = zoom > 0 ? zoom : _mapView.zoomLevel;
551
+
540
552
  if (duration < 0) {
541
553
  [self setCameraWithLatitude:latitude
542
554
  longitude:longitude
543
- zoom:zoom
555
+ zoom:targetZoom
544
556
  animated:YES];
545
557
  } else if (duration > 0) {
546
558
  CLLocationCoordinate2D center =
547
559
  CLLocationCoordinate2DMake(latitude, longitude);
548
560
  MKCoordinateRegion region = [_mapView regionForCenterCoordinate:center
549
- zoomLevel:zoom];
561
+ zoomLevel:targetZoom];
550
562
  [UIView animateWithDuration:duration / 1000.0
551
563
  animations:^{
552
564
  [self->_mapView setRegion:region animated:NO];
@@ -554,7 +566,7 @@ using namespace luggmaps::events;
554
566
  } else {
555
567
  [self setCameraWithLatitude:latitude
556
568
  longitude:longitude
557
- zoom:zoom
569
+ zoom:targetZoom
558
570
  animated:NO];
559
571
  }
560
572
  }
@@ -244,12 +244,20 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
244
244
  marker.snippet = markerView.markerDescription;
245
245
  marker.zIndex = (int)markerView.zIndex;
246
246
  if (markerView.hasCustomView) {
247
- UIView *iconView = markerView.iconView;
248
- [iconView removeFromSuperview];
249
- marker.iconView = iconView;
247
+ if (markerView.rasterize) {
248
+ marker.iconView = nil;
249
+ marker.icon = [markerView createIconImage];
250
+ } else {
251
+ UIView *iconView = markerView.iconView;
252
+ if (marker.iconView != iconView) {
253
+ [iconView removeFromSuperview];
254
+ marker.iconView = iconView;
255
+ }
256
+ }
250
257
  marker.groundAnchor = markerView.anchor;
251
258
  } else {
252
259
  marker.iconView = nil;
260
+ marker.icon = nil;
253
261
  marker.groundAnchor = CGPointMake(0.5, 1);
254
262
  }
255
263
  }
@@ -271,16 +279,19 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
271
279
  return;
272
280
  }
273
281
 
274
- UIView *iconView = markerView.iconView;
275
- [iconView removeFromSuperview];
276
-
277
282
  GMSAdvancedMarker *marker = [[GMSAdvancedMarker alloc] init];
278
283
  marker.position = markerView.coordinate;
279
284
  marker.title = markerView.title;
280
285
  marker.snippet = markerView.markerDescription;
281
286
 
282
287
  if (markerView.hasCustomView) {
283
- marker.iconView = iconView;
288
+ if (markerView.rasterize) {
289
+ marker.icon = [markerView createIconImage];
290
+ } else {
291
+ UIView *iconView = markerView.iconView;
292
+ [iconView removeFromSuperview];
293
+ marker.iconView = iconView;
294
+ }
284
295
  marker.groundAnchor = markerView.anchor;
285
296
  }
286
297
 
@@ -396,10 +407,10 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
396
407
  return;
397
408
  }
398
409
 
399
- GMSCameraPosition *camera =
400
- [GMSCameraPosition cameraWithLatitude:latitude
401
- longitude:longitude
402
- zoom:(float)zoom];
410
+ float targetZoom = zoom > 0 ? (float)zoom : _mapView.camera.zoom;
411
+ GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:latitude
412
+ longitude:longitude
413
+ zoom:targetZoom];
403
414
  if (duration < 0) {
404
415
  [_mapView animateToCameraPosition:camera];
405
416
  } else if (duration > 0) {
@@ -20,12 +20,15 @@ NS_ASSUME_NONNULL_BEGIN
20
20
  @property(nonatomic, readonly, nullable) NSString *markerDescription;
21
21
  @property(nonatomic, readonly) CGPoint anchor;
22
22
  @property(nonatomic, readonly) NSInteger zIndex;
23
+ @property(nonatomic, readonly) BOOL rasterize;
23
24
  @property(nonatomic, readonly) BOOL hasCustomView;
24
25
  @property(nonatomic, readonly) BOOL didLayout;
25
26
  @property(nonatomic, readonly) UIView *iconView;
26
27
  @property(nonatomic, weak, nullable) id<LuggMarkerViewDelegate> delegate;
27
28
  @property(nonatomic, strong, nullable) NSObject *marker;
28
29
 
30
+ - (nullable UIImage *)createIconImage;
31
+
29
32
  @end
30
33
 
31
34
  NS_ASSUME_NONNULL_END
@@ -19,6 +19,7 @@ using namespace facebook::react;
19
19
  NSString *_markerDescription;
20
20
  CGPoint _anchor;
21
21
  NSInteger _zIndex;
22
+ BOOL _rasterize;
22
23
  BOOL _didLayout;
23
24
  UIView *_iconView;
24
25
  }
@@ -37,6 +38,7 @@ using namespace facebook::react;
37
38
  _coordinate = CLLocationCoordinate2DMake(0, 0);
38
39
  _anchor = CGPointMake(0.5, 1.0);
39
40
  _zIndex = 0;
41
+ _rasterize = YES;
40
42
  _didLayout = NO;
41
43
 
42
44
  _iconView = [[UIView alloc] init];
@@ -63,6 +65,7 @@ using namespace facebook::react;
63
65
  [NSString stringWithUTF8String:newViewProps.description.c_str()];
64
66
  _anchor = CGPointMake(newViewProps.anchor.x, newViewProps.anchor.y);
65
67
  _zIndex = newViewProps.zIndex.value_or(0);
68
+ _rasterize = newViewProps.rasterize;
66
69
  }
67
70
 
68
71
  - (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask {
@@ -138,6 +141,10 @@ using namespace facebook::react;
138
141
  return _zIndex;
139
142
  }
140
143
 
144
+ - (BOOL)rasterize {
145
+ return _rasterize;
146
+ }
147
+
141
148
  - (BOOL)hasCustomView {
142
149
  return _iconView.subviews.count > 0;
143
150
  }
@@ -150,6 +157,23 @@ using namespace facebook::react;
150
157
  return _iconView;
151
158
  }
152
159
 
160
+ - (UIImage *)createIconImage {
161
+ CGSize size = _iconView.bounds.size;
162
+ if (size.width <= 0 || size.height <= 0) {
163
+ return nil;
164
+ }
165
+
166
+ UIGraphicsImageRendererFormat *format =
167
+ [UIGraphicsImageRendererFormat defaultFormat];
168
+ format.scale = [UIScreen mainScreen].scale;
169
+ UIGraphicsImageRenderer *renderer =
170
+ [[UIGraphicsImageRenderer alloc] initWithSize:size format:format];
171
+
172
+ return [renderer imageWithActions:^(UIGraphicsImageRendererContext *context) {
173
+ [self->_iconView.layer renderInContext:context.CGContext];
174
+ }];
175
+ }
176
+
153
177
  - (void)prepareForRecycle {
154
178
  [super prepareForRecycle];
155
179
  _didLayout = NO;
@@ -25,9 +25,9 @@ export class MapView extends React.Component {
25
25
  const ref = this.nativeRef.current;
26
26
  if (!ref) return;
27
27
  const {
28
- zoom,
28
+ zoom = 0,
29
29
  duration = -1
30
- } = options;
30
+ } = options ?? {};
31
31
  this.nativeCommands.moveCamera(ref, coordinate.latitude, coordinate.longitude, zoom, duration);
32
32
  }
33
33
  fitCoordinates(coordinates, options) {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","StyleSheet","LuggGoogleMapViewNativeComponent","Commands","GoogleMapCommands","LuggAppleMapViewNativeComponent","AppleMapCommands","LuggMapWrapperViewNativeComponent","jsx","_jsx","jsxs","_jsxs","MapView","Component","defaultProps","provider","OS","initialZoom","zoomEnabled","scrollEnabled","rotateEnabled","pitchEnabled","nativeRef","createRef","nativeCommands","props","isApple","moveCamera","coordinate","options","ref","current","zoom","duration","latitude","longitude","fitCoordinates","coordinates","first","padding","top","left","bottom","right","length","render","mapId","initialCoordinate","minZoom","maxZoom","userLocationEnabled","onCameraMove","onCameraIdle","onReady","children","rest","NativeMapView","style","absoluteFill"],"sourceRoot":"../../src","sources":["MapView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,OAAOC,gCAAgC,IACrCC,QAAQ,IAAIC,iBAAiB,QACxB,2CAA2C;AAClD,OAAOC,+BAA+B,IACpCF,QAAQ,IAAIG,gBAAgB,QACvB,0CAA0C;AACjD,OAAOC,iCAAiC,MAAM,4CAA4C;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS3F,OAAO,MAAMC,OAAO,SACVb,KAAK,CAACc,SAAS,CAEzB;EACE,OAAOC,YAAY,GAA0B;IAC3CC,QAAQ,EAAEf,QAAQ,CAACgB,EAAE,KAAK,KAAK,GAAG,OAA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Aa;MAC3BC,YAAY,EAAEA,YAAa;MAC3BC,OAAO,EAAEA,OAAQ;MAAAC,QAAA,gBAEjB7C,IAAA,CAACF,iCAAiC;QAACkD,KAAK,EAAExD,UAAU,CAACyD;MAAa,CAAE,CAAC,EACpEJ,QAAQ;IAAA,CACI,CAAC;EAEpB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Platform","StyleSheet","LuggGoogleMapViewNativeComponent","Commands","GoogleMapCommands","LuggAppleMapViewNativeComponent","AppleMapCommands","LuggMapWrapperViewNativeComponent","jsx","_jsx","jsxs","_jsxs","MapView","Component","defaultProps","provider","OS","initialZoom","zoomEnabled","scrollEnabled","rotateEnabled","pitchEnabled","nativeRef","createRef","nativeCommands","props","isApple","moveCamera","coordinate","options","ref","current","zoom","duration","latitude","longitude","fitCoordinates","coordinates","first","padding","top","left","bottom","right","length","render","mapId","initialCoordinate","minZoom","maxZoom","userLocationEnabled","onCameraMove","onCameraIdle","onReady","children","rest","NativeMapView","style","absoluteFill"],"sourceRoot":"../../src","sources":["MapView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,OAAOC,gCAAgC,IACrCC,QAAQ,IAAIC,iBAAiB,QACxB,2CAA2C;AAClD,OAAOC,+BAA+B,IACpCF,QAAQ,IAAIG,gBAAgB,QACvB,0CAA0C;AACjD,OAAOC,iCAAiC,MAAM,4CAA4C;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS3F,OAAO,MAAMC,OAAO,SACVb,KAAK,CAACc,SAAS,CAEzB;EACE,OAAOC,YAAY,GAA0B;IAC3CC,QAAQ,EAAEf,QAAQ,CAACgB,EAAE,KAAK,KAAK,GAAG,OAAO,GAAG,QAAQ;IACpDC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE,IAAI;IACjBC,aAAa,EAAE,IAAI;IACnBC,aAAa,EAAE,IAAI;I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AA,CAACF,iCAAiC;QAACkD,KAAK,EAAExD,UAAU,CAACyD;MAAa,CAAE,CAAC,EACpEJ,QAAQ;IAAA,CACI,CAAC;EAEpB;AACF","ignoreList":[]}
@@ -13,6 +13,7 @@ export class Marker extends React.Component {
13
13
  description,
14
14
  anchor,
15
15
  zIndex,
16
+ rasterize = true,
16
17
  children
17
18
  } = this.props;
18
19
  return /*#__PURE__*/_jsx(LuggMarkerViewNativeComponent, {
@@ -24,6 +25,7 @@ export class Marker extends React.Component {
24
25
  title: title,
25
26
  description: description,
26
27
  anchor: anchor,
28
+ rasterize: rasterize,
27
29
  children: children
28
30
  });
29
31
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","StyleSheet","LuggMarkerViewNativeComponent","jsx","_jsx","Marker","Component","render","name","coordinate","title","description","anchor","zIndex","children","props","style","styles","marker","create","position","pointerEvents"],"sourceRoot":"../../../src","sources":["components/Marker.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,6BAA6B,MAAM,yCAAyC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAkCpF,OAAO,MAAMC,MAAM,SAASL,KAAK,CAACM,SAAS,CAAc;EACvDC,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEC,IAAI;MAAEC,UAAU;MAAEC,KAAK;MAAEC,WAAW;MAAEC,MAAM;MAAEC,MAAM;MAAEC;IAAS,CAAC,GACtE,IAAI,CAACC,KAAK;IAEZ,oBACEX,IAAA,CAACF,6BAA6B;MAC5Bc,KAAK,EAAE,CAAC;QAAEH;MAAO,CAAC,EAAEI,MAAM,CAACC,MAAM,CAAE;MACnCV,IAAI,EAAEA,IAAK;MACXC,UAAU,EAAEA,UAAW;MACvBC,KAAK,EAAEA,KAAM;MACbC,WAAW,EAAEA,WAAY;MACzBC,MAAM,EAAEA,MAAO;MAAAE,QAAA,EAEdA;IAAQ,CACoB,CAAC;EAEpC;AACF;AAEA,MAAMG,MAAM,GAAGhB,UAAU,CAACkB,MAAM,CAAC;EAC/BD,MAAM,EAAE;IACNE,QAAQ,EAAE,UAAU;IACpBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","StyleSheet","LuggMarkerViewNativeComponent","jsx","_jsx","Marker","Component","render","name","coordinate","title","description","anchor","zIndex","rasterize","children","props","style","styles","marker","create","position","pointerEvents"],"sourceRoot":"../../../src","sources":["components/Marker.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,6BAA6B,MAAM,yCAAyC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAwCpF,OAAO,MAAMC,MAAM,SAASL,KAAK,CAACM,SAAS,CAAc;EACvDC,MAAMA,CAAA,EAAG;IACP,MAAM;MACJC,IAAI;MACJC,UAAU;MACVC,KAAK;MACLC,WAAW;MACXC,MAAM;MACNC,MAAM;MACNC,SAAS,GAAG,IAAI;MAChBC;IACF,CAAC,GAAG,IAAI,CAACC,KAAK;IAEd,oBACEZ,IAAA,CAACF,6BAA6B;MAC5Be,KAAK,EAAE,CAAC;QAAEJ;MAAO,CAAC,EAAEK,MAAM,CAACC,MAAM,CAAE;MACnCX,IAAI,EAAEA,IAAK;MACXC,UAAU,EAAEA,UAAW;MACvBC,KAAK,EAAEA,KAAM;MACbC,WAAW,EAAEA,WAAY;MACzBC,MAAM,EAAEA,MAAO;MACfE,SAAS,EAAEA,SAAU;MAAAC,QAAA,EAEpBA;IAAQ,CACoB,CAAC;EAEpC;AACF;AAEA,MAAMG,MAAM,GAAGjB,UAAU,CAACmB,MAAM,CAAC;EAC/BD,MAAM,EAAE;IACNE,QAAQ,EAAE,UAAU;IACpBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,6 +1,9 @@
1
1
  import { codegenNativeComponent } from 'react-native';
2
2
  import type { ViewProps, HostComponent } from 'react-native';
3
- import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
3
+ import type {
4
+ Double,
5
+ WithDefault,
6
+ } from 'react-native/Libraries/Types/CodegenTypes';
4
7
 
5
8
  export interface Coordinate {
6
9
  latitude: Double;
@@ -18,6 +21,7 @@ export interface NativeProps extends ViewProps {
18
21
  title?: string;
19
22
  description?: string;
20
23
  anchor?: Point;
24
+ rasterize?: WithDefault<boolean, true>;
21
25
  }
22
26
 
23
27
  export default codegenNativeComponent<NativeProps>(
@@ -5,7 +5,7 @@ export declare class MapView extends React.Component<MapViewProps> implements Ma
5
5
  static defaultProps: Partial<MapViewProps>;
6
6
  private nativeRef;
7
7
  private get nativeCommands();
8
- moveCamera(coordinate: Coordinate, options: MoveCameraOptions): void;
8
+ moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
9
9
  fitCoordinates(coordinates: Coordinate[], options?: FitCoordinatesOptions): void;
10
10
  render(): import("react/jsx-runtime").JSX.Element;
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,qBAAa,OACX,SAAQ,KAAK,CAAC,SAAS,CAAC,YAAY,CACpC,YAAW,UAAU;IAErB,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAOxC;IAEF,OAAO,CAAC,SAAS,CAA0B;IAE3C,OAAO,KAAK,cAAc,GAIzB;IAED,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB;IAc7D,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAyBzE,MAAM;CAkDP"}
1
+ {"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,qBAAa,OACX,SAAQ,KAAK,CAAC,SAAS,CAAC,YAAY,CACpC,YAAW,UAAU;IAErB,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAOxC;IAEF,OAAO,CAAC,SAAS,CAA0B;IAE3C,OAAO,KAAK,cAAc,GAIzB;IAED,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAc9D,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAyBzE,MAAM;CAkDP"}
@@ -6,7 +6,7 @@ import type { MapProvider, Coordinate, EdgeInsets } from './types';
6
6
  * @default duration -1
7
7
  */
8
8
  export interface MoveCameraOptions {
9
- zoom: number;
9
+ zoom?: number;
10
10
  duration?: number;
11
11
  }
12
12
  /**
@@ -21,7 +21,7 @@ export interface FitCoordinatesOptions {
21
21
  * MapView ref methods
22
22
  */
23
23
  export interface MapViewRef {
24
- moveCamera(coordinate: Coordinate, options: MoveCameraOptions): void;
24
+ moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
25
25
  fitCoordinates(coordinates: Coordinate[], options?: FitCoordinatesOptions): void;
26
26
  }
27
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MapView.types.d.ts","sourceRoot":"","sources":["../../../src/MapView.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,M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ACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACzE;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACzE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
@@ -26,6 +26,12 @@ export interface MarkerProps {
26
26
  * Z-index for marker ordering. Higher values render on top.
27
27
  */
28
28
  zIndex?: number;
29
+ /**
30
+ * Rasterize custom marker view to bitmap for better performance.
31
+ * Set to false if you need live view updates (e.g., animations).
32
+ * @default true
33
+ */
34
+ rasterize?: boolean;
29
35
  /**
30
36
  * Custom marker view
31
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;IACtD,MAAM;CAiBP"}
1
+ {"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;IACtD,MAAM;CA0BP"}
@@ -1,5 +1,5 @@
1
1
  import type { ViewProps, HostComponent } from 'react-native';
2
- import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
2
+ import type { Double, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
3
3
  export interface Coordinate {
4
4
  latitude: Double;
5
5
  longitude: Double;
@@ -14,6 +14,7 @@ export interface NativeProps extends ViewProps {
14
14
  title?: string;
15
15
  description?: string;
16
16
  anchor?: Point;
17
+ rasterize?: WithDefault<boolean, true>;
17
18
  }
18
19
  declare const _default: HostComponent<NativeProps>;
19
20
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"LuggMarkerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMarkerViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAExE,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
1
+ {"version":3,"file":"LuggMarkerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMarkerViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACZ,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,SAAS,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;CACxC;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lugg/maps",
3
- "version": "0.2.0-alpha.16",
3
+ "version": "0.2.0-alpha.18",
4
4
  "description": "Universal maps for React Native.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
package/src/MapView.tsx CHANGED
@@ -36,11 +36,11 @@ export class MapView
36
36
  return isApple ? AppleMapCommands : GoogleMapCommands;
37
37
  }
38
38
 
39
- moveCamera(coordinate: Coordinate, options: MoveCameraOptions) {
39
+ moveCamera(coordinate: Coordinate, options?: MoveCameraOptions) {
40
40
  const ref = this.nativeRef.current;
41
41
  if (!ref) return;
42
42
 
43
- const { zoom, duration = -1 } = options;
43
+ const { zoom = 0, duration = -1 } = options ?? {};
44
44
  this.nativeCommands.moveCamera(
45
45
  ref,
46
46
  coordinate.latitude,
@@ -7,7 +7,7 @@ import type { MapProvider, Coordinate, EdgeInsets } from './types';
7
7
  * @default duration -1
8
8
  */
9
9
  export interface MoveCameraOptions {
10
- zoom: number;
10
+ zoom?: number;
11
11
  duration?: number;
12
12
  }
13
13
 
@@ -24,7 +24,7 @@ export interface FitCoordinatesOptions {
24
24
  * MapView ref methods
25
25
  */
26
26
  export interface MapViewRef {
27
- moveCamera(coordinate: Coordinate, options: MoveCameraOptions): void;
27
+ moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
28
28
  fitCoordinates(
29
29
  coordinates: Coordinate[],
30
30
  options?: FitCoordinatesOptions
@@ -29,6 +29,12 @@ export interface MarkerProps {
29
29
  * Z-index for marker ordering. Higher values render on top.
30
30
  */
31
31
  zIndex?: number;
32
+ /**
33
+ * Rasterize custom marker view to bitmap for better performance.
34
+ * Set to false if you need live view updates (e.g., animations).
35
+ * @default true
36
+ */
37
+ rasterize?: boolean;
32
38
  /**
33
39
  * Custom marker view
34
40
  */
@@ -37,8 +43,16 @@ export interface MarkerProps {
37
43
 
38
44
  export class Marker extends React.Component<MarkerProps> {
39
45
  render() {
40
- const { name, coordinate, title, description, anchor, zIndex, children } =
41
- this.props;
46
+ const {
47
+ name,
48
+ coordinate,
49
+ title,
50
+ description,
51
+ anchor,
52
+ zIndex,
53
+ rasterize = true,
54
+ children,
55
+ } = this.props;
42
56
 
43
57
  return (
44
58
  <LuggMarkerViewNativeComponent
@@ -48,6 +62,7 @@ export class Marker extends React.Component<MarkerProps> {
48
62
  title={title}
49
63
  description={description}
50
64
  anchor={anchor}
65
+ rasterize={rasterize}
51
66
  >
52
67
  {children}
53
68
  </LuggMarkerViewNativeComponent>
@@ -1,6 +1,9 @@
1
1
  import { codegenNativeComponent } from 'react-native';
2
2
  import type { ViewProps, HostComponent } from 'react-native';
3
- import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
3
+ import type {
4
+ Double,
5
+ WithDefault,
6
+ } from 'react-native/Libraries/Types/CodegenTypes';
4
7
 
5
8
  export interface Coordinate {
6
9
  latitude: Double;
@@ -18,6 +21,7 @@ export interface NativeProps extends ViewProps {
18
21
  title?: string;
19
22
  description?: string;
20
23
  anchor?: Point;
24
+ rasterize?: WithDefault<boolean, true>;
21
25
  }
22
26
 
23
27
  export default codegenNativeComponent<NativeProps>(