react-native-mapbox-gl
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -0,1 +1,7 @@ | ||
#v2.1.0 | ||
* Adds support for `react-native@0.16.0` | ||
* [iOS] Adds event handler `onTap`. Fired when user taps screen. Returns lat,lng and xy screen coordinates | ||
* [iOS] Adds event handler `onLongPress`. Fired when user taps and holds screen for 1 second. Returns lat,lng and xy screen coordinates | ||
# v2.0.0 | ||
@@ -2,0 +8,0 @@ |
@@ -57,2 +57,8 @@ 'use strict'; | ||
}, | ||
_onTap(event: Event) { | ||
if (this.props.onTap) this.props.onTap(event.nativeEvent.src); | ||
}, | ||
_onLongPress(event: Event) { | ||
if (this.props.onLongPress) this.props.onLongPress(event.nativeEvent.src); | ||
}, | ||
propTypes: { | ||
@@ -126,3 +132,5 @@ showsUserLocation: React.PropTypes.bool, | ||
onRightAnnotationTapped={this._onRightAnnotationTapped} | ||
onUpdateUserLocation={this._onUpdateUserLocation} />; | ||
onUpdateUserLocation={this._onUpdateUserLocation} | ||
onTap={this._onTap} | ||
onLongPress={this._onLongPress} />; | ||
} | ||
@@ -129,0 +137,0 @@ }); |
@@ -30,2 +30,4 @@ # iOS API Docs | ||
| `onRightAnnotationTapped` | `{title: null, subtitle: null, latitude: 0, longitude: 0}` | Fired when user taps `rightCalloutAccessory` | ||
| `onTap` | `{latitude: 0, longitude: 0, screenCoordY, screenCoordX}` | Fired when the users taps the screen. | ||
| `onLongPress` | `{latitude: 0, longitude: 0, screenCoordY, screenCoordX}` | Fired when the user taps and holds screen for 1 second. | ||
@@ -32,0 +34,0 @@ |
@@ -82,2 +82,8 @@ 'use strict'; | ||
}, | ||
onTap(location) { | ||
console.log('tapped', location); | ||
}, | ||
onLongPress(location) { | ||
console.log('long pressed', location); | ||
}, | ||
render: function() { | ||
@@ -144,3 +150,5 @@ StatusBarIOS.setHidden(true); | ||
onRightAnnotationTapped={this.onRightAnnotationTapped} | ||
onUpdateUserLocation={this.onUpdateUserLocation} /> | ||
onUpdateUserLocation={this.onUpdateUserLocation} | ||
onTap={this.onTap} | ||
onLongPress={this.onLongPress} /> | ||
</View> | ||
@@ -147,0 +155,0 @@ ); |
# Installation Process | ||
Notes: | ||
* `react-native ^v0.4.3` is required | ||
## Use CocoaPods | ||
@@ -13,3 +9,3 @@ | ||
1. `npm install react-native-mapbox-gl --save` | ||
1. Add `pod 'RCTMapboxGL', :path => 'node_modules/react-native-mapbox-gl/ios'` to your `Podspec` file and re-run `pod install`. | ||
1. Add `pod 'RCTMapboxGL', :path => '../node_modules/react-native-mapbox-gl/ios'` to your `Podfile` file and re-run `pod install`. | ||
@@ -24,3 +20,3 @@ See also the react-native [0.13 release notes](https://github.com/facebook/react-native/releases/tag/v0.13.0) | ||
1. Select your project in the `Project navigator`. Click `Build Phases` then `Link Binary With Libraries`. Add `node_modules/react-native-mapbox-gl/ios/RCTMapboxGL/libRCTMapboxGL.a` ![](https://cldup.com/QWhL_SjobN.png) | ||
1. Select your project in the `Project navigator`. Click `Build Phases` then `Copy Bundle Resources`. Click the `+` button. When the modal appears, click `Add other`. Add `node_modules/ios/react-native-mapbox-gl/RCTMapboxGL/Mapbox.bundle`. ![](https://cldup.com/Oi7uHxc1Fd.png) | ||
1. Select your project in the `Project navigator`. Click `Build Phases` then `Copy Bundle Resources`. Click the `+` button. When the modal appears, click `Add other`. Add `node_modules/react-native-mapbox-gl/ios/RCTMapboxGL/Mapbox.bundle`. ![](https://cldup.com/Oi7uHxc1Fd.png) | ||
1. Just like in the last step, select your project in the `Project navigator`. Click `Build Phases` then `Copy Bundle Resources`. Click the `+` button. When the modal appears, click `Add other`. Add `node_modules/react-native-mapbox-gl/ios/RCTMapboxGL/Settings.bundle`. [More information on location metrics can be found here](https://www.mapbox.com/mapbox-gl-ios/#metrics_opt_out). | ||
@@ -27,0 +23,0 @@ 1. Add the following Cocoa framework dependencies to your target's Link Binary With Libraries build phase: |
{ | ||
"name": "react-native-mapbox-gl", | ||
"description": "A Mapbox GL react native module for creating custom maps", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"author": "Bobby Sudekum", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"scripts": { | ||
"preinstall": "./scripts/download-mapbox-gl-native-ios.sh 3.0.0-pre.10", | ||
"preinstall": "./scripts/download-mapbox-gl-native-ios.sh 3.0.0", | ||
"test": "eslint example.js index.ios.js index.android.js", | ||
@@ -28,0 +28,0 @@ "start": "node_modules/react-native/packager/packager.sh" |
@@ -7,2 +7,4 @@ # React Native Mapbox GL | ||
*Current version of `react-native-mapbox-gl@2.1.0` requires `react-native@0.16.0`* | ||
``` | ||
@@ -9,0 +11,0 @@ npm install react-native-mapbox-gl --save |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
86847430
79
1352
27
2