1.27.0 • Published 2 months ago

react-native-steerpath-smart-map v1.27.0

Weekly downloads
133
License
MIT
Repository
github
Last release
2 months ago

react-native-steerpath-smart-map

Getting started

$ npm install react-native-steerpath-smart-map --save

or

$ yarn add react-native-steerpath-smart-map

Example app

here

Mostly automatic installation

We only support Cocoapod linking for iOS at the moment

For iOS

In your ios/Podfile, add the following lines to the top it:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://bitbucket.org/nimbledevices/steerpath-mapbox-ios-podspec.git'
source 'https://bitbucket.org/nimbledevices/steerpath-smart-sdk-podspec.git'

Run:

$ pod install

For Android

In your android/app/build.gradle, add the following lines before the dependencies {} block:

repositories {
    // For Steerpath Smart Map SDK
    maven { url "https://android-sdk.steerpath.net" }
}

If you are using React-Native < 0.60: $ react-native link react-native-steerpath-smart-map

Run the example app

$ cd example
$ yarn install --force
$ cd ios
$ pod update
$ cd ..
$ react-native run-ios # for ios
$ react-native run-android # for android

Usage

import {
  SmartMapView,
  SmartMapManager,
} from "react-native-steerpath-smart-map";
const API_KEY = "...";

SmartMapManager.start(API_KEY);

<SmartMapView
  style={{ flex: 1 }}
  apiKey={API_KEY} // This is required only if you are using this component in the web
/>;

Using configuration file (optional)

General naming for the configuration file is steerpath_config.json. If your Smart SDK Api Key requires other naming, name your configuration file according to that. There are two options of how to use config file:

  1. Add configuration file to your react native project folder and use startWithConfig(iOS/Android) or start(web) method of SmartMapMananger. See config.js and App.tsx or App.web.tsx of our example application.

  2. Add a configuration file to your project. See platform specific instructions below.

Android:

Add configuration file to /src/main/assets folder of your Android project.

iOS

Add configuration file to your Xcode project and select your application target

Web

Add config file to your project and export it from there to the component where the SmartMapManager.start() is initialised. You can pass the config file as the second parameter to the start() method as a string. Below is the TypeScript snippet from the example project:

(SmartMapManager as { start: (apiKey: string, config: Record<string, unknown>) => void }).start(
  API_KEY,
  JSON.parse(CONFIG_STRING),
);

Using offline bundle (Optional)

OfflineBundle (.sff) is a package containing indoor map tiles, (world tiles excluded), map style, routing data, positioning data and map object meta data. With OfflineBundle, maps & indoor positioning works without network connection.

Android

Steps to enable OfflineBundle

  1. Copy provided .sff file into your application project's /assets folder
  2. Add following flag to your app's Manifest.xml:
<meta-data android:name="SP_OFFLINE_DATA" android:value="theNameOfYourOffineBundle.sff"/>

iOS

The offline bundle should have “.sff” extension. Rename it to “sp_offline_data.sff” and drag it to your Xcode project. Select “Copy items if needed” and select your application target.

The default offline data file name is “sp_offline_data.sff”. If you want to use a custom name, you can add the following key to your application’s Info.plist (Please make sure that the offline data file name matches):

<key>SP_OFFLINE_DATA</key>
<string>sp_offline_data.sff</string>

iOS trouble shooting

  • For the error whe doing pod install on /example folder
Error

Errno::ENOENT - No such file or directory @ realpath_rec - .../react-native-steerpath-smartmap/example/node_modules/react-native-steerpath-smart-map/node_modules

Run cd example && yarn add react-native-steerpath-smart-map --force --ignore-scripts. The node_modules should re-appear

Web

Using the offline bundle with react-native-steerpath-smartmap package on web platform is not yet supported. You can use the example of Steerpath Core SDK found in the Offline bundle ./style folder to view maps.

Documentation

For Steerpath Developer

Publishing a new version:

  • For development

For the first time: Run yarn install && yarn build in the root project, then go to example and run yarn install again.

Everytime making changes in the root project, run yarn build again and go to example project and yarn add react-native-steerpath-smart-map --force to see the changes in the example project. Make any changes to the example project if necessary.

  • For releasing

Run the Typescript compiler and then npm publish:

$ yarn build
$ yarn publish
1.27.0

2 months ago

1.26.1

2 months ago

1.25.0

6 months ago

1.25.1

6 months ago

1.25.2

6 months ago

1.25.3

5 months ago

1.26.0

5 months ago

1.23.2

11 months ago

1.23.0

12 months ago

1.23.1

12 months ago

1.24.0

11 months ago

1.18.0

1 year ago

1.21.0

1 year ago

1.19.0

1 year ago

1.19.2

1 year ago

1.19.1

1 year ago

1.22.0

1 year ago

1.22.1

1 year ago

1.20.0

1 year ago

1.17.2

2 years ago

1.17.1

2 years ago

1.17.6

1 year ago

1.17.5

1 year ago

1.17.4

2 years ago

1.17.3

2 years ago

1.17.8

1 year ago

1.17.7

1 year ago

1.16.7

2 years ago

1.16.6

2 years ago

1.17.0

2 years ago

1.15.5

2 years ago

1.16.3

2 years ago

1.16.2

2 years ago

1.16.1

2 years ago

1.16.0

2 years ago

1.16.5

2 years ago

1.16.4

2 years ago

1.15.4

2 years ago

1.15.0

2 years ago

1.15.3

2 years ago

1.15.2

2 years ago

1.15.1

2 years ago

1.14.1

2 years ago

1.14.0

2 years ago

1.14.2

2 years ago

1.12.12

2 years ago

1.13.1

2 years ago

1.13.0

2 years ago

1.12.9

3 years ago

1.12.10

2 years ago

1.12.11

2 years ago

1.12.8

3 years ago

1.12.7

3 years ago

1.12.6

3 years ago

1.12.5

3 years ago

1.12.4

3 years ago

1.12.3

3 years ago

1.12.2

3 years ago

1.12.1

3 years ago

1.12.0

3 years ago

1.11.0

3 years ago

1.10.0

3 years ago

1.9.2

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.78

4 years ago

1.0.77

4 years ago

1.0.76

4 years ago

1.0.75

4 years ago

1.0.74

4 years ago

1.0.73

4 years ago

1.0.72

4 years ago

1.0.71

4 years ago

1.0.70

4 years ago

1.0.69

4 years ago

1.0.68

4 years ago

1.0.67

4 years ago

1.0.66

4 years ago

1.0.65

4 years ago

1.0.64

4 years ago

1.0.63

4 years ago

1.0.62

4 years ago

1.0.61

4 years ago

1.0.60

4 years ago

1.0.59

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.55

4 years ago

1.0.54

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.51

4 years ago

1.0.50

4 years ago

1.0.49

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.45

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago