- Change imports
com.mapbox.mapboxsdk.*
tocom.mapmyindia.sdk.maps.*
- Change imports
com.mapbox.mapboxsdk.maps.*
tocom.mapmyindia.sdk.maps.*
- Change imports
com.mapbox.geojson.*
tocom.mapmyindia.sdk.geojson.*
- Change imports
com.mapbox.turf.*
tocom.mapmyindia.sdk.turf.*
- Change imports
com.mapbox.android.gestures.*
tocom.mapmyindia.sdk.gestures.*
- Change class
MapboxMap
toMapmyIndiaMap
<com.mapbox.mapboxsdk.maps.MapView
android:id="@+id/map_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.mapmyindia.sdk.maps.MapView
android:id="@+id/map_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Change all attributes from mapbox_ to mapmyindia_maps_
mapmyIndiaMap.moveCamera("MMI000", 14);
mapmyIndiaMap.easeCamera("MMI000", 14);
mapmyIndiaMap.animateCamera("MMI000", 14);
mapmyIndiaMap.moveCamera(CameraELocUpdateFactory.newELocZoom("MMI000", 14));
mapmyIndiaMap.easeCamera(CameraELocUpdateFactory.newELocZoom("MMI000", 14));
mapmyIndiaMap.animateCamera(CameraELocUpdateFactory.newELocZoom("MMI000", 14));
mapmyIndiaMap.moveCamera(eLocList, 10, 10, 10, 10);
mapmyIndiaMap.easeCamera(eLocList, 10, 10, 10, 10);
mapmyIndiaMap.animateCamera(eLocList, 10, 10, 10, 10);
mapmyIndiaMap.moveCamera(CameraELocUpdateFactory.newELocBounds(eLocs, 10 , 100, 10, 10));
mapmyIndiaMap.easeCamera(CameraELocUpdateFactory.newELocBounds(eLocs, 10 , 100, 10, 10));
mapmyIndiaMap.animateCamera(CameraELocUpdateFactory.newELocBounds(eLocs, 10 , 100, 10, 10));
//Map click
mapmyIndiaMap.addOnMapClickListener(new MapboxMap.OnMapClickListener() {
@Override
public void onMapClick(@NonNull LatLng point) {
}
});
//Map long click
mapmyIndiaMap.addOnMapLongClickListener(new MapboxMap.OnMapLongClickListener() {
@Override
public void onMapLongClick(@NonNull LatLng point) {
}
});
//Map click
mapmyIndiaMap.addOnMapClickListener(new MapmyIndiaMap.OnMapClickListener() {
@Override
public boolean onMapClick(@NonNull LatLng latLng) {
return false;
}
});
//Map long click
mapmyIndiaMap.addOnMapLongClickListener(new MapmyIndiaMap.OnMapLongClickListener() {
@Override
public boolean onMapLongClick(@NonNull LatLng latLng) {
return false;
}
});
//Current Location Activation
LocationComponentOptions options = LocationComponentOptions.builder(this)
.foregroundDrawable(R.drawable.location_pointer)
.build();
// Get an instance of the component LocationComponent
locationComponent = mapmyIndiaMaps.getLocationComponent();
// Activate with options
locationComponent.activateLocationComponent(this, options);
//LocationChange Listener
LocationEngineListener listener = new LocationEngineListener() {
@Override
public void onConnected() {
}
@Override
public void onLocationChanged(Location location) {
}
};
//Add Location Change listener
locationEngine.addLocationEngineListener(this);
//Remove Location Change listener
locationEngine.removeLocationEngineListener(this);
//Request Location Update
locationEngine.requestLocationUpdates();
//Remove location update
locationEngine.removeLocationUpdates();
//Current Location Activation
LocationComponentOptions options = LocationComponentOptions.builder(this)
.foregroundDrawable(R.drawable.location_pointer)
.build();
// Get an instance of the component LocationComponent
locationComponent = mapmyIndiaMap.getLocationComponent();
LocationComponentActivationOptions locationComponentActivationOptions = LocationComponentActivationOptions.builder(this, style)
.locationComponentOptions(options)
.build();
// Activate with options
locationComponent.activateLocationComponent(locationComponentActivationOptions);
//LocationChange Listener
LocationEngineCallback<LocationEngineResult> locationEngineCallback = new LocationEngineCallback<LocationEngineResult>() {
@Override
public void onSuccess(LocationEngineResult locationEngineResult) {
if(locationEngineResult.getLastLocation() != null) {
Location location = locationEngineResult.getLastLocation();
}
}
@Override
public void onFailure(@NonNull Exception e) {
}
};
LocationEngineRequest request = new LocationEngineRequest.Builder(DEFAULT_INTERVAL_IN_MILLISECONDS)
.setPriority(LocationEngineRequest.PRIORITY_HIGH_ACCURACY)
.setMaxWaitTime(DEFAULT_MAX_WAIT_TIME).build();
////Request Location Update & add location change callback
locationEngine.requestLocationUpdates(request, locationEngineCallback, getMainLooper());
//Remove location update & callback
locationEngine.removeLocationUpdates(locationEngineCallback);
MapmyIndiaAutoSuggest.builder()
.query(searchText)
.build()
.enqueueCall(new Callback<AutoSuggestAtlasResponse>() {
@Override
public void onResponse(@NonNull Call<AutoSuggestAtlasResponse> call, @NonNull Response<AutoSuggestAtlasResponse> response) {
//handle response
}
@Override
public void onFailure(@NonNull Call<AutoSuggestAtlasResponse> call, @NonNull Throwable t) {
t.printStackTrace();
}
});
MapmyIndiaAutoSuggest mapmyIndiaAutoSuggest = MapmyIndiaAutoSuggest.builder()
.query(searchString)
.build();
MapmyIndiaAutosuggestManager.newInstance(mapmyIndiaAutoSuggest).call(new OnResponseCallback<AutoSuggestAtlasResponse>() {
@Override
public void onSuccess(AutoSuggestAtlasResponse autoSuggestAtlasResponse) {
//handle response
}
@Override
public void onError(int i, String s) {
}
});
MapmyIndiaGeoCoding.builder()
.setAddress("Delhi")
.build()
.enqueueCall(new Callback<GeoCodeResponse>() {
@Override
public void onResponse(Call<GeoCodeResponse> call, Response<GeoCodeResponse> response) {
//handle response
}
@Override
public void onFailure(Call<GeoCodeResponse> call, Throwable t) {
t.printStackTrace();
}
});
MapmyIndiaGeoCoding mapmyIndiaGeoCoding = MapmyIndiaGeoCoding.builder()
.setAddress("Delhi")
.build();
MapmyIndiaGeoCodingManager.newInstance(mapmyIndiaGeoCoding).call(new OnResponseCallback<GeoCodeResponse>() {
@Override
public void onSuccess(GeoCodeResponse geoCodeResponse) {
}
@Override
public void onError(int i, String s) {
}
});
MapmyIndiaReverseGeoCode.builder()
.setLocation(28, 77)
.build()
.enqueueCall(new Callback<PlaceResponse>() {
@Override
public void onResponse(Call<PlaceResponse> call,Response<PlaceResponse> response) {
//handle response
}
@Override
public void onFailure(Call<PlaceResponse> call, Throwable t) {
t.printStackTrace();
}
});
MapmyIndiaReverseGeoCode mapmyIndiaReverseGeoCode = MapmyIndiaReverseGeoCode.builder()
.setLocation(28,77)
.build();
MapmyIndiaReverseGeoCodeManager.newInstance(mapmyIndiaReverseGeoCode).call(new OnResponseCallback<PlaceResponse>() {
@Override
public void onSuccess(PlaceResponse response) {
//Handle Response
}
@Override
public void onError(int code, String message) {
//Handle Error
}
});
MapmyIndiaNearby.builder()
.keyword("Parking")
.setLocation(28d, 77d)
.build()
.enqueueCall(new Callback<NearbyAtlasResponse>() {
@Override
public void onResponse(Call<NearbyAtlasResponse> call, Response<NearbyAtlasResponse> response) {
//handle response
}
@Override
public void onFailure(Call<NearbyAtlasResponse> call, Throwable t) {
t.printStackTrace();
}
});
MapmyIndiaNearby mapmyIndiaNearby = MapmyIndiaNearby.builder()
.setLocation(28,77)
.keyword("Parking")
.build();
MapmyIndiaNearbyManager.newInstance(mapmyIndiaNearby).call(new OnResponseCallback<NearbyAtlasResponse>() {
@Override
public void onSuccess(NearbyAtlasResponse response) {
//Handle Response
}
@Override
public void onError(int code, String message) {
//Handle Error
}
});
MapmyIndiaELoc.builder()
.setELoc("mmi000")
.build()
.enqueueCall(new Callback<PlaceResponse>() {
@Override
public void onResponse(Call<PlaceResponse> call, Response<PlaceResponse> response) {
//handle response
}
@Override
public void onFailure(Call<PlaceResponse> call, Throwable t) {
t.printStackTrace();
}
});
MapmyIndiaELoc mapmyIndiaELoc = MapmyIndiaELoc.builder()
.setELoc("mmi000")
.build();
MapmyIndiaELocManager.newInstance(mapmyIndiaELoc).call(new OnResponseCallback<PlaceResponse>() {
@Override
public void onSuccess(PlaceResponse response) {
//Handle Response
}
@Override
public void onError(int code, String message) {
//Handle Error
}
});
MapmyIndiaPlaceDetail.builder()
.eLoc("mmi000")
.build()
.enqueueCall(new Callback<PlaceDetailResponse>() {
@Override
public void onResponse(Call<PlaceDetailResponse> call, Response<PlaceDetailResponse> response) {
//handle response
}
@Override
public void onFailure(Call<PlaceDetailResponse> call, Throwable t) {
t.printStackTrace();
}
});
MapmyIndiaPlaceDetail mapmyIndiaPlaceDetail = MapmyIndiaPlaceDetail.builder()
.eLoc("mmi000")
.build();
MapmyIndiaPlaceDetailManager.newInstance(mapmyIndiaPlaceDetail).call(new OnResponseCallback<PlaceDetailResponse>() {
@Override
public void onSuccess(PlaceDetailResponse response) {
//Handle Response
}
@Override
public void onError(int code, String message) {
//Handle Error
}
});
MapmyIndiaPOIAlongRoute.builder()
.category(catCode)
.path(path)
.build().enqueueCall(new Callback<POIAlongRouteResponse>() {
@Override
public void onResponse(Call<POIAlongRouteResponse> call, Response<POIAlongRouteResponse> response) {
//handle response
}
@Override
public void onFailure(Call<POIAlongRouteResponse> call, Throwable t) {
t.printStackTrace();
}
});
MapmyIndiaPOIAlongRoute poiAlongRoute = MapmyIndiaPOIAlongRoute.builder()
.category(catCode)
.path(path)
.build();
MapmyIndiaPOIAlongRouteManager.newInstance(poiAlongRoute).call(new OnResponseCallback<POIAlongRouteResponse>() {
@Override
public void onSuccess(POIAlongRouteResponse response) {
//Handle Response
}
@Override
public void onError(int code, String message) {
//Handle Error
}
});
MapmyIndiaDirections.builder()
.origin(startPointLocal)
.steps(true)
.resource(DirectionsCriteria.RESOURCE_ROUTE_ETA)
.profile(DirectionsCriteria.PROFILE_DRIVING)
.overview(DirectionsCriteria.OVERVIEW_FULL)
.destination(endPointLocal)
.build()
.enqueueCall(new Callback<DirectionsResponse>() {
@Override
public void onResponse(Call<DirectionsResponse> call, Response<DirectionsResponse> response) {
//handle response
}
@Override
public void onFailure(Call<DirectionsResponse> call, Throwable t) {
t.printStackTrace();
}
});
MapmyIndiaDirections directions = MapmyIndiaDirections.builder()
.origin(startPointLocal)
.steps(true)
.resource(DirectionsCriteria.RESOURCE_ROUTE_ETA)
.profile(DirectionsCriteria.PROFILE_DRIVING)
.overview(DirectionsCriteria.OVERVIEW_FULL)
.destination(endPointLocal)
.build();
MapmyIndiaDirectionManager.newInstance(directions).call(new OnResponseCallback<DirectionsResponse>() {
@Override
public void onSuccess(DirectionsResponse directionsResponse) {
}
@Override
public void onError(int i, String s) {
}
});
MapmyIndiaDistanceMatrix.builder()
.profile(DirectionsCriteria.PROFILE_DRIVING)
.resource(DirectionsCriteria.RESOURCE_DISTANCE)
.coordinate(Point.fromLngLat(80.502113, 8.916787))
.coordinate(Point.fromLngLat(28.5505073, 77.2689367))
.build()
.enqueueCall(new Callback<DistanceResponse>() {
@Override
public void onResponse(Call<DistanceResponse> call, Response<DistanceResponse> response) {
//handle response
}
@Override
public void onFailure(Call<DistanceResponse> call, Throwable t) {
t.printStackTrace();
}
});
MapmyIndiaDistanceMatrix distanceMatrix = MapmyIndiaDistanceMatrix.builder()
.profile(DirectionsCriteria.PROFILE_DRIVING)
.resource(DirectionsCriteria.RESOURCE_DISTANCE)
.coordinate(Point.fromLngLat(80.502113, 8.916787))
.coordinate(Point.fromLngLat(28.5505073, 77.2689367))
.build();
MapmyIndiaDistanceMatrixManager.newInstance(distanceMatrix).call(new OnResponseCallback<DistanceResponse>() {
@Override
public void onSuccess(DistanceResponse distanceResponse) {
}
@Override
public void onError(int i, String s) {
}
});
For any queries and support, please contact:
Email us at [email protected]
Stack Overflow Ask a question under the mapmyindia-api
Support Need support? contact us!
Blog Read about the latest updates & customer stories
© Copyright 2022. CE Info Systems Ltd. All Rights Reserved. | Terms & Conditions