diff --git a/.gitignore b/.gitignore
index 42dba6956..e72b9254b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -121,3 +121,5 @@ coverage
# Config plugin
/plugin/build
+
+.env
\ No newline at end of file
diff --git a/docs/MapView.md b/docs/MapView.md
index 3deba312d..37c20ce2a 100644
--- a/docs/MapView.md
+++ b/docs/MapView.md
@@ -16,10 +16,40 @@
| pitchEnabled | `boolean` | `true` | `false` | Enable/Disable pitch on map |
| rotateEnabled | `boolean` | `true` | `false` | Enable/Disable rotation on map |
| attributionEnabled | `boolean` | `true` | `false` | Enable/Disable attribution on map.
This must be enabled for Mapbox-hosted tiles and styles. Please refer to the Mapbox Terms of Service.
Other providers do not require this. |
-| attributionPosition | `{top?: number, left?: number} \| {top?: number, right?: number} \| {bottom?: number, left?: number} \| {bottom?: number, right?: number}` | `none` | `false` | Adds attribution offset, e.g. `{top: 8, left: 8}` will put attribution button in top-left corner of the map |
+| attributionPosition | `\| {
+ top?: number;
+ left?: number;
+ }
+\| {
+ top?: number;
+ right?: number;
+ }
+\| {
+ bottom?: number;
+ left?: number;
+ }
+\| {
+ bottom?: number;
+ right?: number;
+ }` | `none` | `false` | Adds attribution offset, e.g. `{top: 8, left: 8}` will put attribution button in top-left corner of the map |
| tintColor | `string \| unknown[]` | `none` | `false` | MapView's tintColor |
| logoEnabled | `boolean` | `false` | `false` | Enable/Disable the logo on the map. |
-| logoPosition | `{top?: number, left?: number} \| {top?: number, right?: number} \| {bottom?: number, left?: number} \| {bottom?: number, right?: number}` | `none` | `false` | Adds logo offset, e.g. `{top: 8, left: 8}` will put the logo in top-left corner of the map |
+| logoPosition | `\| {
+ top?: number;
+ left?: number;
+ }
+\| {
+ top?: number;
+ right?: number;
+ }
+\| {
+ bottom?: number;
+ left?: number;
+ }
+\| {
+ bottom?: number;
+ right?: number;
+ }` | `none` | `false` | Adds logo offset, e.g. `{top: 8, left: 8}` will put the logo in top-left corner of the map |
| compassEnabled | `boolean` | `none` | `false` | Enable/Disable the compass from appearing on the map |
| compassViewPosition | `number` | `none` | `false` | Change corner of map the compass starts at. 0: TopLeft, 1: TopRight, 2: BottomLeft, 3: BottomRight |
| compassViewMargins | `object` | `none` | `false` | Add margins to the compass with x and y values |
diff --git a/example/ios/Podfile b/example/ios/Podfile
index 6259698e4..95e58b3c8 100644
--- a/example/ios/Podfile
+++ b/example/ios/Podfile
@@ -9,7 +9,7 @@ platform :ios, min_ios_version_supported
prepare_react_native_project!
-$RNMBGL_SPM_Spec = {
+$RCTMLN_SPM_Spec = {
url: "https://github.com/maplibre/maplibre-gl-native-distribution",
requirement: {
kind: "upToNextMajorVersion",
@@ -18,7 +18,7 @@ $RNMBGL_SPM_Spec = {
product_name: "MapLibre"
}
-# We ingore warning except for RNMBGL
+# We ingore warning except for RCTMLN
INHIBIT_WARNING_BY_DEFAULT = true
if INHIBIT_WARNING_BY_DEFAULT
@@ -86,14 +86,14 @@ target 'RNMaplibreExample' do
)
# This method has been removed in react native 0.73
# __apply_Xcode_12_5_M1_post_install_workaround(installer)
- $RNMBGL.post_install(installer)
+ $RCTMLN.post_install(installer)
end
else
# CI configuration
post_install do |installer|
react_native_post_install(installer)
#__apply_Xcode_12_5_M1_post_install_workaround(installer)
- $RNMBGL.post_install(installer)
+ $RCTMLN.post_install(installer)
end
end
end
diff --git a/ios/install.md b/ios/install.md
index cf2997985..40c4d42cb 100644
--- a/ios/install.md
+++ b/ios/install.md
@@ -8,7 +8,7 @@ Add the following to your `ios/Podfile`:
```ruby
post_install do |installer|
... other post install hooks
- $RNMBGL.post_install(installer)
+ $RCTMLN.post_install(installer)
end
```
@@ -31,7 +31,6 @@ environments. The map either does not render at all or appears garbled when pann
It is best to test on a real device if at all possible at this time
until this is fixed upstream. iOS devs can open the workspace in Xcode and run from there.
-
## Installing a specific version
The current default MapLibre version is `6.4.0`.
@@ -39,7 +38,7 @@ If you want to install a different version, you can override as follows in
your `Podfile`:
```ruby
-$RNMBGL_Use_SPM = {
+$RCTMLN_Use_SPM = {
url: "https://github.com/maplibre/maplibre-gl-native-distribution",
requirement: {
kind: "upToNextMajorVersion",
diff --git a/maplibre-react-native.podspec b/maplibre-react-native.podspec
index 78af7a360..e1880dd42 100644
--- a/maplibre-react-native.podspec
+++ b/maplibre-react-native.podspec
@@ -2,9 +2,9 @@ require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
-$RNMBGL = Object.new
+$RCTMLN = Object.new
-def $RNMBGL._add_spm_to_target(project, target, url, requirement, product_name)
+def $RCTMLN._add_spm_to_target(project, target, url, requirement, product_name)
pkg_class = Xcodeproj::Project::Object::XCRemoteSwiftPackageReference
ref_class = Xcodeproj::Project::Object::XCSwiftPackageProductDependency
pkg = project.root_object.package_references.find { |p| p.class == pkg_class && p.repositoryURL == url }
@@ -23,7 +23,7 @@ def $RNMBGL._add_spm_to_target(project, target, url, requirement, product_name)
end
end
-def $RNMBGL.post_install(installer)
+def $RCTMLN.post_install(installer)
spm_spec = {
url: "https://github.com/maplibre/maplibre-gl-native-distribution",
requirement: {
@@ -33,8 +33,8 @@ def $RNMBGL.post_install(installer)
product_name: "MapLibre"
}
- if $RNMBGL_SPM_Spec.is_a?(Hash)
- spm_spec = $RNMBGL_SPM_Spec
+ if $RCTMLN_SPM_Spec.is_a?(Hash)
+ spm_spec = $RCTMLN_SPM_Spec
end
project = installer.pods_project
self._add_spm_to_target(
diff --git a/plugin/src/__tests__/__snapshots__/withMapLibre-test.ts.snap b/plugin/src/__tests__/__snapshots__/withMapLibre-test.ts.snap
index 2f2e10bf7..8e3521b8c 100644
--- a/plugin/src/__tests__/__snapshots__/withMapLibre-test.ts.snap
+++ b/plugin/src/__tests__/__snapshots__/withMapLibre-test.ts.snap
@@ -14,8 +14,8 @@ target 'HelloWorld' do
# @generated begin post_installer - expo prebuild (DO NOT MODIFY) sync-4092f82b887b5b9edb84642c2a56984d69b9a403
post_install do |installer|
-# @generated begin @maplibre/maplibre-react-native-post_installer - expo prebuild (DO NOT MODIFY) sync-88648fec2f0169e784fba60266091187f7753f15
- $RNMBGL.post_install(installer)
+# @generated begin @maplibre/maplibre-react-native-post_installer - expo prebuild (DO NOT MODIFY) sync-72b8976cc2231a4441a5b54389fb6e10bd42a1be
+ $RCTMLN.post_install(installer)
# @generated end @maplibre/maplibre-react-native-post_installer
end
# @generated end post_installer
@@ -47,8 +47,8 @@ target 'HelloWorld' do
# @generated begin post_installer - expo prebuild (DO NOT MODIFY) sync-4092f82b887b5b9edb84642c2a56984d69b9a403
post_install do |installer|
-# @generated begin @maplibre/maplibre-react-native-post_installer - expo prebuild (DO NOT MODIFY) sync-88648fec2f0169e784fba60266091187f7753f15
- $RNMBGL.post_install(installer)
+# @generated begin @maplibre/maplibre-react-native-post_installer - expo prebuild (DO NOT MODIFY) sync-72b8976cc2231a4441a5b54389fb6e10bd42a1be
+ $RCTMLN.post_install(installer)
# @generated end @maplibre/maplibre-react-native-post_installer
end
# @generated end post_installer
@@ -97,8 +97,8 @@ target 'HelloWorld' do
use_flipper!()
post_install do |installer|
-# @generated begin @maplibre/maplibre-react-native-post_installer - expo prebuild (DO NOT MODIFY) sync-88648fec2f0169e784fba60266091187f7753f15
- $RNMBGL.post_install(installer)
+# @generated begin @maplibre/maplibre-react-native-post_installer - expo prebuild (DO NOT MODIFY) sync-72b8976cc2231a4441a5b54389fb6e10bd42a1be
+ $RCTMLN.post_install(installer)
# @generated end @maplibre/maplibre-react-native-post_installer
react_native_post_install(installer)
end
@@ -125,8 +125,8 @@ target 'HelloWorld' do
# if !ENV['CI']
# use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')
# post_install do |installer|
-# @generated begin @maplibre/maplibre-react-native-post_installer - expo prebuild (DO NOT MODIFY) sync-88648fec2f0169e784fba60266091187f7753f15
- $RNMBGL.post_install(installer)
+# @generated begin @maplibre/maplibre-react-native-post_installer - expo prebuild (DO NOT MODIFY) sync-72b8976cc2231a4441a5b54389fb6e10bd42a1be
+ $RCTMLN.post_install(installer)
# @generated end @maplibre/maplibre-react-native-post_installer
# flipper_post_install(installer)
# end
@@ -135,7 +135,7 @@ target 'HelloWorld' do
# @generated begin pre_installer - expo prebuild (DO NOT MODIFY) sync-00old-id
INVALID_pre_install do |installer|
# @generated begin @react-native-mapbox-gl/maps-pre_installer - expo prebuild (DO NOT MODIFY) sync-00
- INVALID_$RNMBGL.pre_install(installer)
+ INVALID_$RCTMLN.pre_install(installer)
# @generated end @react-native-mapbox-gl/maps-pre_installer
end
# @generated end pre_installer
@@ -165,14 +165,14 @@ target 'HelloWorld' do
# @generated begin pre_installer - expo prebuild (DO NOT MODIFY) sync-00old-id
INVALID_pre_install do |installer|
# @generated begin @react-native-mapbox-gl/maps-pre_installer - expo prebuild (DO NOT MODIFY) sync-00
- INVALID_$RNMBGL.pre_install(installer)
+ INVALID_$RCTMLN.pre_install(installer)
# @generated end @react-native-mapbox-gl/maps-pre_installer
end
# @generated end pre_installer
# @generated begin post_installer - expo prebuild (DO NOT MODIFY) sync-4092f82b887b5b9edb84642c2a56984d69b9a403
post_install do |installer|
-# @generated begin @maplibre/maplibre-react-native-post_installer - expo prebuild (DO NOT MODIFY) sync-88648fec2f0169e784fba60266091187f7753f15
- $RNMBGL.post_install(installer)
+# @generated begin @maplibre/maplibre-react-native-post_installer - expo prebuild (DO NOT MODIFY) sync-72b8976cc2231a4441a5b54389fb6e10bd42a1be
+ $RCTMLN.post_install(installer)
# @generated end @maplibre/maplibre-react-native-post_installer
end
# @generated end post_installer
diff --git a/plugin/src/__tests__/fixtures/cocoapodFiles.ts b/plugin/src/__tests__/fixtures/cocoapodFiles.ts
index c50f17102..74d77bbd5 100644
--- a/plugin/src/__tests__/fixtures/cocoapodFiles.ts
+++ b/plugin/src/__tests__/fixtures/cocoapodFiles.ts
@@ -96,14 +96,14 @@ target 'HelloWorld' do
# @generated begin pre_installer - expo prebuild (DO NOT MODIFY) sync-00old-id
INVALID_pre_install do |installer|
# @generated begin @react-native-mapbox-gl/maps-pre_installer - expo prebuild (DO NOT MODIFY) sync-00
- INVALID_$RNMBGL.pre_install(installer)
+ INVALID_$RCTMLN.pre_install(installer)
# @generated end @react-native-mapbox-gl/maps-pre_installer
end
# @generated end pre_installer
# @generated begin post_installer - expo prebuild (DO NOT MODIFY) sync-00old-id-2
INVALID_post_install do |installer|
# @generated begin @react-native-mapbox-gl/maps-post_installer - expo prebuild (DO NOT MODIFY) sync-001
- INVALID_$RNMBGL.post_install(installer)
+ INVALID_$RCTMLN.post_install(installer)
# @generated end @react-native-mapbox-gl/maps-post_installer
end
# @generated end post_installer
@@ -148,14 +148,14 @@ target 'HelloWorld' do
# @generated begin pre_installer - expo prebuild (DO NOT MODIFY) sync-00old-id
INVALID_pre_install do |installer|
# @generated begin @react-native-mapbox-gl/maps-pre_installer - expo prebuild (DO NOT MODIFY) sync-00
- INVALID_$RNMBGL.pre_install(installer)
+ INVALID_$RCTMLN.pre_install(installer)
# @generated end @react-native-mapbox-gl/maps-pre_installer
end
# @generated end pre_installer
# @generated begin post_installer - expo prebuild (DO NOT MODIFY) sync-00old-id-2
INVALID_post_install do |installer|
# @generated begin @react-native-mapbox-gl/maps-post_installer - expo prebuild (DO NOT MODIFY) sync-001
- INVALID_$RNMBGL.post_install(installer)
+ INVALID_$RCTMLN.post_install(installer)
# @generated end @react-native-mapbox-gl/maps-post_installer
end
# @generated end post_installer
diff --git a/plugin/src/withMapLibre.ts b/plugin/src/withMapLibre.ts
index fc5b2c217..f18053b99 100644
--- a/plugin/src/withMapLibre.ts
+++ b/plugin/src/withMapLibre.ts
@@ -102,7 +102,7 @@ export function addMapLibreInstallerBlock(
return mergeContents({
tag: `@maplibre/maplibre-react-native-${blockName}_installer`,
src,
- newSrc: ` $RNMBGL.${blockName}_install(installer)`,
+ newSrc: ` $RCTMLN.${blockName}_install(installer)`,
anchor: new RegExp(`${blockName}_install do \\|installer\\|`),
offset: 1,
comment: '#',
@@ -133,7 +133,7 @@ export function setExcludedArchitectures(project: XcodeProject): XcodeProject {
const withoutSignatures: ConfigPlugin = config => {
const shellScript = `if [ "$XCODE_VERSION_MAJOR" = "1500" ]; then
echo "Remove signature files (Xcode 15 workaround)";
- rm -rf "$CONFIGURATION_BUILD_DIR/Mapbox.xcframework-ios.signature";
+ rm -rf "$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature";
fi`;
return withXcodeProject(config, async config => {
const xcodeProject = config.modResults;