Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import "AIRGoogleMapMarker.h"
#import <GoogleMaps/GoogleMaps.h>
#import <React/RCTImageLoader.h>
#import <React/RCTImageLoaderProtocol.h>
#import <React/RCTUtils.h>
#import "AIRGMSMarker.h"
#import "AIRGoogleMapCallout.h"
Expand Down Expand Up @@ -117,9 +117,9 @@ - (void)hideCalloutView {

- (void)redraw {
if (!_realMarker.iconView) return;

BOOL oldValue = _realMarker.tracksViewChanges;

if (oldValue == YES)
{
// Immediate refresh, like right now. Not waiting for next frame.
Expand Down Expand Up @@ -270,7 +270,7 @@ - (void)setImageSrc:(NSString *)imageSrc
[self iconViewInsertSubview:_iconImageView atIndex:0];
}

_reloadImageCancellationBlock = [[_bridge moduleForClass:[RCTImageLoader class]] loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
_reloadImageCancellationBlock = [[_bridge moduleForName:@"ImageLoader"] loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
size:self.bounds.size
scale:RCTScreenScale()
clipped:YES
Expand Down Expand Up @@ -327,7 +327,7 @@ - (void)setIconSrc:(NSString *)iconSrc
}

_reloadImageCancellationBlock =
[[_bridge moduleForClass:[RCTImageLoader class]] loadImageWithURLRequest:[RCTConvert NSURLRequest:_iconSrc]
[[_bridge moduleForName:@"ImageLoader"] loadImageWithURLRequest:[RCTConvert NSURLRequest:_iconSrc]
size:self.bounds.size
scale:RCTScreenScale()
clipped:YES
Expand Down
4 changes: 2 additions & 2 deletions lib/ios/AirGoogleMaps/AIRGoogleMapOverlay.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import "AIRGoogleMapOverlay.h"

#import <React/RCTEventDispatcher.h>
#import <React/RCTImageLoader.h>
#import <React/RCTImageLoaderProtocol.h>
#import <React/RCTUtils.h>
#import <React/UIView+React.h>

Expand Down Expand Up @@ -42,7 +42,7 @@ - (void)setImageSrc:(NSString *)imageSrc
}

__weak typeof(self) weakSelf = self;
_reloadImageCancellationBlock = [[_bridge moduleForClass:[RCTImageLoader class]] loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
_reloadImageCancellationBlock = [[_bridge moduleForName:@"ImageLoader"] loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
size:weakSelf.bounds.size
scale:RCTScreenScale()
clipped:YES
Expand Down
20 changes: 10 additions & 10 deletions lib/ios/AirMaps/AIRMapMarker.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#import <React/RCTBridge.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTImageLoader.h>
#import <React/RCTImageLoaderProtocol.h>
#import <React/RCTUtils.h>
#import <React/UIView+React.h>

Expand Down Expand Up @@ -151,7 +151,7 @@ - (void)showCalloutView
{
_calloutIsOpen = YES;
[self setZIndex:_zIndexBeforeOpen];

MKAnnotationView *annotationView = [self getAnnotationView];

[self setSelected:YES animated:NO];
Expand Down Expand Up @@ -203,12 +203,12 @@ - (void)addGestureRecognizerToView:(UIView *)view {
- (void)_handleTap:(UITapGestureRecognizer *)recognizer {
AIRMapMarker *marker = self;
if (!marker) return;

if (marker.selected) {
CGPoint touchPoint = [recognizer locationInView:marker.map.calloutView];
CGRect bubbleFrame = [self.calloutView convertRect:marker.map.calloutView.bounds toView:marker.map];
CGPoint touchPointReal = [recognizer locationInView:self.calloutView];

UIView *calloutView = [marker.map.calloutView hitTest:touchPoint withEvent:nil];
if (calloutView) {
// the callout (or its subview) got clicked, not the marker
Expand All @@ -222,7 +222,7 @@ - (void)_handleTap:(UITapGestureRecognizer *)recognizer {
}
tmp = tmp.superview;
}

id event = @{
@"action": calloutSubview ? @"callout-inside-press" : @"callout-press",
@"id": marker.identifier ?: @"unknown",
Expand All @@ -237,15 +237,15 @@ - (void)_handleTap:(UITapGestureRecognizer *)recognizer {
@"height": @(bubbleFrame.size.height),
}
};

if (calloutSubview) calloutSubview.onPress(event);
if (marker.onCalloutPress) marker.onCalloutPress(event);
if (marker.calloutView && marker.calloutView.onPress) marker.calloutView.onPress(event);
if (marker.map.onCalloutPress) marker.map.onCalloutPress(event);
return;
}
}

// the actual marker got clicked
id event = @{
@"action": @"marker-press",
Expand All @@ -255,10 +255,10 @@ - (void)_handleTap:(UITapGestureRecognizer *)recognizer {
@"longitude": @(marker.coordinate.longitude)
}
};

if (marker.onPress) marker.onPress(event);
if (marker.map.onMarkerPress) marker.map.onMarkerPress(event);

[marker.map selectAnnotation:marker animated:NO];
}

Expand Down Expand Up @@ -314,7 +314,7 @@ - (void)setImageSrc:(NSString *)imageSrc
_reloadImageCancellationBlock();
_reloadImageCancellationBlock = nil;
}
_reloadImageCancellationBlock = [[_bridge moduleForClass:[RCTImageLoader class]] loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
_reloadImageCancellationBlock = [[_bridge moduleForName:@"ImageLoader"] loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
size:self.bounds.size
scale:RCTScreenScale()
clipped:YES
Expand Down
4 changes: 2 additions & 2 deletions lib/ios/AirMaps/AIRMapOverlay.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#import <React/RCTBridge.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTImageLoader.h>
#import <React/RCTImageLoaderProtocol.h>
#import <React/RCTUtils.h>
#import <React/UIView+React.h>

Expand All @@ -27,7 +27,7 @@ - (void)setImageSrc:(NSString *)imageSrc
_reloadImageCancellationBlock = nil;
}
__weak typeof(self) weakSelf = self;
_reloadImageCancellationBlock = [[_bridge moduleForClass:[RCTImageLoader class]] loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
_reloadImageCancellationBlock = [[_bridge moduleForName:@"ImageLoader"] loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
size:weakSelf.bounds.size
scale:RCTScreenScale()
clipped:YES
Expand Down