Skip to content

Map UI settings

Saksham66 edited this page Sep 23, 2021 · 3 revisions

MapmyIndia APIs

Map UI settings

Compass Settings

To change compass related settings:

Enable/ Disable compass

To enable or disable the compass:

Java

mapmyIndiaMap.getUiSettings().setCompassEnabled(true);

Kotlin

mapmyIndiaMap?.uiSettings?.isCompassEnabled = true

Enable/Disable Fading of the compass when facing north

To enable or disable fading of the compass when facing north:

Java

mapmyIndiaMap.getUiSettings().setCompassFadeFacingNorth(true);

Kotlin

mapmyIndiaMap?.uiSettings?.setCompassFadeFacingNorth(true)

Gravity of Compass

To set the gravity of compass view:

Java

mapmyIndiaMap.getUiSettings().setCompassGravity(Gravity.TOP);

Kotlin

mapmyIndiaMap?.uiSettings?.compassGravity = Gravity.TOP

Margins of compass

To set the margin of compass view:

Java

mapmyIndiaMap.getUiSettings().setCompassMargins(left, top, right, bottom);

Kotlin

mapmyIndiaMap?.uiSettings?.setCompassMargins(left, top, right, bottom)

Enable/Disable zoom of map on double tap

To enable or disable zoom on double tap:

Java

mapmyIndiaMap.getUiSettings().setDoubleTapGesturesEnabled(false);

Kotlin

mapmyIndiaMap?.uiSettings?.isDoubleTapGesturesEnabled = false

Logo Settings

To change the positions of logo:

Gravity of Logo

To set the gravity of Logo view:

Java

mapmyIndiaMap.getUiSettings().setLogoGravity(Gravity.TOP);

Kotlin

mapmyIndiaMap?.uiSettings?.logoGravity = Gravity.TOP

Margin of Logo

To set the margins of Logo view

Java

mapmyIndiaMap.getUiSettings().setLogoMargins(left, top, right, bottom);

Kotlin

mapmyIndiaMap?.uiSettings?.setLogoMargins(left, top, right, bottom)

Enable/ Disable Map Rotation Gesture

To enable or disable the map rotation:

Java

mapmyIndiaMap.getUiSettings().setRotateGesturesEnabled(false);

Kotlin

mapmyIndiaMap?.uiSettings?.isRotateGesturesEnabled = false

Enable/Disable Map Scrolling Gesture

To enable or disable the map scrolling:

Java

mapmyIndiaMap.getUiSettings().setScrollGesturesEnabled(false);

Kotlin

mapmyIndiaMap?.uiSettings?.isScrollGesturesEnabled = false

Enable/ Disable Map Tilt Gesture

To enable or disable map tilt:

Java

mapmyIndiaMap.getUiSettings().setTiltGesturesEnabled(false);

Kotlin

mapmyIndiaMap?.uiSettings?.isTiltGesturesEnabled = false

Enable/Disable Zoom Gesture

To enable or disable zoom gesture

Java

mapmyIndiaMap.getUiSettings().setZoomGesturesEnabled(false);

Kotlin

mapmyIndiaMap?.uiSettings?.isZoomGesturesEnabled = false

SDK Error Codes

Map will fail with following error codes

  • MAPS_SDK_KEY_MISSING=1; //when map sdk key is not passed
  • REST_API_KEY_MISSING=2; //when rest api key is not passed
  • ATLAS_CLIENT_ID_MISSING=3; //when atlas client id is not passed
  • ATLAS_CLIENT_SECRET_MISSING=4; //when atlas client secret is not passed
  • ATLAS_GRANT_TYPE_MISSING=5; //* //when atlas grant type is not passed
  • AUTHENTICATION_FAILED=7; //when map fails to authenticate itself with MapmyIndia server
  • UNKNOWN=8; // when map loading failed due to unknown error

For any queries and support, please contact:

Email 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 2020. CE Info Systems Pvt. Ltd. All Rights Reserved. | Terms & Conditions.

Clone this wiki locally