One of the core features of the HERE SDK for Android is Mapping, which includes adding a map view, changing the location displayed by the map, and modifying its properties. The primary component of the mapping API is the map view, which is integrated as a
View subclass. The map view represents a vector based view to display a map and various properties.
HERE map data is updated on a weekly basis to ensure you always get the freshest map data available. By integrating the map view you can automatically benefit from this. While the map is vector based, you can also integrate custom map tiles from other providers.
To create a simple map application, please refer to the Get Started section.
To manipulate the map and its properties, it is best to start looking at the Camera section. More features include the following:
There are a several options available to improve the performance on low-end devices, if needed.
For example, you can create custom map styles that contain less elements to render. The more elements are rendered on the map view, the more computing power is consumed by the GPU.
If you want to render multiple POIs on the map, it is better to use
MapMarkerLite instances instead of native views like
MapOverlay instances that are heavier to render by the native platform.
The HERE SDK supports several preconfigured map schemes.
Consult the Get Started section to see how to instantly switch default map styles such as satellite versus a normal day map layer.
On top of map schemes, the HERE SDK allows to add certain kinds of layers that show additional information such as the current traffic flow. Check the Traffic section to see an example.
For the HERE SDK for Android (Lite Edition) it is not necessary to remove font files as it uses fonts that are already part of the Android platform to keep the binary size of the framework as small as possible.
You can customize the language that is used on the map to show labels for streets, cities and other map data. By default, the local language of a region is used.
Use the fields
fallbackLanguageCode to specify the desired map language via a
MapSceneConfig when loading a map scene. The
fallbackLanguageCode is used when the desired language is not available in any region of the world. Set both fields to
null to switch back to the default behavior.
By default, a few regions in the world including Japan, China and Korea, contain limited map data. To get access to the full map data, please get in contact with your HERE representative.
The HERE SDK supports multiple geographic political views. A three letter language code can be set for the
politicalView member accessible via
SDKOptions. The supported country codes are accessible on the coverage page. When set, all map data will respect the point of view of this country and the
MapView will show the borders accordingly. Note that this is released as a beta feature.
To better support online and offline use cases, the HERE SDK supports caching of downloaded vector map data. This happens in the background. While interacting with the map, the data is stored locally on the device and can be accessed even when the device loses connection or operates in an offline mode.
The integrated map caching mechanism supports the standard vector based map schemes - satellite images and other raster tiles are also cached, but in a different cache that is not configurable.
Please note that the amount of cached data is limited and will be overwritten with new map data while using the map. In most cases, this is sufficient to give the user the impression of a faster start-up time - as no additional data must be downloaded when you start an app again at the same location as before.
When the cache is full, a least recently used (LRU)) strategy is applied.
An absolute cache path and maximum size can be specified when manually initializing the HERE SDK using
SDKOptions. Note that the cache path can be also set via the
AndroidManifest file. Check the Engines section for more details.
You can also clear the cached data via
When using the HERE SDK, it is required that the HERE logo is always visible on the map view. By default, the HERE logo is located at the bottom right corner of the map. However, you can easily customize its location to meet your app design by calling
setWatermarkPosition() on your map view instance. It is recommended to change the default placement only when it is required due to overlapping UI elements. Note for very small views: If both edges of the map are less than 250 density independent pixels in size, the watermark will be hidden automatically.