0.0.8 • Published 4 years ago

mmi_rest v0.0.8

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
4 years ago

MapmyIndia APIs

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

  1. For full documentation contact MapmyIndia here: Email: apisupport@mapmyindia.com.
  2. You can get your api key to be used in this document here: https://www.mapmyindia.com/api/signup
  3. The beta code is provided to help you understand the basic functionality of MapmyIndia REST APIs working on React Native development platform.

Version History

VersionLast UpdatedAuthor
0.0.8March 2019MapmyIndia 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

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesmapmyindia-restapi-react-native-beta and add RNRestapi.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNRestapi.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. 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 the getPackages() method
  1. 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')
  2. 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
NameRequired
elocYes
successCallbackYes
Mapmyindia.placeDetails({eloc: 'MMI000'}, (response) => {
        alert(JSON.stringify(response));
});

Route()

arguments
NameRequired
sourceYes
destinationYes
alternativesNo
rtypeNo
vtypeNo
avoidsNo
with_advicesNo
with_trafficsNo
viapointsNo
successCallbackYes
Mapmyindia.route({source: '28.111,77.111', destination: '28.22,77.22'}, (response) => {
        alert(JSON.stringify(response));
});

Distance()

arguments
NameRequired
centerYes
ptsYes
rtypeNo
vtypeNo
avoidsNo
with_trafficsNo
successCallbackYes
Mapmyindia.distance({center: '27.61234,77.61234', pts:'29,78|30,78|28,79'}, (response) => {
        alert(JSON.stringify(response));
});

Atlas AutoSuggest()

arguments
NameRequired
queryYes
successCallbackYes
Mapmyindia.atlas_auto({query: 'agr'}, (response) => {
        alert(JSON.stringify(response));
});

Atlas NearBy()

arguments
NameRequired
keywordsYes
refLocationYes
successCallbackYes
Mapmyindia.atlas_nearby({keywords: 'beer', refLocation: '28.631460,77.217423'}, (response) => {
        alert(JSON.stringify(response));
});

RevGeocoding()

arguments
NameRequired
latYes
lngYes
successCallbackYes
Mapmyindia.rev_geocode({lat: '27.61234', lng: '77.61234'}, (response) => {
        alert(JSON.stringify(response));
});

Atlas Geocoding()

arguments
NameRequired
addrYes
itemCountYes
successCallbackYes
Mapmyindia.atlas_geocode({addr: 'lucknow',itemCount:'1'}, (response) => {
        alert(JSON.stringify(response));
});

Route Advance()

arguments
NameRequired
sourceYes
destinationYes
alternativesNo
geometriesNo
overviewNo
stepsNo
excludeNo
rtypeNo
bearingsNo
radiusesNo
regionNo
advicesNo
successCallbackYes
Mapmyindia.route_adv({`source`: '28.111,77.111', destination: '28.22,77.22'}, (response) => {
        alert(JSON.stringify(response));
});

Route ETA()

arguments
NameRequired
sourceYes
destinationYes
alternativesNo
geometriesNo
overviewNo
stepsNo
excludeNo
rtypeNo
bearingsNo
radiusesNo
regionNo
advicesNo
successCallbackYes
Mapmyindia.route_eta({`source`: '28.111,77.111', destination: '28.22,77.22'}, (response) => {
        alert(JSON.stringify(response));
});

Distance Matrix()

arguments
NameRequired
sourceYes
destinationsYes
regionNo
rtypeNo
successCallbackYes
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
NameRequired
sourceYes
destinationsYes
regionNo
rtypeNo
successCallbackYes
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 Email us at apisupport@mapmyindia.com

npm.io Stack Overflow Ask a question under the mapmyindia-api

npm.io Support Need support? contact us!

npm.io 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.