Rest API's
- eLoc: the id or eLoc of the place whose details are required. The 6-digit alphanumeric
code for any location. (e.g. mmi000).
-
code : response code of api call
-
response : success callback of api call
-
error : error callback for api call
MapmyIndiaGL.RestApi.placeDetail({eLoc:"MMI000"})
.then(response => {
const data = JSON.parse(response);
})
.catch(error => console.log(error.code,error.message));
- eLoc: the id or eLoc of the place whose details are required. The 6-digit alphanumeric
code for any location. (e.g. mmi000).
-
code : response code of api call
-
response : success callback of api call
-
error : error callback for api call
MapmyIndiaGL.RestApi.placeDetailLegacy({eLoc:"MMI000"})
.then(response => {
const data = JSON.parse(response);
})
.catch(error => console.log(error.code,error.message));
-
query (string) e.g. Shoes, Coffee, Versace, Gucci, H&M, Adidas, Starbucks, B130 {POI, House Number, keyword, tag}
-
code : response code of api call
-
response : success callback of api call
-
error : error callback for api call
- location(Location)
e.g. location:{longitude:28.56,latitude:77.56}
-
zoom (double) = takes the zoom level of the current scope of the map (min: 4, max: 18).
-
tokenizeAddress (boolean) = provides the different address attributes in a structured object.
-
pod = it takes in the place type code which helps in restricting the results to certain chosen type.
Below mentioned are the codes for the pod -
-
MapmyIndiaGL.RestApi.AutoSuggestCriteria.POD_SUB_LOCALITY: Sublocality
-
MapmyIndiaGL.RestApi.AutoSuggestCriteria.POD_LOCALITY: Locality
-
MapmyIndiaGL.RestApi.AutoSuggestCriteria.POD_CITY: City
-
MapmyIndiaGL.RestApi.AutoSuggestCriteria.POD_VILLAGE: Village
-
MapmyIndiaGL.RestApi.AutoSuggestCriteria.POD_SUB_DISTRICT: Subdistrict
-
MapmyIndiaGL.RestApi.AutoSuggestCriteria.POD_DISTRICT: District
-
MapmyIndiaGL.RestApi.AutoSuggestCriteria.POD_STATE: State
-
MapmyIndiaGL.RestApi.AutoSuggestCriteria.POD_SUB_SUB_LOCALITY: Subsublocality
- filter = this parameter helps you restrict the result either by mentioning a bounded area or to certain eloc (6 digit code to any poi, locality, city, etc.), below mentioned are the both types -
a. filter = bounds: lat1, lng1; lat2, lng2 (latitude, longitude) {e.g. filter=bounds: 28.598882, 77.212407; 28.467375, 77.353513}
b. filter = cop: {eloc} (string) {e.g. filter=cop:YMCZ0J}
MapmyIndiaGL.RestApi.autoSuggest({query: "Delhi", pod:MapmyIndiaGL.RestApi.AutoSuggestCriteria.POD_CITY})
.then(response => {
const data = JSON.parse(response);
})
.catch(error => console.log(error.code,error.message));
-
keyword(String): performs search on the basis of provided keyword For eg: coffee, EV Charging Station etc
-
location(Location) e.g. location:{longitude:28.56,latitude:77.56}
-
code : response code of api call
-
response : success callback of api call
-
error : error callback for api call
-
sortBy(String)
: provides configured sorting operations for the client on cloud.Below are the available sorts:
-
MapmyIndiaGL.RestApi.NearbyCriteria.DISTANCE_ASCENDING
-
MapmyIndiaGL.RestApi.NearbyCriteria.DISTANCE_DESCENDING will sort the data on distance basis.
-
MapmyIndiaGL.RestApi.NearbyCriteria.NAME_ASCENDING
-
MapmyIndiaGL.RestApi.NearbyCriteria.NAME_DESCENDING will sort the data on alphabetically basis.
-
page (integer)
: provides number of the page to provide results from. -
radius(integer)
: provides the range of distance to search over(default: 1000, min: 500, max: 10000) -
bounds(String)
: Allows the developer to send in map bounds to provide a nearby search within the bounds. {e.g. (bounds("28.56812,77.240519;28.532790,77.290854")) -
pod (string)
: it takes in the place type code which helps in restricting the results to certain chosen type. Access to this parameter is controlled from the backend. This parameter if provided will override any values provided inkeywords
request param. Below mentioned are the codes for the pod
-
MapmyIndiaGL.RestApi.NearbyCriteria.POD_SUB_LOCALITY
-
MapmyIndiaGL.RestApi.NearbyCriteria.POD_LOCALITY
-
MapmyIndiaGL.RestApi.NearbyCriteria.POD_CITY
-
MapmyIndiaGL.RestApi.NearbyCriteria.POD_VILLAGE
-
filter(String)
: This parameter helps you get a specific type of EV charging Station
-
filter
= model:(string);brandId:(string);plugType:(string)
-
searchBy(String)
:
MapmyIndiaGL.RestApi.nearby({keyword: "Tea", location:'28.56,77,45'})
.then(response => {
const data = JSON.parse(response);
})
.catch(error => console.log(error.code,error.message));
-
latitude:(double) the latitude of the location for which the address is required.
-
longitude:(double) the longitude of the location for which address is required.
-
code : response code of api call
-
response : success callback of api call
-
error : error callback for api call
MapmyIndiaGL.RestApi.reverseGeocode({latitude: lat, longitude: lng})
.then(response => {
const data = JSON.parse(response);
})
.catch(error => console.log(error.code,error.message));
-
address(string) address to be geocoded e.g. 237 Okhla industrial estate phase 3 new delhi, delhi 110020
-
code : response code of api call
-
response : success callback of api call
-
error : error callback for api call
-
itemCount (integer): parameter can be set to get maximum number of result items from the API (default: 1).
-
bias : This parameter can be used to set Urban or Rural bias. A positive value sets the Urban bias and a negative value sets Rural bias. Allowed values are:
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.BIAS_DEFAULT: Default: (No bias)
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.BIAS_RURAL: Rural
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.BIAS_URBAN: Urban
Note: Currently Only for Android
- podFilter : This parameter can be used to set admin level restriction. The result will be either the given admin level or equivalent admin or higher in the hierarchy. No lower admin will be considered for geocoding. Allowed values are:
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_HOUSE_NUMBER : house number
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_HOUSE_NAME : house name
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_POINT_OF_INTEREST : point of interest
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_STREET : street
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_SUB_SUB_LOCALITY : sub sub locality
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_VILLAGE : village
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_SUB_LOCALITY : sub locality
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_SUB_DISTRICT : sub district
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_LOCALITY : locality
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_CITY : city
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_DISTRICT : district
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_PINCODE :pincode
-
MapmyIndiaGL.RestApi.GeoCodingCriteria.POD_STATE : state
Note: Currently Only for Android
- bound (string): This parameter can be used to set admin boundary, which means geocoding will be done within the given admin. The allowed admin bounds are Sub-District, District, City, State and Pincode. The parameter accepts the admin eLoc as value.
Note: Currently Only for Android
Note: Please note that podFilter & bound parameters are mutually exclusive. They cannot be used together in an API call.
MapmyIndiaGL.RestApi.geocode({address:'Agra'})
.then(response => {
const data = JSON.parse(response);
})
.catch(error => console.log(error.code,error.message));
-
origin:{string (longitude[double],latitude[double])}
-
destination: {string (longitude[double],latitude[double])}
-
code : response code of api call
-
response : success callback of api call
-
error : error callback for api call
- waypoints(Array): This parameter used to add waypoint to route. E.g.
waypoints:["77.67,28.56;77.69,28.89"]
-
profile(String)
: Below are the available profile:
-
MapmyIndiaGL.RestApi.DirectionsCriteria.PROFILE_DRIVING (Default):Meant for car routing
-
MapmyIndiaGL.RestApi.DirectionsCriteria.PROFILE_WALKING: Meant for pedestrian routing. Routing with this profile is restricted to route_adv only. region & rtype request parameters are not supported in pedestrian routing
-
MapmyIndiaGL.RestApi.DirectionsCriteria.PROFILE_BIKING:Meant for two-wheeler routing. Routing with this profile is restricted to route_adv only. region & rtype request parameters are not supported in two-wheeler routing.
-
MapmyIndiaGL.RestApi.DirectionsCriteria.PROFILE_TRUCKING:Meant for Truck routing. Routing with this profile is restricted to route_adv only. region & rtype request parameters are not supported in truck routing.
-
resource(String)
: Below are the available resource:
-
MapmyIndiaGL.RestApi.DirectionsCriteria.RESOURCE_ROUTE (Default): to calculate a route & its duration without considering traffic conditions.
-
MapmyIndiaGL.RestApi.DirectionsCriteria.RESOURCE_ROUTE_ETA get the updated duration of a route considering live traffic; Applicable for India only "region=ind" and "rtype=1" is not supported. This is different from route_traffic; since this doesn't search for a route considering traffic, it only applies delays to the default route.
-
MapmyIndiaGL.RestApi.DirectionsCriteria.RESOURCE_ROUTE_TRAFFIC:
to search for routes considering live traffic; Applicable for India only “region=ind” and “rtype=1” is not supported
-
steps(Boolean)
:Return route steps for each route leg. Possible values are true/false. By default it will be used as false. -
overView(String)
: Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. Below are the available value:
-
MapmyIndiaGL.RestApi.DirectionsCriteria.OVERVIEW_FULL
-
MapmyIndiaGL.RestApi.DirectionsCriteria.OVERVIEW_FALSE
-
MapmyIndiaGL.RestApi.DirectionsCriteria.OVERVIEW_SIMPLIFIED
-
excludes(String...)
: Additive list of road classes to avoid, order does not matter. Below are the available value:
-
MapmyIndiaGL.RestApi.DirectionsCriteria.EXCLUDE_FERRY
-
MapmyIndiaGL.RestApi.DirectionsCriteria.EXCLUDE_MOTORWAY
-
MapmyIndiaGL.RestApi.DirectionsCriteria.EXCLUDE_TOLL
-
alternatives(Boolean)
: Search for alternative routes. -
radiuses(double...)
: Limits the search to given radius in meters. For all way-points including start and end points. -
geometries(String)
: This parameter used to change the route geometry format/density (influences overview and per step).Below are the available value:
-
MapmyIndiaGL.RestApi.DirectionsCriteria.GEOMETRY_POLYLINE: with 5 digit precision
-
MapmyIndiaGL.RestApi.DirectionsCriteria.GEOMETRY_POLYLINE6 (Default): with 6 digit precision
MapmyIndiaGL.RestApi.direction({
origin:'77.56,28.56',
destination:'78.54,28.78',
profile: MapmyIndiaGL.RestApi.DirectionsCriteria.PROFILE_DRIVING,
overview: MapmyIndiaGL.RestApi.DirectionsCriteria.OVERVIEW_FULL,
})
.then(response => {
const data = JSON.parse(response);
})
.catch(error => console.log(error.code,error.message));
-
coordinates:A array of coordinates which define the points to perform the matrix.
-
code : response code of api call
-
response : success callback of api call
-
error : error callback for api call
-
profile(String)
: Only supports MapmyIndiaGL.RestApi.DirectionsCriteria.PROFILE_DRIVING. -
resource(Strng)
: Below are the available value:
-
MapmyIndiaGL.RestApi.DirectionsCriteria.RESOURCE_DISTANCE (Default): to calculate the route & duration without considering traffic conditions.
-
MapmyIndiaGL.RestApi.DirectionsCriteria.RESOURCE_DISTANCE_ETA: to get the updated duration considering live traffic; Applicable for India only “region=ind” and “rtype=1” is not supported. This is different from distance_matrix_traffic; since this doesn't search for a route considering traffic, it only applies delays to the default route.
-
MapmyIndiaGL.RestApi.DirectionsCriteria.RESOURCE_DISTANCE_TRAFFIC: to search for routes considering live traffic; Applicable for India only “region=ind” and “rtype=1” is not supported
MapmyIndiaGL.RestApi.distance({coordinates:['77.56,27.56','77.56,28.56']})
.then(response => {
const data = JSON.parse(response);
})
.catch(error => console.log(error.code,error.message));
-
category(String):The POI category code to be searched. Only one category input supported.
-
path(String): This parameter takes the encoded route along which POIs to be searched.
-
code : response code of api call
-
response : success callback of api call
-
error : error callback for api call
-
buffer(Integer)
: Buffer of the road. Minimum value is25
, maximum is1000
and default is25
. -
geometries(String)
: Type of geometry encoding.Below are the available geometries:
-
MapmyIndiaGL.RestApi.POICriteria.GEOMETRY_BASE64
-
MapmyIndiaGL.RestApi.POICriteria.GEOMETRY_POLYLINE6 (Default)
-
MapmyIndiaGL.RestApi.POICriteria.GEOMETRY_POLYLINE5
-
page(Integer)
: Used for pagination. By default, a request returns maximum10
results and to get the next10
or so on pass the page value accordingly. Default is 1. -
sort(Boolean)
: Gets the sorted POIs along route.
MapmyIndiaGL.RestApi.POIAlongRoute({category: 'category', path: 'path'})
.then(response => {
const data = JSON.parse(response);
})
.catch(error => console.log(error.code,error.message));
-
typedKeyword (String)
: The string that was searched. Must be 2 characters or more. -
eLoc (String)
: eLoc of the location that was selected. Must be exactly 6 characters. -
index (Integer)
: the index of the selected object that was returned from the search. -
userName (String)
: the username of the user that’s logged in. -
appVersion (String)
: the version of the app that was used to make the request. -
longitude (Double)
: the longitude of the location from where the search is made. The longitude must be a double value, must not start with 0. -
latitude (Double)
: the latitude of the location from where the search is made. The latitude must be a double value, must not start with 0 and must not be larger than the longitude. -
locationName (String )
: name of the location that was selected.
MapmyIndiaGL.RestApi.feedback({
typedKeyword:'',
eLoc:'',
index:0,
userName:'',
appVersion:'',
longitude:0.0,
latitude:0.0,
locationName:'',
})
.then(response => {
const data = JSON.parse(response);
})
.catch(error => console.log(error.code,error.message));
For any queries and support, please contact:
Email us at apisupport@mapmyindia.com
Ask a question under the mapmyindia-api
Need support? contact us!
Read about the latest updates & customer stories
© Copyright 2021. CE Info Systems Pvt. Ltd. All Rights Reserved. | Terms & Conditions
- Installation Guides
- Components
- Sources
- Layers
- Widgets
- Set MapmyIndia Style
- Rest Api's