Created
March 9, 2025 17:17
-
-
Save hpstuff/4fe033e9b0bdb79b9b8c136034493d2d to your computer and use it in GitHub Desktop.
Lynx Google Map example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Example = () => { | |
return ( | |
<view> | |
<google-map /> | |
</view> | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import GoogleMaps; | |
#import <Lynx/LynxUI.h> | |
NS_ASSUME_NONNULL_BEGIN | |
@interface GoogleMapsView : GMSMapView | |
@end | |
@interface LynxGoogleMapView : LynxUI <GoogleMapsView *> <GMSMapViewDelegate> | |
@end | |
NS_ASSUME_NONNULL_END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "GoogleMaps.h" | |
#import <Lynx/LynxComponentRegistry.h> | |
#import <Lynx/LynxPropsProcessor.h> | |
@implementation LynxGoogleMapView | |
GoogleMapsView *_mapView; | |
LYNX_LAZY_REGISTER_UI("google-map"); | |
- (GoogleMapsView *)createView { | |
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:12]; | |
_mapView = [GoogleMapsView mapWithFrame:CGRectZero camera:camera]; | |
_mapView.delegate = self; | |
return _mapView; | |
} | |
@end | |
@implementation GoogleMapsView | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment