Skip to content

Latest commit

 

History

History
106 lines (68 loc) · 2.23 KB

install.md

File metadata and controls

106 lines (68 loc) · 2.23 KB

iOS Installation

React-Native > 0.60.0

The following assumes, that you're using autolinking and installed

@react-native-mapbox-gl/maps via npm or yarn.


The following is required for every following setup

Add the following to your ios/Podfile:

  pre_install do |installer|
    $RNMBGL.pre_install(installer)
    ... other pre install hooks
  end
  post_install do |installer|
    $RNMBGL.post_install(installer)
    ... other post install hooks
  end

Running pod install will add Mapbox iOS SDK 5.8.0

# Go to the ios folder
cd ios

# Run Pod Install
pod install

You are good to go!

Read on if you want to edit your Mapbox version or flavor.


Mapbox Maps SDK

It is possible to set a custom version of the Mapbox SDK:

New version - since 8.1rc5

Add the following to you ios/Podfile:

$ReactNativeMapboxGLIOSVersion = '~> 6.1'

Check the current version of the SDK here.

Mapbox Maps SDK > v6.0.0

If you are using version v6.0.0 of the SDK or later, you will need to authorize your download of the Maps SDK with a secret access token with the DOWNLOADS:READ scope. This guide explains how to configure the secret token under section Configure your secret token.


Maplibre

MapLibre is an OSS fork of MapboxGL

Current default MapLibre version is 5.12.0

If you want to use that, simply add this to your ios/Podfile

$RNMBGL_Use_SPM = true

If you want to adjust/ edit your MapLibre version you can also pass a hash

Example overwrite within your ios/Podfile:

$RNMBGL_Use_SPM = {
  url: "https://github.com/maplibre/maplibre-gl-native-distribution",
  requirement: {
    kind: "upToNextMajorVersion",
    minimumVersion: "5.12.0"
  },
  product_name: "Mapbox"
}

React-Native < 0.60.0

Using CocoaPods without autolink

To install with CocoaPods, add the following to your Podfile:

  # Mapbox
  pod 'react-native-mapbox-gl', :path => '../node_modules/@react-native-mapbox-gl/maps'

Then run pod install and rebuild your project.