android SDKs

Vector-based map data, provides mapping capabilities with features such as routing, navigation, historical traffic patterns

MapmyIndia Vector Map Android SDK

Getting Started

MapmyIndia Maps SDK for Android lets you easily add MapmyIndia Maps and web services to your own Android application. The SDK for Android supports API 14+. You can have a look at the map and features you will get in your own app by using the MapmyIndia Maps SDK for Android.

Through customized tiles, you can add different map layers to your application and add bunch of controls and gestures to enhance map usability thus creating potent map based solutions for your customers. The SDK handles downloading of map tiles and their display along with a bunch of controls and native gestures.

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.

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.

Setup your project

Follow these steps to add the SDK to your project –

  • Create a new project in Android Studio
  • Import MapmyIndiaGLAndroidSDK_v{version}.aar file in your project.
  • Add Following dependencies for the implementation
implementation 'com.jakewharton.timber:timber:4.5.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.google.android.gms:play-services-location:15.0.1'(New)
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:3.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-gestures:0.3.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-geojson:3.3.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-core:0.2.1'(New)

 
  • Add these permissions in your project
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" >
<uses-permission android:name="android.permission.INTERNET" >

Add your API keys to the SDK

Add your API keys to the SDK (in your application's onCreate() or before using map)

MapmyIndiaAccountManager.getInstance().setRestAPIKey(getRestAPIKey()); 
MapmyIndiaAccountManager.getInstance().setMapSDKKey(getMapSDKKey());  
MapmyIndiaAccountManager.getInstance().setAtlasGrantType(getAtlasGrantType());  
MapmyIndiaAccountManager.getInstance().setAtlasClientId(getAtlasClientId());  
MapmyIndiaAccountManager.getInstance().setAtlasClientSecret(getAtlasClientSecret());  
MapmyIndia.getInstance(getApplicationContext());
MapmyIndiaAccountManager.getInstance().restAPIKey = getRestAPIKey()  
MapmyIndiaAccountManager.getInstance().mapSDKKey = getMapSDKKey()  
MapmyIndiaAccountManager.getInstance().atlasGrantType = getAtlasGrantType()  
MapmyIndiaAccountManager.getInstance().atlasClientId = getAtlasClientId()  
MapmyIndiaAccountManager.getInstance().atlasClientSecret = getAtlasClientSecret()
You cannot use the MapmyIndia Map Mobile SDK without these function calls. You will find your keys in your API Dashboard.

Add a MapmyIndia Map to your application

<com.mapbox.mapboxsdk.maps.MapView
android:id="@+id/mapView"
android:layout_width="match_parent" 
android:layout_height="match_parent"
/> 

NOTE: All the lifecycle methods that need to be overridden:

onCreate();
onStart();
onResume();
onPause();
onStop();
onSaveInstanceState();
onLowMemory();
onDestroy();

Map Interactions

The MapmyIndia Maps Android SDK allows you to define interactions that you can activate on the map to enable gestures and click events. The following interactions are supported –

Zoom Controls

The map supports the familiar two-finger pinch and zooms to change zoom level as well as double tap to zoom in. Set zoom to 4 for country level display and 18 for house number display. In this SDK the camera position plays an important role

And following operations can be performed using the CameraPosition

Target

The target is single latitude and longitude coordinate that the camera centers it on. Changing the camera's target will move the camera to the inputted coordinates. The target is a LatLng object. The target coordinate is always at the center of the viewport.

Tilt

Tilt is the camera's angle from the nadir (directly facing the Earth) and uses unit degrees. The camera's minimum (default) tilt is 0 degrees, and the maximum tilt is 60. Tilt levels use six decimal point of precision, which enables you to restrict/set/lock a map's bearing with extreme precision.

The map camera tilt can also adjust by placing two fingertips on the map and moving both fingers up and down in parallel at the same time or

Bearing

Bearing represents the direction that the camera is pointing in and measured in degrees clockwise from north.

The camera's default bearing is 0 degrees (i.e. "true north") causing the map compass to hide until the camera bearing becomes a non-zero value. Bearing levels use six decimal point precision, which enables you to restrict/set/lock a map's bearing with extreme precision. In addition to programmatically adjusting the camera bearing, the user can place two fingertips on the map and rotate their fingers.

Zoom

Zoom controls the scale of the map and consumes any value between 0 and 22. At zoom level 0, the viewport shows continents and other world features. A middle value of 11 will show city level details, and at a higher zoom level, the map will begin to show buildings and points of interest. The camera can zoom in the following ways:

  • Pinch motion two fingers to zoom in and out.
  • Quickly tap twice on the map with a single finger to zoom in.
  • Quickly tap twice on the map with a single finger and hold your finger down on the screen after the second tap.
  • Then slide the finger up to zoom out and down to zoom out.
CameraPosition position = new CameraPosition.Builder()
.target(new LatLng(22.8978, 77.3245)) // Sets the new camera position
.zoom(14) // Sets the zoom to level 14
.tilt(45) // Set the camera tilt to 45 degrees
.build();

We can pass this camera positions to following functions

moveCamera()
easeCamera()
animateCamera()

Map Events

The SDK allows you to listen to certain events on the map. It sets a callback that is invoked when camera movement has started.

mapboxMap.setOnCameraMoveStartedListener(new MapboxMap.OnCameraMoveStartedListener() 
      {
private final String[] REASONS = {"REASON_API_GESTURE", "REASON_DEVELOPER_ANIMATION", 
"REASON_API_ANIMATION"
};
@Override
public void onCameraMoveStarted(int reason) {
String string = String.format(Locale.US,
"OnCameraMoveStarted: %s", REASONS[reason - 1])
Toast.makeText(MainActivity.this, string, Toast.LENGTH_LONG).show();
}
});

Sets a callback that is invoked when camera position changes.

mapboxMap.setOnCameraMoveListener(new MapboxMap.OnCameraMoveListener() 
      {
@Override
public void onCameraMove() {
Toast.makeText(MainActivity.this, "onCameraMove", Toast.LENGTH_LONG).show();
        }
});

It sets a callback that is invoked when camera movement was cancelled.

mapboxMap.setOnCameraMoveCancelListener(new MapboxMap.OnCameraMoveCanceledListener()
         { 
@Override
public void onCameraMoveCanceled() {
Toast.makeText(MainActivity.this, "onCameraMoveCanceled", Toast.LENGTH_LONG).show();
         }
});

It sets a callback that is invoked when camera movement has ended.

mapboxMap.setOnCameraIdleListener(new  MapboxMap.OnCameraIdleListener() 
         { 
@Override
public void onCameraIdle() {
Toast.makeText(MainActivity.this, "onCameraIdle", Toast.LENGTH_LONG).show();
         }
});

Map Click/Long Press

If you want to respond to a user tapping on a point on the map, you can use a MapEventsOverlay which you need to add on the map as an Overlay.

It sets a callback that's invoked when the user clicks on the map view.

mapboxMap.setOnMapClickListener(new MapboxMap.OnMapClickListener() {
@Override
public void onMapClick(@NonNull LatLng point)  {
String string = String.format(Locale.US, "User clicked at: %s", point.toString())
Toast.makeText(MainActivity.this, string, Toast.LENGTH_LONG).show();
      }
});

Sets a callback that's invoked when the user long clicks on the map view.

mapboxMap.setOnMapLongClickListener(new MapboxMap.OnMapLongClickListener() {
@Override
public void onMapLongClick(@NonNull LatLng point) {
String string = String.format(Locale.US, "User clicked at: %s", point.toString())
Toast.makeText(MainActivity.this, string, Toast.LENGTH_LONG).show();
	        }
});

Map Overlays

Add a marker

Add markers to the map by following these steps –

MarkerOptions  markerOptions =  new MarkerOptions().position(point).icon(icon);
Marker marker1 = map.addMarker(markerOptions);
markerOptions.setTitle("");
markerOptions.setSnippet("");

Remove a Marker

mapboxMap.removeMarker()

Customize a marker

MarkerOptions  markerOptions =  new MarkerOptions().position(point).icon(icon);
Marker marker = mapBoxMap.addMarker(markerOptions);
String tittle = “abc”;
marker.setTitle(tittle);
mapboxMap.setInfoWindowAdapter(new MapboxMap.InfoWindowAdapter() {
@Nullable
@Override
public View getInfoWindow(@NonNull Marker marker) {
View view = (context).getLayoutInflater()
.inflate(R.layout.layout, null);
TextView text = (TextView)view.findViewById(R.id.text);
text.setText(marker.getTitle());
return  view;
}
});

Add a Polyline

Draw polyline on the map

mapboxMap.addPolyline(new PolylineOptions()
.addAll(points)//list of LatLng
.color(Color.parseColor("#3bb2d0"))
.width(2));

Add a Polygon

Draw a polygon on the map

mapboxMap.addPolygon(new PolygonOptions()
.addAll(polygon)//list of LatLng
.fillColor(Color.parseColor("#3bb2d0")));

Show user location

Show the current user location

LocationComponentOptions options = LocationComponentOptions.builder(this)
.trackingGesturesManagement(true)
.accuracyColor(ContextCompat.getColor(this, R.color.colorAccent))
.build();
// Get an instance of the component
LocationComponent locationComponent = mapboxMap.getLocationComponent();
// Activate with options
locationComponent.activateLocationComponent(this, options);
// Enable to make component visible
locationComponent.setLocationComponentEnabled(true);
locationEngine = locationComponent.getLocationEngine();
locationEngine.addLocationEngineListener(this);
// Set the component's camera mode
locationComponent.setCameraMode(CameraMode.TRACKING);
locationComponent.setRenderMode(RenderMode.COMPASS);
@Override
public void onConnected() {
locationEngine.requestLocationUpdates();
}
@Override
public void onLocationChanged(Location location) {
mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
new LatLng(location.getLatitude(), location.getLongitude()), 16));
locationEngine.removeLocationEngineListener(this);
}
@Override
protected void onResume() {
super.onResume();
if (locationEngine != null) {
locationEngine.removeLocationEngineListener(this);
 locationEngine.addLocationEngineListener(this);
}
}
@Override
protected void onPause() {
 super.onPause();
if (locationEngine != null)
locationEngine.removeLocationEngineListener(this);
}
@Override
protected void onStop() {
super.onStop();
if (locationEngine != null) {
locationEngine.removeLocationEngineListener(this);
locationEngine.removeLocationUpdates();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
if (locationEngine != null) {
locationEngine.deactivate();
}

Proguard

# Retrofit 2 
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform 
# Platform used when running on RoboVM on iOS. Will not be used at runtime.
-dontnote retrofit2.Platform$IOS$MainThreadExecutor 
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8 
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes *Annotation*,Signature 
# Retain declared checked exceptions for use by a Proxy instance. 
 -keepattributes Exceptions 
# For using GSON @Expose annotation
-keepattributes *Annotation* 
# Gson specific classes 
-dontwarn sun.misc.** 
-dontwarn okio.** 
-dontwarn okhttp3.**
-keep class retrofit.** 
-keep class retrofit.** { *; } 
-keepclasseswithmembers class * { 
 @retrofit.http.* <methods>;
}

Check Demo application for more implementation details

REST APIs

Geocoding

The Geocoding API converts real addresses into these geographic coordinates (latitude/longitude) to be placed on a map, be it for any street, area, postal code, POI or a house number etc.

Class used for geocoding is MapmyIndiaGeoCoding. This class contains the static class Builder. Create the object of the MapmyIndiaGeocoding.Builder class, which contains the method setAddress() which takes the address parameter that we want to geocode

new MapmyIndiaGeocoding.Builder()  
.setAddress("ballia")  
.setItemCount(10)  
.build().enqueueCall(new Callback<PlaceResponse  
>() {  
@Override  
public  void  onResponse(Call<PlaceResponse> call, Response<PlaceResponse> response) {  
//get results by calling response.body().getResults()  
Timber.e(Gson().toJson(response.body())) }    
@Override  
public  void  onFailure(Call<PlaceResponse> call, Throwable t) {  
t.printStackTrace();  
}
});
MapmyIndiaGeocoding.Builder<MapmyIndiaGeocoding.Builder<*>>()  
.setAddress("ballia")  
.setItemCount(10)  
.build().enqueueCall(object : Callback<PlaceResponse> {  
override  fun  onResponse(call: Call<PlaceResponse>, response: Response<PlaceResponse>) {  
Timber.e(new Gson().toJson(response.body()))  
}
override  fun  onFailure(call: Call<PlaceResponse>, t: Throwable) {
t.printStackTrace() 
}
});
Request Parameters
  1. address(string) : address to be geocoded e.g. 237 Okhla industrial estate phase 3 new delhi, delhi 110020.
  2. itemCount (integer): parameter can be set to get maximum number of result items from the API (default: 1).
Response Codes {as HTTP response code}
Success:
  1. 200: To denote a successful API call.
  2. 204: To denote the API was a success but no results were found.
Client-Side Issues:
  1. 400: Bad Request, User made an error while creating a valid request.
  2. 401: Unauthorized, Developer’s key is not allowed to send a request with restricted parameters.
  3. 403: Forbidden, Developer’s key has hit its daily/hourly limit.
Server-Side Issues:
  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, during our maintenance break or server downtimes.
Response Messages (as HTTP response message)
  1. 200: Success.
  2. 204: No matches were found for the provided query.
  3. 400: Something’s just not right with the request.
  4. 401: Access Denied.
  5. 403: Services for this key has been suspended due to daily/hourly transactions limit
  6. 500: Something went wrong.
  7. 503: Maintenance Break.
On Response Parameters
  1. GeoCodeResponse(List): All the details regarding place.
GeoCode Response Result Parameters
  1. houseNumber(string): the houseNumber of the address/location
  2. houseName(string): houseName of the address/location
  3. poi(string): the point of interest or famous landmark nearby the location
  4. street(string): the street or road of the location
  5. subsubLocality(string): the subSubLocality of the location
  6. subLocality(string): the subLocality of the location
  7. locality(string): the locality of the location
  8. village(string): the village of the location
  9. subDistrict(string): the subDistrict of the location
  10. district(string): the district of the location
  11. city(string): the city of the location
  12. state(string): the state of the location
  13. pincode(string): the pincode of the location
  14. formattedAddress(string): the general protocol following address
  15. eloc(string): eloc of the particular location
  16. latitude(double): the latitude for the location.
  17. longitude(double): the longitude for the location.
  18. geocodeLevel(string): the best matched address component.

Reverse Geocode

The Reverse Geocoding API converts geographical coordinates (latitude/longitude) into the closest matching address. It provides real addresses along with nearest popular landmark for any such geo-positions on the map.

Class used for reverse geocoding is MapmyIndiaReverseGeoCode. This class contains the static class Builder. Create the object of the MapmyIndiaReverseGeoCode.Builder class, which contains the method setLocation() which takes the latitude and longitude parameters that you are going to reverse geocode.

**new MapmyIndiaReverseGeoCode.Builder()  
.setLocation(28,77)  
.build().enqueueCall(new Callback<PlaceResponse>() {  
@Override  
public  void  onResponse(Call<PlaceResponse> call, Response<PlaceResponse> response) {  
Timber.e(new Gson().toJson(response.body()));  
}   
@Override  
public  void  onFailure(Call<PlaceResponse> call, Throwable t) {  
t.printStackTrace(); 
}
});
MapmyIndiaReverseGeoCode.Builder<MapmyIndiaReverseGeoCode.Builder<*>>()  
.setLocation(28,77)  
.build().enqueueCall(object : Callback<PlaceResponse> {  
override  fun  onResponse(call: Call<PlaceResponse>, response: Response<PlaceResponse>) {  
Timber.e(Gson().toJson(response.body()))  
}   
override  fun  onFailure(call: Call<PlaceResponse>, t: Throwable) {
t.printStackTrace()    
}
});
Request Parameters

Location (latitude,longitude): the latitude and longitude of the location for which the address is required.

Response Codes {as HTTP response code}
Success:
  1. 200: To denote a successful API call.
  2. 204: To denote the API was a success but no results were found.
Client-Side Issues:
  1. 400: Bad Request, User made an error while creating a valid request.
  2. 401: Unauthorized, Developer’s key is not allowed to send a request with restricted parameters.
  3. 403: Forbidden, Developer’s key has hit its daily/hourly limit.
Server-Side Issues:
  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, during our maintenance break or server downtimes.
Response Messages (as HTTP response message)
  1. 200: Success.
  2. 204: No matches were found for the provided query.
  3. 400: Something’s just not right with the request.
  4. 401: Access Denied.
  5. 403: Services for this key has been suspended due to daily/hourly transactions limit.
  6. 500: Something went wrong.
  7. 503: Maintenance Break.
On Response Parameters
  1. responseCode(Long): Response codes of the api.
  2. version(String): Version of the Api.
  3. places(List): All the details regarding place.
Place Response Result Parameters
  1. houseNumber(String): the houseNumber of the address/location
  2. houseName(String): houseName of the address/location
  3. poi(String): the point of interest or famous landmark nearby the location
  4. street(String): the street or road of the location
  5. subsubLocality(String): the subSubLocality of the location
  6. subLocality(String): the subLocality of the location
  7. locality(String): the locality of the location
  8. village(String): the village of the location
  9. subDistrict(String): the subDistrict of the location
  10. district(String): the district of the location
  11. city(String): the city of the location
  12. state(String): the state of the location
  13. pincode(String): the pincode of the location
  14. formattedAddress(String): the general protocol following address
  15. lat(Double): the latitude for the location.
  16. lng(Double): the longitude for the location.
  17. area(String): the area of the location.

eLoc / Place Details

If you want to get details for an eLoc .mmi000. call functions as

new MapmyIndiaELoc.Builder()
  .setELoc("mmi000")
  .build().enqueueCall(new Callback<PlaceResponse>() {
           @Override
            public void onResponse(Call<PlaceResponse> call,
				    Response response) {
  //handle response
            }
            @Override
           public void onFailure(Call<PlaceResponse> call, Throwable t) {
               t.printStackTrace();
          }
      }); 
MapmyIndiaEloc.Builder<MapmyIndiaNearby.Builder<*>>()
        .setEloc("MMI000")
        .build()
        .enqueueCall(object : Callback<NearbyAtlasResponse> {
			override fun onResponse(call: Call<NearbyAtlasResponse>, 
 			response: Response<NearbyAtlasResponse>) {
            }}
            override fun onFailure(call: Call<NearbyAtlasResponse>, t: Throwable) {
               
            }
     });

Nearby

Nearby search, enables you to add discovery and search of nearby POIs by searching for a generic keyword used to describe a category of places or via the unique code assigned to that category.

Class used for search nearby places is MapmyIndiaNearby. This class contains the static class Builder. Create the object of the MapmyIndiaNearby.Builder class, which contains the method setLocation() which takes the latitude and longitude parameters around which you want to see nearby places, and another method setKeyword() which takes keyword parameter for category.

new MapmyIndiaNearby.Builder()  
 .setKeyword("Parking")  
 .setLocation(28,77)  
 .build()  
 .enqueueCall(new Callback<NearbyAtlasResponse>() {  
 @Override  
 public  void  onResponse(Call<NearbyAtlasResponse> call, Response<NearbyAtlasResponse> response) {  
 Timber.e(new Gson().toJson(response.body()));  
 }   
 @Override  
 public  void  onFailure(Call<NearbyAtlasResponse> call, Throwable t) {  
 t.printStackTrace(); 
    }
  });
MapmyIndiaNearby.Builder<MapmyIndiaNearby.Builder<*>>()  
.setLocation(28, 77)  
.setKeyword("Parking")  
.build()  
.enqueueCall(object : Callback<NearbyAtlasResponse> {  
override  fun  onResponse(call: Call<NearbyAtlasResponse>, response: Response<NearbyAtlasResponse>) {  
Timber.e(Gson().toJson(response.body()))  
}  
override  fun  onFailure(call: Call<NearbyAtlasResponse>, t: Throwable) {
t.printStackTrace()
}
});
Request Parameters

Please Note: The Restricted parameters are also optional.

Mandatory Parameters:
  1. keywords (string) e.g. FODCOF, Shoes, Coffee, Versace, Gucci, H&M, Adidas, Starbucks, B130 {POI, House Number, keyword, tag}
  2. refLocation {latitude [double],longitude[double]}: Provides the location around which the search will be performed. e.g. refLocation=28.454,77.435
Optional Parameters:
  1. page (integer): provides number of the page to provide results from.
  2. sort (string): provides configured sorting operations for the client on cloud. Below are the available sorts:
  3. NearbyCriteria.DISTANCE_ASCENDING NearbyCriteria.DISTANCE_DESCENDING will sort data in order of distance from the passed location (default).
  4. NearbyCriteria.NAME_ASCENDING NearbyCriteria.NAME_DESCENDING will sort the data on alphabetically bases.
  5. radius (integer): provides the range of distance to search over (default: 1000, min: 500, max: 10000).
  6. bounds (x1,y1;x2,y2): Allows the developer to send in map bounds to provide a nearby search of the geobounds. where x1,y1 are the lat lng of.
Response Codes {as HTTP response code}
Success:
  1. 200: To denote a successful API call. 204: To denote the API was a success but no results were found.
Client-Side Issues:
  1. 400: Bad Request, User made an error while creating a valid reques
  2. 401: Unauthorized, Developer’s key is not allowed to send a request with restricted parameters
  3. 403: Forbidden, Developer.s key has hit its daily/hourly limit
Server-Side Issues:
  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, please contact MapmyIndia
Response Messages (as HTTP response message)
  1. 200: Success.
  2. 204: No matches we.re found for the provided query.
  3. 400: Something.s just not right with the request.
  4. 401: Access Denied.
  5. 403: Services for this key has been suspended due to daily/hourly transactions limit.
  6. 500: Something went wrong.
  7. 503: Maintenance Break
On Response Parameters
  1. suggestedLocations(ArrayList): List of nearby places
NearbyAtlasResult Response Result Parameters
  1. avgRating(Double): Average rating of the location
  2. distance(Integer): provides the distance from the provided location bias in meters.
  3. eLoc(String): Place Id of the location 6-char alphanumeric.
  4. entryLatitude(Double): latitude of the entrance of the location.
  5. entryLongitude(Double): longitude of the entrance of the location.
  6. keywords( ArrayList): provides an array of matched keywords or codes.
  7. latitude(Double): Latitude of the location.
  8. longitude(Double): longitude of the location.
  9. placeAddress(String): Address of the location.
  10. placeImage(String): Image of the location.
  11. placeName(String): Name of the location.
  12. type(String): Type of location POI or Country or City.
  13. totalReviews(Integer): Total number of reviews of the location.
  14. addedByUserName(String): User name of the user who add the location.
  15. mobileNo(String): Mobile number for contact
  16. landlineNo(String): Email for contact.

Auto-Suggest

The Autosuggest helps users to complete queries faster by adding intelligent search capabilities to your iOS mobile app. It takes a human readable query such as place name, address or eLoc and returns a list of results.

Class used for auto suggest search is MapmyIndiaAutosuggest. This class contains the static class Builder. Create the object of the MapmyIndiaAutoSuggest. Builder class, which contains the metThod setQuery() which takes the query parameter to get the autosuggest search.

new MapmyIndiaAutosuggest.Builder<>()  
.setLocation(28,77)  
.setQuery("mmi000").build().enqueueCall(new Callback<AutoSuggestAtlasResponse>() {  
@Override  
public  void  onResponse(Call<AutoSuggestAtlasResponse> call, Response<AutoSuggestAtlasResponse> response) { 
Timber.e(new Gson().toJson(response.body()));  
}  
@Override  
public  void  onFailure(Call<AutoSuggestAtlasResponse> call, Throwable t) {  
t.printStackTrace();  
}
});
```json
MapmyIndiaAutosuggest.Builder<MapmyIndiaAutosuggest.Builder<*>>()  
.setLocation(28,77)  
.setQuery("mmi000").  
.build()  
.enqueueCall(object : Callback<AutoSuggestAtlasResponse> {  
override  fun  onResponse(call: Call<AutoSuggestAtlasResponse>, response: Response<AutoSuggestAtlasResponse>) {
Timber.e(Gson().toJson(response.body()))  
}  
override  fun  onFailure(call: Call<AutoSuggestAtlasResponse>, t: Throwable) {  
t.printStackTrace()    
}
}) 
Request Parameters

Please Note: The Restricted parameters are also optional.

Mandatory Parameters:

  1. query (String) e.g. Shoes, Coffee, Versace, Gucci, H&M, Adidas, Starbucks, B130 {POI, House Number, keyword, tag}

Optional Parameters:

  1. Location(Double,Double):
  2. zoom (double) = takes the zoom level of the current scope of the map (min: 4, max: 18).
  3. tokenizeAddress = provides the different address attributes in a structured object.
  4. pod (string) = 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
    • AutoSuggestCriteria.POD_SUB_LOCALITY
    • AutoSuggestCriteria.POD_LOCALITY
    • AutoSuggestCriteria.POD_CITY
    • AutoSuggestCriteria.POD_VILLAGE
    • AutoSuggestCriteria.POD_SUB_DISTRICT
    • AutoSuggestCriteria.POD_DISTRICT
    • AutoSuggestCriteria.POD_STATE
    • AutoSuggestCriteria.POD_SUB_SUB_LOCALITY
  5. 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:
    • filter = bounds: lat1, lng1; lat2, lng2 (latitude, longitude) {e.g. filter=bounds: 28.598882, 77.212407; 28.467375, 77.353513}
    • filter = cop: {eloc} (string) {e.g. filter=cop:YMCZ0J}
Response Codes {as HTTP response code}

Success:

  1. 200: To denote a successful API call.
  2. 204: To denote the API was a success but no results we.re found.

Client-Side Issues:

  1. 400: Bad Request, User made an error while creating a valid request
  2. 401: Unauthorized, Developer.s key is not allowed to send a request with restricted parameters
  3. 403: Forbidden, Developer.s key has hit its daily/hourly limit

Server-Side Issues:

  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, please contact MapmyIndia
Response Messages (as HTTP response message)
  1. 200: Success.
  2. 204: No matches we.re found for the provided query.
  3. 400: Something.s just not right with the request.
  4. 401: Access Denied.
  5. 403: Services for this key has been suspended due to daily/hourly transactions limit.
  6. 500: Something went wrong.
  7. 503: Maintenance Break
On Response Parameters
  1. suggestedLocations(ArrayList): A List of the suggested location
  2. userAddedLocations(ArrayList<ELocation): List of user added locations
  3. suggestedSearches(ArrayList): List of suggestion related to your search.
ELocation Response Result Parameters
  1. poiId(String): Place Id of the location 6-char alphanumeric.
  2. placeAddress(String): Address of the location.
  3. latitude(String): Latitude of the location.
  4. longitude(String): longitude of the location.
  5. type(String): type of location POI or Country or City
  6. placeName(String): Name of the location.
  7. user(String): Name of the user who add the place
  8. index(Integer): the order where this result should be placed
Suggested Search Atlas Response Result Parameters
  1. keyword (string): what the user typed in.
  2. Identifier (string): what did the API use for it to qualify it as a suggested search request
  3. location (string): the name of the location to which the nearby will run in context to.
  4. hyperlink (string): the ready-made link for the nearby API pre-initialized with all default parameters and location with code to search for.

Routing API

Routing and displaying driving directions on map, including instructions for navigation, distance to destination, traffic etc. are few of the most important parts of developing a map based application. This REST API calculates driving routes between specified locations including via points based on route calculation type(optimal or shortest). Supported region (countries) are India, Sri Lanka, Nepal, Bangladesh & Bhutan.

Class used for Routing is MapmyIndiaDirections. This class contains the static class Builder. Create the object of the MapmyIndiaDirections.Builder class, which contains the method origin() takes the origin point and the method destination() takes the destination point.

new MapmyIndiaDirections.Builder()  
.origin(Point.fromLngLat(77f,28f))  
.destination(Point.fromLngLat(77.23,28.1231))
.profile(DirectionsCriteria.PROFILE_DRIVING)
.steps(true)
.build().enqueueCall(new Callback<DirectionsResponse>() {  
@Override  
public  void  onResponse(Call<DirectionsResponse> call, Response<DirectionsResponse> response) {  
Timber.e(new Gson().toJson(response.body()));  
}  
@Override  
public  void  onFailure(Call<DirectionsResponse> call, Throwable t) {  
t.printStackTrace(); 
}
});
MapmyIndiaDirections.builder()  
.origin(Point.fromLngLat(77.0,28.0))  
.destination(Point.fromLngLat(77.23,28.1231))  
.profile(DirectionsCriteria.PROFILE_DRIVING)  
.steps(true)  
.build().enqueueCall(object : Callback<DirectionsResponse> {  
override  fun  onResponse(call: Call<DirectionsResponse>, response: Response<DirectionsResponse>) {  
Timber.e(Gson().toJson(response.body()))  
}  
override  fun  onFailure(call: Call<DirectionsResponse>, t: Throwable) {  
t.printStackTrace()       
}
})
Request Parameters
Origin (Point): Destination(Point): Profile(String):DirectionsCriteria.PROFILE_DRIVING_TRAFFIC or DirectionsCriteria.PROFILE_DRIVING Add Waypoint(Point): Alternatives(Boolean):
Response Codes {as HTTP response code}
Success: 200: To denote a successful API call. 204: To denote the API was a success but no results were found. Client-Side Issues:
  1. 400: Bad Request, User made an error while creating a valid request
  2. 401: Unauthorized, Developer.s key is not allowed to send a request with restricted parameters
  3. 403: Forbidden, Developer.s key has hit its daily/hourly limit
Server-Side Issues:
  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, please contact MapmyIndia
Response Messages (as HTTP response message)
  1. 200: To denote a successful API call.
  2. 204: DB Connection error.
  3. 400: Bad Request, User made an error while creating a valid request.
  4. 401: Unauthorized, Developer’s key is not allowed to send a request.
  5. 403: Forbidden, Developer’s key has hit its daily/hourly limit or IP or domain not white-listed.
  6. 404: HTTP not found
  7. 412: Precondition Failed, i.e. Mandatory parameter is missing
  8. 500: Internal Server Error, the request caused an error in our systems.
  9. 503: Service Unavailable, during our maintenance break or server down-times.
On Response Parameters
  1. code(Long): Response codes of the api.
  2. message (String) : A string containing the message API Directions response with an error occurred.
  3. routes (Array): An array of route objects, each having potentially multiple via points.
  4. waypoints (Results): Array of Waypoint objects representing all waypoints in order.
Routes Array List Parameters
  1. geometry (List): returns the whole geometry of the route as per given parameter ‘geometries’ default is encoded ‘polyline’ with 5 digit accuracy for positional coordinates.
  2. legs (List): The legs between the given waypoints, representing an array of routes between two waypoints.
Legs Array List Parameters
  1. Steps (List) : Return route steps for each route leg depending upon steps parameter.
Steps Array List Parameters
  1. textInstruction(String) : a text Instructions string
  2. distance (Double) : The distance of travel to the subsequent step, in float meters
  3. duration (Double) : The estimated travel time, in float number of seconds
  4. geometry(String) : The un-simplified geometry of the route segment, depends on the given geometries parameter.
  5. weight(Double) : Parameter for internal use only.
  6. name(String) : The name of the way along which travel proceeds.
  7. ref(String) : Highway numbers for the way, if available.
  8. mode(String) : signifies the mode of transportation; driving as default.
  9. Maneuver (StepManeuver) : A StepManeuver object representing a maneuver
    • location : A [longitude, latitude] pair describing the location of the turn.
    • bearing_before : The clockwise angle from true north to the direction of travel immediately before the maneuver.
    • bearing_after : The clockwise angle from true north to the direction of travel immediately after the maneuver.
    • modifier : An optional string indicating the direction change of the maneuver. To see the complete list of modifiers, please see article in wiki.
    • type : A string indicating the type of maneuver. New identifiers might be introduced without API change. Types unknown to the client should be handled like the ‘turn’ type, the existence of correct modifier values is guaranteed.
  10. rotaryName(String) : String with the rotary name.
  11. rotaryPronunciation (Sting) : String in IPA with the rotary name's pronunciation.

To decode points (pts)

List polyLine = LineString.fromPolyline(response.body().getResults().getTrips().get(0).getPts(),Constants.PRECISION_6).coordinates();
var polyLine = LineString.fromPolyline(response.body()!!.getResults().getTrips().get(0).getPts(), Constants.PRECISION_6).coordinates() as  List ;

Driving Distance Matrix API

The Driving Distance provides driving distance and estimated time to go from a start point to multiple destination points, based on recommended routes from MapmyIndia Maps and traffic flow conditions.

Class used for Driving Distance is MapmyIndiaDistanceMatrix. This class contains the static class Builder. Create the object of the MapmyIndiaDistanceMatrix.Builder class, which contains the method setCenter() which takes the point parameter which inserts the specified position at the beginning of the coordinates list and the method setCoordinates() which takes the list of coordinates for the direction services.

  ArrayList<Point> coordinates=new ArrayList<>();  
  coordinates.add(Point.fromLngLat(80.502113, 8.916787));
coordinates.add(Point.fromLngLat(28.5505073, 77.2689367));    
MapmyIndiaDirectionsMatrix.builder()  
.clientAppName("APP")  
.profile(DirectionsCriteria.PROFILE_DISTANCE_TRAFFIC)  
.coordinates(coordinates)  
.build().enqueueCall(new Callback<DistanceResponse>() {  
@Override  
public void onResponse(Call<DistanceResponse> call, Response<DistanceResponse> response) {  
Timber.e(new Gson().toJson(response.body()));  
}   
@Override  
public void onFailure(Call<DistanceResponse> call, Throwable t) {  
t.printStackTrace();
 }
});
val coordinates : ArrayList1<Point> = ArrayList1()  
coordinates.add(Point.fromLngLat(80.502113, 8.916787))  
coordinates.add(Point.fromLngLat(28.5505073, 77.2689367))   
MapmyIndiaDirectionsMatrix.builder()  
.clientAppName("APP")  
.profile(DirectionsCriteria.PROFILE_DISTANCE_TRAFFIC)  
.coordinates(coordinates)  
.build().enqueueCall(object : Callback<DistanceResponse> {  
override  fun  onResponse(call: Call<DistanceResponse>, response: Response<DistanceResponse>) {  
Timber.e(Gson().toJson(response.body()))  
}  
override  fun  onFailure(call: Call<DistanceResponse>, t: Throwable) {  
t.printStackTrace()              
}
})
Request Parameters
  1. Coordinates(List): A List full of {@link Point}s which define the points to perform the matrix first location being center location.
  2. Profile (String) : DirectionsCriteria.PROFILE_DRIVING_TRAFFIC or DirectionsCriteria.PROFILE_DRIVING.
Response Codes {as HTTP response code}
Success:
  1. 200: To denote a successful API call.
  2. 204: To denote the API was a success but no results were found.
Client-Side Issues:
  1. 400: Bad Request, User made an error while creating a valid request
  2. 401: Unauthorized, Developer’s key is not allowed to send a request with restricted parameters
  3. 403: Forbidden, Developer’s key has hit its daily/hourly limit
Server-Side Issues:
  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, please contact MapmyIndia
Response Messages (as HTTP response message)
  1. 200: To denote a successful API call.
  2. 204: DB Connection error.
  3. 400: Bad Request, User made an error while creating a valid request.
  4. 401: Unauthorized, Developer’s key is not allowed to send a request.
  5. 403: Forbidden, Developer’s key has hit its daily/hourly limit or IP or domain not white-listed.
  6. 404: HTTP not found
  7. 412: Precondition Failed, i.e. Mandatory parameter is missing
  8. 500: Internal Server Error, the request caused an error in our systems.
  9. 503: Service Unavailable, during our maintenance break or server down-times.
On Response Parameters
  1. responseCode(Long): Response codes of the api.
  2. version(String): Version of the Api.
  3. results(DistanceResults): Array of results, each consisting of the following parameters
Distance Response Result Parameters
  1. code : if the request was successful, code is ok.
  2. durations(List<Double[]>): Duration in seconds for source to source (default 0), 1st, 2nd, 3rd secondary locations... from source.

distances(List<Double[]>): Distance in meters for source to source (default 0), 1st, 2nd, 3rd secondary locations... from source.

Geocoding (legacy)

The Geocoding API converts real addresses into these geographic coordinates (latitude/longitude) to be placed on a map, be it for any street, area, postal code, POI or a house number etc.

Class used for geocoding is MapmyIndiaGeoCoding. This class contains the static class Builder. Create the object of the MapmyIndiaGeocoding.Builder class, which contains the method setAddress() which takes the address parameter that we want to geocode.

new MapmyIndiaGeocoding.Builder()  
.setAddress("ballia")  
.setItemCount(10)  
.build().enqueueCall(new Callback<PlaceResponse>() {  
@Override  
public  void  onResponse(Call<PlaceResponse> call, Response<PlaceResponse> response) {  
//get results by calling response.body().getResults()  
Timber.e(Gson().toJson(response.body())) }  
@Override  
public  void  onFailure(Call<PlaceResponse> call, Throwable t) {  
t.printStackTrace();  
      }
   });
MapmyIndiaGeocoding.Builder<MapmyIndiaGeocoding.Builder<*>>()  
.setAddress("ballia")  
.setItemCount(10)  
.build().enqueueCall(object : Callback<PlaceResponse> {  
override  fun  onResponse(call: Call<PlaceResponse>, response: Response<PlaceResponse>) {  
Timber.e(new Gson().toJson(response.body()))  
}   
override  fun  onFailure(call: Call<PlaceResponse>, t: Throwable) {
t.printStackTrace()
}
});
Request Parameters
  1. address(string) : address to be geocoded e.g. 237 Okhla industrial estate phase 3 new delhi, delhi 110020.
  2. itemCount (integer): parameter can be set to get maximum number of result items from the API (default: 1).
Response Codes {as HTTP response code}
Success:
  1. 200: To denote a successful API call.
  2. 204: To denote the API was a success but no results were found.
Client-Side Issues:
  1. 400: Bad Request, User made an error while creating a valid request.
  2. 401: Unauthorized, Developer’s key is not allowed to send a request with restricted parameters.
  3. 403: Forbidden, Developer’s key has hit its daily/hourly limit.
Server-Side Issues:
  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, during our maintenance break or server downtimes.
Response Messages (as HTTP response message)
  1. 200: Success.
  2. 204: No matches were found for the provided query.
  3. 400: Something’s just not right with the request.
  4. 401: Access Denied.
  5. 403: Services for this key has been suspended due to daily/hourly transactions limit
  6. 500: Something went wrong.
  7. 503: Maintenance Break.
On Response Parameters
  1. GeoCodeResponse(List): All the details regarding place.
GeoCode Response Result Parameters
  1. houseNumber(string): the houseNumber of the address/location
  2. houseName(string): houseName of the address/location
  3. poi(string): the point of interest or famous landmark nearby the location
  4. street(string): the street or road of the location
  5. subsubLocality(string): the subSubLocality of the location
  6. subLocality(string): the subLocality of the location
  7. locality(string): the locality of the location
  8. village(string): the village of the location
  9. subDistrict(string): the subDistrict of the location
  10. district(string): the district of the location
  11. city(string): the city of the location
  12. state(string): the state of the location
  13. pincode(string): the pincode of the location
  14. formattedAddress(string): the general protocol following address
  15. eloc(string): eloc of the particular location
  16. latitude(double): the latitude for the location.
  17. longitude(double): the longitude for the location.
  18. geocodeLevel(string): the best matched address component.

Driving Distance Matrix API (legacy)

The Driving Distance provides driving distance and estimated time to go from a start point to multiple destination points, based on recommended routes from MapmyIndia Maps and traffic flow conditions. Class used for Driving Distance is MapmyIndiaDistanceLegacy. This class contains the static class Builder. Create the object of the MapmyIndiaDistanceLegacy.

Builder class, which contains the method setCenter() which takes the point parameter which inserts the specified position at the beginning of the coordinates list and the method setCoordinates() which takes the list of coordinates for the direction services.

ArrayList<Point> coordinates=new ArrayList<>();   
coordinates.add(Point.fromLngLat(77.25,28.9231));  
new MapmyIndiaDistanceLegacy.Builder()  
.setCenter(Point.fromLngLat(77.23,28.1231))  
.setCoordinates(coordinates)  
.build().enqueueCall(new Callback<LegacyDistanceResponse>() {  
@Override  
public  void  onResponse(Call<LegacyDistanceResponse> call, Response<LegacyDistanceResponse> response) {  
Timber.e(new Gson().toJson(response.body()));  
}   
@Override  
public  void  onFailure(Call<LegacyDistanceResponse> call, Throwable t) {  
t.printStackTrace();
}
});
val coordinates = ArrayList()  
coordinates.add(Point.fromLngLat(77.25, 28.9231))  
MapmyIndiaDistanceLegacy.Builder()  
.setCenter(Point.fromLngLat(77.23, 28.1231))  
.setCoordinates(coordinates)  
.build().enqueueCall(object : Callback<LegacyDistanceResponse>() {  
fun  onResponse(call: Call<LegacyDistanceResponse>, response: Response<LegacyDistanceResponse>) {  
Timber.e(Gson().toJson(response.body()))  
}   
fun  onFailure(call: Call<LegacyDistanceResponse>, t: Throwable) {  
t.printStackTrace()
}
})

Request Parameters
  1. Center (Point): Inserts the specified position at the beginning of the coordinates list. If you've set other
  2. coordinates previously with setCoordinates() those elements are kept and their index will be moved up by one (the coordinates are moved to the right).
  3. Coordinates(List): List of Point giving origin and destination(s) coordinates. RouteType(Integer): Optionally set the routeType of returned turn-by-turn text instructions. The default is {@code en} for English.
  4. Vehicle Type(Integer): taxi or passenger
  5. With Traffic(Boolean):true of false
  6. Avoid(boolean avoidHighway, boolean avoidUnPavedRoads, boolean avoidFerries, boolean avoidTollRoads)
Response Codes {as HTTP response code}
Success:
  1. 200: To denote a successful API call.
  2. 204: To denote the API was a success but no results were found
Client-Side Issues:
  1. 400: Bad Request, User made an error while creating a valid request
  2. 401: Unauthorized, Developer’s key is not allowed to send a request with restricted parameters
  3. 403: Forbidden, Developer’s key has hit its daily/hourly limit
Server-Side Issues:
  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, please contact MapmyIndia
Response Messages (as HTTP response message)
  1. 200: Success.
  2. 204: No matches we.re found for the provided query.
  3. 400: Something.s just not right with the request.
  4. 401: Access Denied.
  5. 403: Services for this key has been suspended due to daily/hourly transactions limit.
  6. 500: Something went wrong.
  7. 503: Maintenance Break
On Response Parameters
  1. responseCode(Long): Response codes of the api.
  2. version(String): Version of the Api.
  3. results(List): List of the distances.
Distance Response Result Parameters
  1. duration(Long): Duration for source to source
  2. length(Long): Length between two source
  3. status(Long): Status of this route

Routing (legacy)

This will help to calculate driving routes between specified locations including via points based on route type(fastest or shortest), includes delays for traffic congestion , and is capable of handling additional route parameters like: type of roads to avoid, travelling vehicle type etc.

Class used for Routing is MapmyIndiaDirectionsLegacy. This class contains the static class Builder. Create the object of the MapmyIndiaDirectionLegacy.Builder class, which contains the method setOrigin() takes the origin point and the method setDestination() takes the destination point.

ArrayList<Point> coordinates=new ArrayList<>();
coordinates.add(Point.fromLngLat(80.502113, 8.916787));
coordinates.add(Point.fromLngLat(28.5505073, 77.2689367));
MapmyIndiaDirectionsMatrix.builder()
.clientAppName("APP")
.profile(DirectionsCriteria.PROFILE_DISTANCE_TRAFFIC)
.coordinates(coordinates)
.build().enqueueCall(new Callback<DistanceResponse>() {
@Override
public void onResponse(Call<DistanceResponse> call, Response<DistanceResponse> response) {
Timber.e(new Gson().toJson(response.body()));
}
@Override
public void onFailure(Call<DistanceResponse> call, Throwable t) {
t.printStackTrace();
}
});
val coordinates : ArrayList1<Point> = ArrayList1()
coordinates.add(Point.fromLngLat(80.502113, 8.916787))
coordinates.add(Point.fromLngLat(28.5505073, 77.2689367))
MapmyIndiaDirectionsMatrix.builder()
.clientAppName("APP")
.profile(DirectionsCriteria.PROFILE_DISTANCE_TRAFFIC)
.coordinates(coordinates)
.build().enqueueCall(object : Callback<DistanceResponse> {
override fun onResponse(call: Call<DistanceResponse>, response: Response<DistanceResponse>) {
Timber.e(Gson().toJson(response.body()))             
}
override fun onFailure(call: Call<DistanceResponse>, t: Throwable) {
t.printStackTrace()      
}
})
Request Parameters
  1. Origin (Point): Inserts the specified position at the beginning of the coordinates list. If you've set other coordinates previously with setCoordinates() those elements are kept and their index will be moved up by one (the coordinates are moved to the right).
  2. Destination(String): Appends the specified destination to the end of the coordinates list. If you've set other coordinates previously with setCoordinates() those elements are kept and the destination is added at the end of the list. Coordinates(List): List of Point giving origin and destination(s) coordinates.
  3. RouteType(Integer): Optionally set the routeType of returned turn-by-turn text instructions. The default is {@code en} for English.
  4. Vehicle Type(Integer):
  5. With Traffic(Boolean):
  6. Avoid(boolean avoidHighway, boolean avoidUnPavedRoads, boolean avoidFerries, boolean avoidTollRoads) :
  7. With Advice(Boolean): Optionally, call if you'd like to include step information within route.
  8. Alternatives (Boolean): Optionally, call if you'd like to receive alternative routes besides just one.
  9. OptimizedRoute(Boolean):
Response Codes {as HTTP response code}
Success:
  1. 200: To denote a successful API call.
  2. 204: To denote the API was a success but no results were found.
Client-Side Issues:
  1. 400: Bad Request, User made an error while creating a valid request
  2. 401: Unauthorized, Developer.s key is not allowed to send a request with restricted parameter
  3. 403: Forbidden, Developer.s key has hit its daily/hourly limit
Server-Side Issues:
  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, please contact MapmyIndia
Response Messages (as HTTP response message)
  1. 200: Success.
  2. 204: No matches were found for the provided query.
  3. 400: Something’s just not right with the request.
  4. 401: Access Denied.
  5. 403: Services for this key has been suspended due to daily/hourly transactions limit.
  6. 500: Something went wrong.
  7. 503: Maintenance Break
On Response Parameters
  1. responseCode(Long): Response codes of the api.
  2. version(String): Version of the Api.
  3. results(Results): All the details regarding place.
Results Response Result Parameters
  1. trips(List): List of the routes.
Trip Response Result Parameters
  1. rduration(Long): Duration of the routes
  2. length(Long): Length of the entire trip
  3. advice(List): An advice is the instruction for the end user that often appears at critical points along a route
  4. pts(String): List of points to draw a route. To decode pts use the below code:
List polyLine = LineString.fromPolyline(pts,Constants.PRECISION_6).coordinates();
var polyLine = LineString.fromPolyline(pts, Constants.PRECISION_6).coordinates() as List ;
  1. status(Long): Status of the route
Advice Response Result Parameters
  1. exitNr(Long): The exit number on roundabout exit, 0 if advice is not on roundabout manoeuvre.
  2. iconId (Long): The numeric id of the icon that represents current advice icon.
  3. meters (Long): Distance to the advice location from the start point.
  4. pt (Point): point of the location of the advice.
  5. seconds (Long): Time to reach to the advice location from the start point.
  6. text (String): Description of the advice.
Point Response Result Parameters
  1. latitude(Double): latitude of the advice position
  2. longitude(Double): longitude of the advice position.