Skip to content

Commit fa676a8

Browse files
committed
chore: readme update
1 parent 588ad11 commit fa676a8

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

README.md

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,43 @@
11
<a href="https://www.mapbox.com">
2-
<img src="/screenshots/mapbox_logo.png" width="400"/>
2+
<img src="https://raw.githubusercontent.com/nativescript-community/ui-mapbox/master/screenshots/mapbox_logo.png" width="400"/>
33
</a>
44

55
# NativeScript Mapbox plugin
66

7-
[![NPM version][npm-image]][npm-url]
8-
[![Downloads][downloads-image]][npm-url]
9-
[![Twitter Follow][twitter-image]][twitter-url]
10-
11-
[build-status]:https://travis-ci.org/@nativescript-community/ui-mapbox.svg?branch=master
12-
[build-url]:https://travis-ci.org/@nativescript-community/ui-mapbox
13-
[npm-image]:http://img.shields.io/npm/v/nativescript-mapbox.svg
14-
[npm-url]:https://npmjs.org/package/nativescript-mapbox
15-
[downloads-image]:http://img.shields.io/npm/dm/nativescript-mapbox.svg
16-
[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social&label=Follow%20me
17-
[twitter-url]:https://twitter.com/eddyverbruggen
7+
[npm-image]:http://img.shields.io/npm/v/@nativescript-community/ui-mapbox.svg
8+
[npm-url]:https://npmjs.org/package/@nativescript-community/ui-mapbox
9+
[downloads-image]:http://img.shields.io/npm/dm/@nativescript-community/ui-mapbox.svg
1810

1911
Awesome native OpenGL-powered maps - by Mapbox
2012

2113
<img src="https://raw.githubusercontent.com/nativescript-community/ui-mapbox/master/screenshots/ios-demoapp-slice.png" width="375px" height="196px" />
2214

23-
> There is a NativeScript Core Modules bug under Android that causes random crashes on navigation. See ./demo-angular/README.md for a workaround.
24-
> https://github.com/NativeScript/NativeScript/issues/7954
25-
> https://github.com/NativeScript/NativeScript/issues/7867
15+
16+
# WARNING
17+
18+
As we switched to a community managed plugin we upgraded the version of the Mapbox SDKs. Though starting from iOS SDK 6.0 and android SDK 9.0 they need special handling for downloading the SDK:
19+
[iOS](https://docs.mapbox.com/ios/maps/overview/#configure-credentials)
20+
21+
[Android](https://docs.mapbox.com/android/maps/overview/#configure-credentials)
22+
23+
On android the plugin default to 8.x. You can change it by creating a `before-plugins.gradle` in `App_Resources/Android` with (showing current versions):
24+
```
25+
ext {
26+
okHttpVersion = "3.12.10"
27+
def mapboxVersion = "8.6.6"
28+
def mapboxTelemetryVersion = "6.1.0"
29+
def mapboxPluginsVersion = "v9"
30+
def mapboxAnnotationPluginVersion = "0.9.0"
31+
def mapboxGesturesVersion = "0.7.0"
32+
}
33+
34+
```
35+
36+
On iOS we dont force anything so it will get the latest one. If you want to change it create a `Podfile` in `App_Resources/iOS` with (see demo app):
37+
```
38+
pod 'Mapbox-iOS-SDK', '~> 5.1.1'
39+
```
40+
2641

2742
## Before you begin - Prerequisites
2843
You either need your own tile server such as the one provided by [openmaptiles.org](https://openmaptiles.org) or a Mapbox API access token (they have a 🆓 Starter plan!), so [sign up with Mapbox](https://www.mapbox.com/signup/).
@@ -33,7 +48,7 @@ You will also need to set up your development environment. Please refer to the [
3348
# Installation
3449

3550
```
36-
$ tns plugin install nativescript-mapbox
51+
$ tns plugin install @nativescript-community/ui-mapbox
3752
```
3853

3954
# DEMOS
@@ -112,7 +127,7 @@ A simple layout could look like this:
112127
Could be rendered by a definition like this:
113128

114129
```xml
115-
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:map="nativescript-mapbox" navigatingTo="navigatingTo">
130+
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:map="@nativescript-community/ui-mapbox" navigatingTo="navigatingTo">
116131
<StackLayout>
117132
<Label text="Nice map, huh!" class="title"/>
118133
<ContentView height="240" width="240">
@@ -135,7 +150,7 @@ Component:
135150

136151
```typescript
137152
import { registerElement } from "nativescript-angular/element-registry";
138-
registerElement("Mapbox", () => require("nativescript-mapbox").MapboxView);
153+
registerElement("Mapbox", () => require("@nativescript-community/ui-mapbox").MapboxView);
139154
```
140155

141156
View:
@@ -190,7 +205,7 @@ It allows you to interact with the map after it has been drawn to the page.
190205
Open `main-page.[js|ts]` and add this (see [`addMarkers`](#addmarkers) further below for the full marker API):
191206

192207
```js
193-
var mapbox = require("nativescript-mapbox");
208+
var mapbox = require("@nativescript-community/ui-mapbox");
194209

195210
function onMapReady(args) {
196211
// you can tap into the native MapView objects (MGLMapView for iOS and com.mapbox.mapboxsdk.maps.MapView for Android)
@@ -216,7 +231,7 @@ exports.onMapReady = onMapReady;
216231
### .. or want to set the viewport bounds?
217232

218233
```js
219-
var mapbox = require("nativescript-mapbox");
234+
var mapbox = require("@nativescript-community/ui-mapbox");
220235

221236
function onMapReady(args) {
222237
args.map.setViewport(
@@ -370,7 +385,7 @@ You can update the map style after you've loaded it.
370385
### addMarkers
371386

372387
```typescript
373-
import { MapboxMarker } from "nativescript-mapbox";
388+
import { MapboxMarker } from "@nativescript-community/ui-mapbox";
374389

375390
const firstMarker = <MapboxMarker>{ //cast as a MapboxMarker to pick up helper functions such as update()
376391
id: 2, // can be user in 'removeMarkers()'

0 commit comments

Comments
 (0)