From 7dc83244b7d883237910c3a283e90abedf32894c Mon Sep 17 00:00:00 2001 From: thanhdang198 Date: Tue, 30 Jan 2024 14:44:46 +0700 Subject: [PATCH] migrate ios sdk from maplibre to vietmap --- LICENSE.md | 10 +++ .../project.pbxproj | 13 +--- ios/RCTMGL/CameraStop.h | 2 +- ios/RCTMGL/FilterParser.m | 2 +- ios/RCTMGL/MGLCustomHeaders.m | 4 +- .../MGLFaux3DUserLocationAnnotationView.h | 2 +- ios/RCTMGL/MGLModule.m | 2 +- ios/RCTMGL/MGLOfflineModule.h | 2 +- ios/RCTMGL/MGLSnapshotModule.m | 2 +- ios/RCTMGL/MGLUserLocationHeadingArrowLayer.h | 2 +- ios/RCTMGL/MGLUserLocationHeadingBeamLayer.h | 2 +- ios/RCTMGL/MGLUserLocationHeadingIndicator.h | 2 +- ios/RCTMGL/RCTMGLBackgroundLayer.h | 2 +- ios/RCTMGL/RCTMGLCallout.h | 2 +- ios/RCTMGL/RCTMGLFillExtrusionLayer.h | 2 +- ios/RCTMGL/RCTMGLFillLayer.h | 2 +- ios/RCTMGL/RCTMGLImageSource.m | 2 +- ios/RCTMGL/RCTMGLImages.h | 2 +- ios/RCTMGL/RCTMGLLayer.h | 2 +- ios/RCTMGL/RCTMGLLight.h | 2 +- ios/RCTMGL/RCTMGLLineLayer.h | 2 +- ios/RCTMGL/RCTMGLLogging.m | 2 +- ios/RCTMGL/RCTMGLMapTouchEvent.h | 2 +- ios/RCTMGL/RCTMGLMapTouchEvent.m | 2 +- ios/RCTMGL/RCTMGLMapView.h | 2 +- ios/RCTMGL/RCTMGLMapView.m | 3 +- ios/RCTMGL/RCTMGLMapViewManager.h | 2 +- ios/RCTMGL/RCTMGLPointAnnotation.h | 2 +- ios/RCTMGL/RCTMGLRasterLayer.h | 2 +- ios/RCTMGL/RCTMGLRasterSource.h | 2 +- ios/RCTMGL/RCTMGLShapeSource.h | 2 +- ios/RCTMGL/RCTMGLSource.h | 2 +- ios/RCTMGL/RCTMGLStyle.h | 2 +- ios/RCTMGL/RCTMGLStyleValue.h | 2 +- ios/RCTMGL/RCTMGLTileSource.h | 2 +- ios/RCTMGL/RCTMGLUserLocation.h | 2 +- ios/RCTMGL/RCTMGLUserLocation.m | 2 +- ios/RCTMGL/RCTMGLUtils.h | 2 +- ios/RCTMGL/RCTMGLUtils.m | 2 +- ios/RCTMGL/RCTMGLVectorSource.h | 2 +- javascript/Maplibre.ts | 2 +- javascript/components/MapView.tsx | 4 +- maplibre-react-native.podspec | 66 ++++++++++--------- 43 files changed, 89 insertions(+), 85 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index aba844f7..db098e1d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,3 +1,13 @@ +Copyright (c) 2024 VietMap contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +This project was originally forked from https://github.com/rnmapbox/maps, also under the MIT license, but without a copyright holder notice. +//------------------------------------------------------------------------------------------------------------------------------ Copyright (c) 2022 MapLibre contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/example/ios/RNMaplibreExample.xcodeproj/project.pbxproj b/example/ios/RNMaplibreExample.xcodeproj/project.pbxproj index f16c110c..fe157d83 100644 --- a/example/ios/RNMaplibreExample.xcodeproj/project.pbxproj +++ b/example/ios/RNMaplibreExample.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 51C0260825301F99008C5283 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 51C0260725301F99008C5283 /* LaunchScreen.storyboard */; }; AD8CDE4F410D2E699BE7E99D /* libPods-RNMaplibreExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A98F897FA1ECD18EB0F1C4DC /* libPods-RNMaplibreExample.a */; }; - E9DD059E29705D4C0010A116 /* Mapbox in Frameworks */ = {isa = PBXBuildFile; productRef = 80AC8CF095DA4835C83255C8 /* Mapbox */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -63,7 +62,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E9DD059E29705D4C0010A116 /* Mapbox in Frameworks */, AD8CDE4F410D2E699BE7E99D /* libPods-RNMaplibreExample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -206,7 +204,6 @@ ); name = RNMaplibreExample; packageProductDependencies = ( - 80AC8CF095DA4835C83255C8 /* Mapbox */, ); productName = RNMaplibreExample; productReference = 13B07F961A680F5B00A75B9A /* RNMaplibreExample.app */; @@ -358,12 +355,14 @@ "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion", "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework/glog", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/VietMap/VietMap.framework/VietMap", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/double-conversion.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/VietMap.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -620,14 +619,6 @@ }; }; /* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - 80AC8CF095DA4835C83255C8 /* Mapbox */ = { - isa = XCSwiftPackageProductDependency; - package = DB11E3B9346BB8DFEB4101D5 /* XCRemoteSwiftPackageReference "maplibre-gl-native-distribution" */; - productName = Mapbox; - }; -/* End XCSwiftPackageProductDependency section */ }; rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; } diff --git a/ios/RCTMGL/CameraStop.h b/ios/RCTMGL/CameraStop.h index 39864354..83d4163a 100644 --- a/ios/RCTMGL/CameraStop.h +++ b/ios/RCTMGL/CameraStop.h @@ -6,7 +6,7 @@ // Copyright © 2017 Mapbox Inc. All rights reserved. // -@import Mapbox; +@import VietMap; #import "RCTMGLCamera.h" @interface CameraStop : NSObject diff --git a/ios/RCTMGL/FilterParser.m b/ios/RCTMGL/FilterParser.m index f2d9a1c0..8fabd8cd 100644 --- a/ios/RCTMGL/FilterParser.m +++ b/ios/RCTMGL/FilterParser.m @@ -7,7 +7,7 @@ // #import "FilterParser.h" -#import +#import @implementation FilterParser diff --git a/ios/RCTMGL/MGLCustomHeaders.m b/ios/RCTMGL/MGLCustomHeaders.m index a7f6e273..0dc542fb 100644 --- a/ios/RCTMGL/MGLCustomHeaders.m +++ b/ios/RCTMGL/MGLCustomHeaders.m @@ -6,8 +6,8 @@ #import #import "MGLCustomHeaders.h" -#import -#import +#import +#import @implementation NSMutableURLRequest (CustomHeaders) diff --git a/ios/RCTMGL/MGLFaux3DUserLocationAnnotationView.h b/ios/RCTMGL/MGLFaux3DUserLocationAnnotationView.h index 53cf4615..88ab0bea 100644 --- a/ios/RCTMGL/MGLFaux3DUserLocationAnnotationView.h +++ b/ios/RCTMGL/MGLFaux3DUserLocationAnnotationView.h @@ -7,7 +7,7 @@ // #import -@import Mapbox; +@import VietMap; extern const CGFloat MGLUserLocationAnnotationDotSize; extern const CGFloat MGLUserLocationAnnotationHaloSize; diff --git a/ios/RCTMGL/MGLModule.m b/ios/RCTMGL/MGLModule.m index b44a35b2..2bc5c014 100644 --- a/ios/RCTMGL/MGLModule.m +++ b/ios/RCTMGL/MGLModule.m @@ -12,7 +12,7 @@ #import "CameraMode.h" #import "RCTMGLSource.h" #import "MGLCustomHeaders.h" -@import Mapbox; +@import VietMap; @implementation MGLModule diff --git a/ios/RCTMGL/MGLOfflineModule.h b/ios/RCTMGL/MGLOfflineModule.h index e876a175..38204841 100644 --- a/ios/RCTMGL/MGLOfflineModule.h +++ b/ios/RCTMGL/MGLOfflineModule.h @@ -9,7 +9,7 @@ #import #import -@import Mapbox; +@import VietMap; @interface MGLOfflineModule : RCTEventEmitter diff --git a/ios/RCTMGL/MGLSnapshotModule.m b/ios/RCTMGL/MGLSnapshotModule.m index 25ba8d1a..c3ca4ae7 100644 --- a/ios/RCTMGL/MGLSnapshotModule.m +++ b/ios/RCTMGL/MGLSnapshotModule.m @@ -9,7 +9,7 @@ #import "MGLSnapshotModule.h" #import "RCTMGLUtils.h" #import "RNMBImageUtils.h" -@import Mapbox; +@import VietMap; @implementation MGLSnapshotModule diff --git a/ios/RCTMGL/MGLUserLocationHeadingArrowLayer.h b/ios/RCTMGL/MGLUserLocationHeadingArrowLayer.h index 90727cd1..dfb5b1ef 100644 --- a/ios/RCTMGL/MGLUserLocationHeadingArrowLayer.h +++ b/ios/RCTMGL/MGLUserLocationHeadingArrowLayer.h @@ -1,6 +1,6 @@ #import #import "MGLUserLocationHeadingIndicator.h" -@import Mapbox; +@import VietMap; @interface MGLUserLocationHeadingArrowLayer : CAShapeLayer diff --git a/ios/RCTMGL/MGLUserLocationHeadingBeamLayer.h b/ios/RCTMGL/MGLUserLocationHeadingBeamLayer.h index 4003f7e1..78c5825e 100644 --- a/ios/RCTMGL/MGLUserLocationHeadingBeamLayer.h +++ b/ios/RCTMGL/MGLUserLocationHeadingBeamLayer.h @@ -1,6 +1,6 @@ #import #import "MGLUserLocationHeadingIndicator.h" -@import Mapbox; +@import VietMap; @interface MGLUserLocationHeadingBeamLayer : CALayer diff --git a/ios/RCTMGL/MGLUserLocationHeadingIndicator.h b/ios/RCTMGL/MGLUserLocationHeadingIndicator.h index e17d5993..63109829 100644 --- a/ios/RCTMGL/MGLUserLocationHeadingIndicator.h +++ b/ios/RCTMGL/MGLUserLocationHeadingIndicator.h @@ -1,5 +1,5 @@ #import -@import Mapbox; +@import VietMap; @protocol MGLUserLocationHeadingIndicator diff --git a/ios/RCTMGL/RCTMGLBackgroundLayer.h b/ios/RCTMGL/RCTMGLBackgroundLayer.h index ed264d31..7ba93149 100644 --- a/ios/RCTMGL/RCTMGLBackgroundLayer.h +++ b/ios/RCTMGL/RCTMGLBackgroundLayer.h @@ -7,7 +7,7 @@ // #import "RCTMGLLayer.h" -@import Mapbox; +@import VietMap; @interface RCTMGLBackgroundLayer : RCTMGLLayer diff --git a/ios/RCTMGL/RCTMGLCallout.h b/ios/RCTMGL/RCTMGLCallout.h index 599d109b..79ccafd7 100644 --- a/ios/RCTMGL/RCTMGLCallout.h +++ b/ios/RCTMGL/RCTMGLCallout.h @@ -8,7 +8,7 @@ #import -@import Mapbox; +@import VietMap; @interface RCTMGLCallout : RCTView diff --git a/ios/RCTMGL/RCTMGLFillExtrusionLayer.h b/ios/RCTMGL/RCTMGLFillExtrusionLayer.h index 90e8821a..24c59643 100644 --- a/ios/RCTMGL/RCTMGLFillExtrusionLayer.h +++ b/ios/RCTMGL/RCTMGLFillExtrusionLayer.h @@ -7,7 +7,7 @@ // #import "RCTMGLVectorLayer.h" -@import Mapbox; +@import VietMap; @interface RCTMGLFillExtrusionLayer : RCTMGLVectorLayer diff --git a/ios/RCTMGL/RCTMGLFillLayer.h b/ios/RCTMGL/RCTMGLFillLayer.h index d00fec4c..ad4d009e 100644 --- a/ios/RCTMGL/RCTMGLFillLayer.h +++ b/ios/RCTMGL/RCTMGLFillLayer.h @@ -7,7 +7,7 @@ // #import "RCTMGLVectorLayer.h" -@import Mapbox; +@import VietMap; @interface RCTMGLFillLayer : RCTMGLVectorLayer diff --git a/ios/RCTMGL/RCTMGLImageSource.m b/ios/RCTMGL/RCTMGLImageSource.m index 817918b2..e0f5a5da 100644 --- a/ios/RCTMGL/RCTMGLImageSource.m +++ b/ios/RCTMGL/RCTMGLImageSource.m @@ -7,7 +7,7 @@ // #import "RCTMGLImageSource.h" -@import Mapbox; +@import VietMap; @implementation RCTMGLImageSource diff --git a/ios/RCTMGL/RCTMGLImages.h b/ios/RCTMGL/RCTMGLImages.h index 3fecb2b4..2bc2379a 100644 --- a/ios/RCTMGL/RCTMGLImages.h +++ b/ios/RCTMGL/RCTMGLImages.h @@ -2,7 +2,7 @@ #import #import -@import Mapbox; +@import VietMap; @class RCTMGLMapView; diff --git a/ios/RCTMGL/RCTMGLLayer.h b/ios/RCTMGL/RCTMGLLayer.h index 1ede8a0f..4238f56f 100644 --- a/ios/RCTMGL/RCTMGLLayer.h +++ b/ios/RCTMGL/RCTMGLLayer.h @@ -12,7 +12,7 @@ @class RCTMGLMapView; -@import Mapbox; +@import VietMap; @interface RCTMGLLayer : UIView diff --git a/ios/RCTMGL/RCTMGLLight.h b/ios/RCTMGL/RCTMGLLight.h index e4a971a2..def86eb2 100644 --- a/ios/RCTMGL/RCTMGLLight.h +++ b/ios/RCTMGL/RCTMGLLight.h @@ -7,7 +7,7 @@ // #import -@import Mapbox; +@import VietMap; @interface RCTMGLLight : UIView diff --git a/ios/RCTMGL/RCTMGLLineLayer.h b/ios/RCTMGL/RCTMGLLineLayer.h index 27dade82..40ebdf36 100644 --- a/ios/RCTMGL/RCTMGLLineLayer.h +++ b/ios/RCTMGL/RCTMGLLineLayer.h @@ -7,7 +7,7 @@ // #import "RCTMGLVectorLayer.h" -@import Mapbox; +@import VietMap; @interface RCTMGLLineLayer : RCTMGLVectorLayer diff --git a/ios/RCTMGL/RCTMGLLogging.m b/ios/RCTMGL/RCTMGLLogging.m index 8516b330..5d4205b5 100644 --- a/ios/RCTMGL/RCTMGLLogging.m +++ b/ios/RCTMGL/RCTMGLLogging.m @@ -1,6 +1,6 @@ #import "RCTMGLLogging.h" -@import Mapbox; +@import VietMap; @interface RCTMGLLogging() @property (nonatomic) BOOL hasListeners; diff --git a/ios/RCTMGL/RCTMGLMapTouchEvent.h b/ios/RCTMGL/RCTMGLMapTouchEvent.h index 467613a3..79176bd4 100644 --- a/ios/RCTMGL/RCTMGLMapTouchEvent.h +++ b/ios/RCTMGL/RCTMGLMapTouchEvent.h @@ -9,7 +9,7 @@ #import #import "RCTMGLEvent.h" #import "RCTMGLPointAnnotation.h" -@import Mapbox; +@import VietMap; @interface RCTMGLMapTouchEvent : RCTMGLEvent diff --git a/ios/RCTMGL/RCTMGLMapTouchEvent.m b/ios/RCTMGL/RCTMGLMapTouchEvent.m index ec3ac19d..99f33bab 100644 --- a/ios/RCTMGL/RCTMGLMapTouchEvent.m +++ b/ios/RCTMGL/RCTMGLMapTouchEvent.m @@ -9,7 +9,7 @@ #import "RCTMGLMapTouchEvent.h" #import "RCTMGLEventTypes.h" #import "RCTMGLPointAnnotation.h" -@import Mapbox; +@import VietMap; @implementation RCTMGLMapTouchEvent diff --git a/ios/RCTMGL/RCTMGLMapView.h b/ios/RCTMGL/RCTMGLMapView.h index 413e63f3..c0aec179 100644 --- a/ios/RCTMGL/RCTMGLMapView.h +++ b/ios/RCTMGL/RCTMGLMapView.h @@ -12,7 +12,7 @@ #import "RCTMGLPointAnnotation.h" #import "RCTMGLLight.h" -@import Mapbox; +@import VietMap; @class CameraUpdateQueue; @class RCTMGLImages; diff --git a/ios/RCTMGL/RCTMGLMapView.m b/ios/RCTMGL/RCTMGLMapView.m index b439cc78..464a27b0 100644 --- a/ios/RCTMGL/RCTMGLMapView.m +++ b/ios/RCTMGL/RCTMGLMapView.m @@ -265,7 +265,8 @@ - (void)setReactRotateEnabled:(BOOL)reactRotateEnabled - (void)setReactAttributionEnabled:(BOOL)reactAttributionEnabled { _reactAttributionEnabled = reactAttributionEnabled; - self.attributionButton.hidden = !_reactAttributionEnabled; +// self.attributionButton.hidden = !_reactAttributionEnabled; + } diff --git a/ios/RCTMGL/RCTMGLMapViewManager.h b/ios/RCTMGL/RCTMGLMapViewManager.h index b2ca19a9..621133e2 100644 --- a/ios/RCTMGL/RCTMGLMapViewManager.h +++ b/ios/RCTMGL/RCTMGLMapViewManager.h @@ -7,7 +7,7 @@ // #import "ViewManager.h" -@import Mapbox; +@import VietMap; @interface RCTMGLMapViewManager : ViewManager diff --git a/ios/RCTMGL/RCTMGLPointAnnotation.h b/ios/RCTMGL/RCTMGLPointAnnotation.h index 1fdd014a..1d48259d 100644 --- a/ios/RCTMGL/RCTMGLPointAnnotation.h +++ b/ios/RCTMGL/RCTMGLPointAnnotation.h @@ -11,7 +11,7 @@ #import #import "RCTMGLCallout.h" -@import Mapbox; +@import VietMap; @interface RCTMGLPointAnnotation : MGLAnnotationView diff --git a/ios/RCTMGL/RCTMGLRasterLayer.h b/ios/RCTMGL/RCTMGLRasterLayer.h index af474212..47e2fc2f 100644 --- a/ios/RCTMGL/RCTMGLRasterLayer.h +++ b/ios/RCTMGL/RCTMGLRasterLayer.h @@ -7,7 +7,7 @@ // #import "RCTMGLLayer.h" -@import Mapbox; +@import VietMap; @interface RCTMGLRasterLayer : RCTMGLLayer diff --git a/ios/RCTMGL/RCTMGLRasterSource.h b/ios/RCTMGL/RCTMGLRasterSource.h index c9b60012..ff3870e6 100644 --- a/ios/RCTMGL/RCTMGLRasterSource.h +++ b/ios/RCTMGL/RCTMGLRasterSource.h @@ -7,7 +7,7 @@ // #import "RCTMGLTileSource.h" -@import Mapbox; +@import VietMap; @interface RCTMGLRasterSource : RCTMGLTileSource diff --git a/ios/RCTMGL/RCTMGLShapeSource.h b/ios/RCTMGL/RCTMGLShapeSource.h index 282e3653..8296b652 100644 --- a/ios/RCTMGL/RCTMGLShapeSource.h +++ b/ios/RCTMGL/RCTMGLShapeSource.h @@ -9,7 +9,7 @@ #import #import "RCTMGLSource.h" -@import Mapbox; +@import VietMap; @interface RCTMGLShapeSource : RCTMGLSource diff --git a/ios/RCTMGL/RCTMGLSource.h b/ios/RCTMGL/RCTMGLSource.h index 03c66c5e..3b0b8883 100644 --- a/ios/RCTMGL/RCTMGLSource.h +++ b/ios/RCTMGL/RCTMGLSource.h @@ -9,7 +9,7 @@ #import #import "RCTMGLLayer.h" #import -@import Mapbox; +@import VietMap; @interface RCTMGLSource : UIView diff --git a/ios/RCTMGL/RCTMGLStyle.h b/ios/RCTMGL/RCTMGLStyle.h index 0576d460..14115c45 100644 --- a/ios/RCTMGL/RCTMGLStyle.h +++ b/ios/RCTMGL/RCTMGLStyle.h @@ -5,7 +5,7 @@ #import "RCTMGLStyleValue.h" #import -@import Mapbox; +@import VietMap; @interface RCTMGLStyle : NSObject diff --git a/ios/RCTMGL/RCTMGLStyleValue.h b/ios/RCTMGL/RCTMGLStyleValue.h index 645aaca3..e0be5de6 100644 --- a/ios/RCTMGL/RCTMGLStyleValue.h +++ b/ios/RCTMGL/RCTMGLStyleValue.h @@ -7,7 +7,7 @@ // #import -@import Mapbox; +@import VietMap; @interface RCTMGLStyleValue : NSObject diff --git a/ios/RCTMGL/RCTMGLTileSource.h b/ios/RCTMGL/RCTMGLTileSource.h index 5736fb4e..193c29b7 100644 --- a/ios/RCTMGL/RCTMGLTileSource.h +++ b/ios/RCTMGL/RCTMGLTileSource.h @@ -4,7 +4,7 @@ // #import "RCTMGLSource.h" -@import Mapbox; +@import VietMap; @interface RCTMGLTileSource : RCTMGLSource diff --git a/ios/RCTMGL/RCTMGLUserLocation.h b/ios/RCTMGL/RCTMGLUserLocation.h index bae840eb..fb041d2e 100644 --- a/ios/RCTMGL/RCTMGLUserLocation.h +++ b/ios/RCTMGL/RCTMGLUserLocation.h @@ -4,7 +4,7 @@ #import #import -#import +#import @interface RCTMGLUserLocation : NSObject diff --git a/ios/RCTMGL/RCTMGLUserLocation.m b/ios/RCTMGL/RCTMGLUserLocation.m index 6880af29..17c0f073 100644 --- a/ios/RCTMGL/RCTMGLUserLocation.m +++ b/ios/RCTMGL/RCTMGLUserLocation.m @@ -4,7 +4,7 @@ // #import "RCTMGLUserLocation.h" -#import +#import @interface HiddenUserLocationAnnotationView : MGLUserLocationAnnotationView diff --git a/ios/RCTMGL/RCTMGLUtils.h b/ios/RCTMGL/RCTMGLUtils.h index d32381ea..f83f802c 100644 --- a/ios/RCTMGL/RCTMGLUtils.h +++ b/ios/RCTMGL/RCTMGLUtils.h @@ -11,7 +11,7 @@ #import #import -@import Mapbox; +@import VietMap; @interface RCTMGLUtils: NSObject diff --git a/ios/RCTMGL/RCTMGLUtils.m b/ios/RCTMGL/RCTMGLUtils.m index 1dca4bed..7a84fd70 100644 --- a/ios/RCTMGL/RCTMGLUtils.m +++ b/ios/RCTMGL/RCTMGLUtils.m @@ -9,7 +9,7 @@ #import "RCTMGLUtils.h" #import "RCTMGLImageQueue.h" -@import Mapbox; +@import VietMap; @implementation RCTMGLUtils diff --git a/ios/RCTMGL/RCTMGLVectorSource.h b/ios/RCTMGL/RCTMGLVectorSource.h index 98263940..22f879ed 100644 --- a/ios/RCTMGL/RCTMGLVectorSource.h +++ b/ios/RCTMGL/RCTMGLVectorSource.h @@ -7,7 +7,7 @@ // #import "RCTMGLTileSource.h" -@import Mapbox; +@import VietMap; @interface RCTMGLVectorSource : RCTMGLTileSource diff --git a/javascript/Maplibre.ts b/javascript/Maplibre.ts index 91e28b88..d27f1dcc 100644 --- a/javascript/Maplibre.ts +++ b/javascript/Maplibre.ts @@ -58,7 +58,7 @@ import {UserTrackingMode} from './components/Camera'; // types: export enum StyleURL { - Default = 'https://demotiles.maplibre.org/style.json', + Default = 'https://maps.vietmap.vn/api/maps/light/styles.json?apikey=6411732992b3c4def7a117893215b9163a15e69065c0874d', } /** @deprecated UserTrackingModes is deprecated use UserTrackingMode */ diff --git a/javascript/components/MapView.tsx b/javascript/components/MapView.tsx index b425e02e..275b5c6a 100644 --- a/javascript/components/MapView.tsx +++ b/javascript/components/MapView.tsx @@ -290,8 +290,8 @@ class MapView extends NativeBridgeComponent( scrollEnabled: true, pitchEnabled: true, rotateEnabled: true, - attributionEnabled: true, - logoEnabled: false, + attributionEnabled: false, + logoEnabled: true, surfaceView: false, regionWillChangeDebounceTime: 10, regionDidChangeDebounceTime: 500, diff --git a/maplibre-react-native.podspec b/maplibre-react-native.podspec index 751f540f..9e6569c8 100644 --- a/maplibre-react-native.podspec +++ b/maplibre-react-native.podspec @@ -24,40 +24,40 @@ def $RNMBGL._add_spm_to_target(project, target, url, requirement, product_name) end def $RNMBGL.post_install(installer) - spm_spec = { - url: "https://github.com/maplibre/maplibre-gl-native-distribution", - requirement: { - kind: "exactVersion", - version: "5.13.0" - }, - product_name: "Mapbox" - } +# spm_spec = { +# url: "https://github.com/maplibre/maplibre-gl-native-distribution", +# requirement: { +# kind: "exactVersion", +# version: "5.13.0" +# }, +# product_name: "Mapbox" +# } - if $RNMBGL_SPM_Spec.is_a?(Hash) - spm_spec = $RNMBGL_SPM_Spec - end - project = installer.pods_project - self._add_spm_to_target( - project, - project.targets.find { |t| t.name == "maplibre-react-native"}, - spm_spec[:url], - spm_spec[:requirement], - spm_spec[:product_name] - ) +# if $RNMBGL_SPM_Spec.is_a?(Hash) +# spm_spec = $RNMBGL_SPM_Spec +# end +# project = installer.pods_project +# self._add_spm_to_target( +# project, +# project.targets.find { |t| t.name == "maplibre-react-native"}, +# spm_spec[:url], +# spm_spec[:requirement], +# spm_spec[:product_name] +# ) - installer.aggregate_targets.group_by(&:user_project).each do |project, targets| - targets.each do |target| - target.user_targets.each do |user_target| - self._add_spm_to_target( - project, - user_target, - spm_spec[:url], - spm_spec[:requirement], - spm_spec[:product_name] - ) - end - end - end +# installer.aggregate_targets.group_by(&:user_project).each do |project, targets| +# targets.each do |target| +# target.user_targets.each do |user_target| +# self._add_spm_to_target( +# project, +# user_target, +# spm_spec[:url], +# spm_spec[:requirement], +# spm_spec[:product_name] +# ) +# end +# end +# end end Pod::Spec.new do |s| @@ -73,6 +73,8 @@ Pod::Spec.new do |s| s.dependency 'React-Core' s.dependency 'React' + s.dependency 'VietMap', '1.1.0' + s.subspec 'DynamicLibrary' do |sp| sp.source_files = "ios/RCTMGL/**/*.{h,m}" end