Skip to content

AdamRatcliffe-TomTom/android-day-night

Repository files navigation

Day/night map example for Android

⚠️ Uses SDK version 0.3.1056. Changes may be required for later SDK versions.

The Maps SDK supports variants of a style, with variants allowing for a different look and feel to be applied to the map based on context. In the SDK style variants can be assigned to different style modes, defined by the StyleMode enum. The Map Display module comes with two pre-defined styles, StyleMode.MAIN and StyleMode.DARK, which are used to show a bright daytime style and a darker nighttime style respectively.

In this example the device's light sensor is used to set the map's style mode to StyleMode.DARK when the ambient light falls below 50 lux.

When running the example in the emulator the light sensor value can be set using the extended controls.

Running the example

  1. To run the example you'll need an API key with the Map Display API enabled.

  2. Open the project in Android Studio, the file local.properties will be generated in your project level directory, and add the following code to local.properties, replacing YOUR_API_KEY with your API key.

API_KEY=YOUR_API_KEY

  1. Save the file and run the app.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages