Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rnmapbox/maps

A Mapbox react native module for creating custom maps
https://github.com/rnmapbox/maps

expo map mapbox mapbox-gl-native maplibre react-native

Last synced: about 2 months ago
JSON representation

A Mapbox react native module for creating custom maps

Awesome Lists containing this project

README

        

# Getting Started

```shell
react-native init sample --version 0.60.5
cd sample
yarn add https://github.com/rnmapbox/maps#main --save

code android/build.gradle
```

```gradle
# add the following:
allprojects {
repositories {
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = 'mapbox'
// Use the secret token you stored in gradle.properties as the password
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
}
}
}
}
```

code android/app/build.gradle
```gradle
# add the following:
android {
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}
}
```

code android/build.gradle
```
buildscript {
ext {
...
RNMapboxMapsImpl = 'mapbox'
}
}
```

code ios/Podfile
```pod
# change these
$RNMapboxMapsImpl = 'mapbox'

platform :ios, min_ios_version_supported

...

...

pre_install do |installer|
$RNMapboxMaps.pre_install(installer)
end

post_install do |installer|
react_native_post_install(installer)
$RNMapboxMaps.post_install(installer)
end
```

```pod
# on RN 0.60 only:
# add modular_headers to `React-Core`
pod 'React-Core', :path => '../node_modules/react-native/React', modular_headers: true
```

iOS:

* Add `$(SDKROOT)/usr/lib/swift` to Library search paths.