@lugg/maps 1.0.0-beta.2 → 1.0.0-beta.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.
@@ -354,7 +354,7 @@ class GoogleMapProvider(private val context: Context) :
354
354
 
355
355
  val point = map.projection.toScreenLocation(marker.position)
356
356
  contentView.translationX = point.x - contentView.width * calloutView.anchorX
357
- contentView.translationY = point.y - contentView.height * calloutView.anchorY
357
+ contentView.translationY = point.y - markerView.contentView.height * markerView.anchorY - contentView.height * calloutView.anchorY
358
358
  }
359
359
 
360
360
  // endregion
@@ -587,10 +587,7 @@
587
587
  }
588
588
 
589
589
  _activeNonBubbledMarker = markerView;
590
- dispatch_async(dispatch_get_main_queue(), ^{
591
- [self positionNonBubbledCallout];
592
- contentView.hidden = NO;
593
- });
590
+ [self positionNonBubbledCallout];
594
591
  }
595
592
 
596
593
  - (void)calloutViewDidUpdate:(LuggCalloutView *)calloutView {
@@ -616,8 +613,7 @@
616
613
  if (annotationView && contentView.superview == annotationView) {
617
614
  CGPoint center = CGPointMake(annotationView.bounds.size.width / 2.0 +
618
615
  contentSize.width * (0.5 - anchor.x),
619
- annotationView.bounds.size.height / 2.0 +
620
- contentSize.height * (0.5 - anchor.y));
616
+ contentSize.height * (0.5 - anchor.y));
621
617
  contentView.center = center;
622
618
  } else {
623
619
  CGPoint point =
@@ -627,6 +623,8 @@
627
623
  CGPointMake(point.x + contentSize.width * (0.5 - anchor.x),
628
624
  point.y + contentSize.height * (0.5 - anchor.y));
629
625
  }
626
+
627
+ contentView.hidden = NO;
630
628
  }
631
629
 
632
630
  - (void)dismissNonBubbledCallout {
@@ -443,9 +443,14 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
443
443
  CGPoint point = [_mapView.projection
444
444
  pointForCoordinate:_activeNonBubbledMarker.coordinate];
445
445
 
446
+ UIView *iconView = _activeNonBubbledMarker.iconView;
447
+ CGFloat markerHeight =
448
+ iconView.bounds.size.height * _activeNonBubbledMarker.scale;
449
+
446
450
  contentView.center =
447
451
  CGPointMake(point.x + contentSize.width * (0.5 - anchor.x),
448
- point.y + contentSize.height * (0.5 - anchor.y));
452
+ point.y - markerHeight * _activeNonBubbledMarker.anchor.y +
453
+ contentSize.height * (0.5 - anchor.y));
449
454
  }
450
455
 
451
456
  #pragma mark - MarkerViewDelegate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lugg/maps",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.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",