mmi_rest v0.0.8
Mapmyindia REST API SDK for React Native - beta
Easy To Integrate Maps & Location APIs & SDKs For Web & Mobile Applications
Powered with India's most comprehensive and robust mapping functionalities. Now Available for Srilanka, Nepal, Bhutan and Bangladesh
- For full documentation contact MapmyIndia here: Email: apisupport@mapmyindia.com.
- You can get your api key to be used in this document here: https://www.mapmyindia.com/api/signup
- The beta code is provided to help you understand the basic functionality of MapmyIndia REST APIs working on React Native development platform.
Version History
Version | Last Updated | Author |
---|---|---|
0.0.8 | March 2019 | MapmyIndia API Team (BM) |
What is Mapmyindia?
Mapmyindia is the location data platform for mobile and web applications. We provide building blocks to add location features like maps, search, and navigation into any experience you create. Use our simple and powerful APIs & SDKs for interactivity and control.
Sign up for Mapmyindia
Not a Mapmyindia user yet? Sign up for an account here. Once you’re signed in, all you need to start building is a Mapmyindia key. Use this same short code with all of our interactive mapping libraries, JavaScript SDKs, and directly against our REST APIs. You can create and manage your access tokens on your Mapmyindia Account page.
API Usage
Your MapmyIndia Maps SDK usage needs a set of license keys (get them here ) and is governed by the API terms and conditions. As part of the terms and conditions, you cannot remove or hide the MapmyIndia logo and copyright information in your project. Please see branding guidelines on MapmyIndia website for more details. The allowed SDK hits are described on the plans page. Note that your usage is shared between platforms, so the API hits you make from a web application, Android app or an iOS app all add up to your allowed daily limit.
mapmyindia-restapi-react-native-beta
Getting started
$ npm install mapmyindia-restapi-react-native-beta --save
Mostly automatic installation
$ react-native link mapmyindia-restapi-react-native-beta
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜mapmyindia-restapi-react-native-beta
and addRNRestapi.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNRestapi.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.restapi.reactnative.RNRestapiPackage;
to the imports at the top of the file - Add
new RNRestapiPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':mapmyindia-restapi-react-native-beta' project(':mapmyindia-restapi-react-native-beta').projectDir = new File(rootProject.projectDir, '../node_modules/mapmyindia-restapi-react-native-beta/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':mapmyindia-restapi-react-native-beta')
Usage
import Mapmyindia from 'mapmyindia-restapi-react-native-beta';
Methods
Mapmyindia.setRestApiKey('RestApiKey');
Mapmyindia.setClientId('AtlasClietId');
Mapmyindia.setClientSecret('AtlasClientSecret');
- Place Details
- Route
- Distance
- Atlas AutoSuggest
- Atlas NearBy
- RevGeocoding
- Atlas Geocoding
- Route Advance
- Route ETA
- Distance Matrix
- Distance Matrix ETA
Place Details()
arguments
Name | Required |
---|---|
eloc | Yes |
successCallback | Yes |
Mapmyindia.placeDetails({eloc: 'MMI000'}, (response) => {
alert(JSON.stringify(response));
});
Route()
arguments
Name | Required |
---|---|
source | Yes |
destination | Yes |
alternatives | No |
rtype | No |
vtype | No |
avoids | No |
with_advices | No |
with_traffics | No |
viapoints | No |
successCallback | Yes |
Mapmyindia.route({source: '28.111,77.111', destination: '28.22,77.22'}, (response) => {
alert(JSON.stringify(response));
});
Distance()
arguments
Name | Required |
---|---|
center | Yes |
pts | Yes |
rtype | No |
vtype | No |
avoids | No |
with_traffics | No |
successCallback | Yes |
Mapmyindia.distance({center: '27.61234,77.61234', pts:'29,78|30,78|28,79'}, (response) => {
alert(JSON.stringify(response));
});
Atlas AutoSuggest()
arguments
Name | Required |
---|---|
query | Yes |
successCallback | Yes |
Mapmyindia.atlas_auto({query: 'agr'}, (response) => {
alert(JSON.stringify(response));
});
Atlas NearBy()
arguments
Name | Required |
---|---|
keywords | Yes |
refLocation | Yes |
successCallback | Yes |
Mapmyindia.atlas_nearby({keywords: 'beer', refLocation: '28.631460,77.217423'}, (response) => {
alert(JSON.stringify(response));
});
RevGeocoding()
arguments
Name | Required |
---|---|
lat | Yes |
lng | Yes |
successCallback | Yes |
Mapmyindia.rev_geocode({lat: '27.61234', lng: '77.61234'}, (response) => {
alert(JSON.stringify(response));
});
Atlas Geocoding()
arguments
Name | Required |
---|---|
addr | Yes |
itemCount | Yes |
successCallback | Yes |
Mapmyindia.atlas_geocode({addr: 'lucknow',itemCount:'1'}, (response) => {
alert(JSON.stringify(response));
});
Route Advance()
arguments
Name | Required |
---|---|
source | Yes |
destination | Yes |
alternatives | No |
geometries | No |
overview | No |
steps | No |
exclude | No |
rtype | No |
bearings | No |
radiuses | No |
region | No |
advices | No |
successCallback | Yes |
Mapmyindia.route_adv({`source`: '28.111,77.111', destination: '28.22,77.22'}, (response) => {
alert(JSON.stringify(response));
});
Route ETA()
arguments
Name | Required |
---|---|
source | Yes |
destination | Yes |
alternatives | No |
geometries | No |
overview | No |
steps | No |
exclude | No |
rtype | No |
bearings | No |
radiuses | No |
region | No |
advices | No |
successCallback | Yes |
Mapmyindia.route_eta({`source`: '28.111,77.111', destination: '28.22,77.22'}, (response) => {
alert(JSON.stringify(response));
});
Distance Matrix()
arguments
Name | Required |
---|---|
source | Yes |
destinations | Yes |
region | No |
rtype | No |
successCallback | Yes |
Mapmyindia.distance_matrix(source:'90.33687,23.470314',destinations:'90.379249,23.497178;90.497009,23.546286'}, (response) => {
alert(JSON.stringify(response));
});
Distance Matrix ETA()
arguments
Name | Required |
---|---|
source | Yes |
destinations | Yes |
region | No |
rtype | No |
successCallback | Yes |
Mapmyindia.distance_matrix_eta(source:'90.33687,23.470314',destinations:'90.379249,23.497178;90.497009,23.546286'}, (response) => {
alert(JSON.stringify(response));
});
For any queries and support, please contact:
Email us at apisupport@mapmyindia.com
Stack Overflow Ask a question under the mapmyindia-api
Support Need support? contact us!
Blog Read about the latest updates & customer stories
© Copyright 2019. CE Info Systems Pvt. Ltd. All Rights Reserved. | Terms & Conditions mapbox-gl-native copyright (c) 2014-2019 Mapbox. Written with StackEdit by MapmyIndia.
4 years ago