Show MapView
Show Map
The MapView package provides all the classes for Map Rendering. MapView is built following Android UI Framework practice and provides much flexibility for the developer. The following are some of the common MapView features.
- Map Rendering - High quality Map Rendering View can be easily integrated into your application, CSM, or Cluster.
- Flexible and Rich Styling Support - Flexible and high performance map styling support, designed for various navigation experience.
- Location Info Rendering - Showing additional Geo-Spacial content on the map, like POI from our Search SDK, or any other content you would like to display.
- Driving Mode - Rich and fine tuned feature set to enable drive mode for MapView, follow vehicle camera, auto-zoom based on vehicle speed and Location information.
- Route Rendering and Navigation Support - Rendering Route and supporting full feature set required to enable a smooth navigation experience. More information can be referred to our Navigation module.
To Show MapView on your designed application, below are the steps to follow:
Step 1:
Add SDK life cycle managements for SDK. Please intialize SDK during onCreate(), and call SDK.dispose when onDestroy called.
Tip
Some features require additional permissions from Android system to work. These permissions include internet permission for streaming and cloud features, externalStorage read/write permission for embedded map data access, and location permission for driving and navigation. Please refer to SDKOption object definition. Providing an end point in SDKOption enables its cloud mode. Configuring the map data path (require permission) enables its embedded mode. If both end point and map data path are set, SDK will work in hybrid mode. To get a set of evaluation data, please contract Telenav sales team. SDKOptions must include apikey/apisecret to initialize our SDK.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
Step 2:
Declare Mapview on the target layout.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Step 3:
Initalize MapView after View is created.
1 2 3 4 | |
1 2 3 4 5 | |
Step 4:
Build and Run your application on Device.
Step 5:
Now you should be able to see the map, pan/zoom operations are supported. Also, there are other subset APIs exposed, including: setZoomLevel and followVehicle().
Under follow vehicle mode, you can't pan, but when user try to pan the map, you will receive callback and make decision based on the situation. The API will be published later.
1 2 | |