Skip to content

Instantly share code, notes, and snippets.

@hpstuff
Created March 9, 2025 17:17
Show Gist options
  • Save hpstuff/4fe033e9b0bdb79b9b8c136034493d2d to your computer and use it in GitHub Desktop.
Save hpstuff/4fe033e9b0bdb79b9b8c136034493d2d to your computer and use it in GitHub Desktop.
Lynx Google Map example
const Example = () => {
return (
<view>
<google-map />
</view>
);
}
@import GoogleMaps;
#import <Lynx/LynxUI.h>
NS_ASSUME_NONNULL_BEGIN
@interface GoogleMapsView : GMSMapView
@end
@interface LynxGoogleMapView : LynxUI <GoogleMapsView *> <GMSMapViewDelegate>
@end
NS_ASSUME_NONNULL_END
#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