Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syarul/react-native-mapintent
A React Native map intent for Android. Allows to open Android Stock Map Application
https://github.com/syarul/react-native-mapintent
Last synced: 3 days ago
JSON representation
A React Native map intent for Android. Allows to open Android Stock Map Application
- Host: GitHub
- URL: https://github.com/syarul/react-native-mapintent
- Owner: syarul
- License: mit
- Created: 2015-10-23T01:22:56.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-08T10:52:22.000Z (almost 9 years ago)
- Last Synced: 2024-10-05T01:33:58.813Z (about 1 month ago)
- Language: Java
- Size: 6.84 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-mapintent
A React Native map intent for Android. Allows to open Android Stock Map Application.
### Installation
```bash
npm install --save react-native-mapintent
```### Add it to your android project
* In `android/setting.gradle`
```gradle
...
include ':RNMapIntent', ':app'
project(':RNMapIntent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mapintent')
```* In `android/app/build.gradle`
```gradle
...
dependencies {
...
compile project(':RNMapIntent')
}
```* register module (in MainActivity.java)
```java
import com.syarul.mapintent.RNMapIntentPackage; // <--- importpublic class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
......@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new RNMapIntentPackage()) // <------ add here
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null);
setContentView(mReactRootView);
}......
}
```## Example
MapIntent.open(latitude, longitude, label)
* **latitude:** *(string)* geolocation latitude value
* **longitude:** *(string)* geolocation longitude value
* **label:** *(string)* label on the geolocation point.```javascript
var MapIntent = require('react-native-mapintent');MapIntent.open('3.0820879','101.6364262', 'This is da place!!');
```
## LicenseMIT