User guide
HERE SDK for Android
Developer's Guide
Online Version 2.1.1
HERE SDK for Android Developer's Guide
► Contents
2
Contents
Legal Notices..........................................................................................................................................................8
Document Information.................................................................................................................................... 9
Chapter 1: Overview.............................................................................................................................. 10
What is the HERE SDK for Android?........................................................................................................ 11
Feature List.................................................................................................................................................... 11
Chapter 2: Quick Start........................................................................................................................ 13
Creating a Simple Application................................................................................................................... 14
Extending the Application.......................................................................................................................... 19
Adding Route Calculation........................................................................................................................... 23
Chapter 3: User Guide......................................................................................................................... 27
Authenticating Applications....................................................................................................................... 28
Obfuscating Applications............................................................................................................................28
Maps.................................................................................................................................................................29
Gestures............................................................................................................................................. 35
Map Schemes.................................................................................................................................... 38
MapEngine Class............................................................................................................................... 42
Objects and Interaction.................................................................................................................. 43
Transit................................................................................................................................................. 54
Positioning......................................................................................................................................... 65
MapActivity Class............................................................................................................................. 69
Extruded Buildings........................................................................................................................... 70
3D Landmarks................................................................................................................................... 75
Custom Raster Tiles........................................................................................................................ 75
Places...............................................................................................................................................................78
Geocoding and Reverse Geocoding............................................................................................. 79
HERE SDK for Android Developer's Guide
► Contents
3
Search and Discovery..................................................................................................................... 81
Directions....................................................................................................................................................... 87
Calculate routes............................................................................................................................... 87
Chapter 4: Supplemental Information................................................................................. 92
Creating a Simple HERE SDK Application in Android Studio...............................................................93
Adding a MapFragment at Runtime......................................................................................................... 99
Compatibility Fragments.......................................................................................................................... 100
Size Management.......................................................................................................................................100
Development Tips...................................................................................................................................... 102
Chapter 5: API Reference.............................................................................................................. 103
common........................................................................................................................................................ 104
ConnectionInfo............................................................................................................................... 104
CopyrightLogoPosition................................................................................................................. 106
GeoBoundingBox............................................................................................................................108
GeoCoordinate............................................................................................................................... 117
GeoPolygon..................................................................................................................................... 123
GeoPolyline...................................................................................................................................... 125
GeoPosition..................................................................................................................................... 131
IconCategory................................................................................................................................... 135
Identifier...........................................................................................................................................148
Image................................................................................................................................................ 150
MapActivity...................................................................................................................................... 158
MapEngine....................................................................................................................................... 160
OffScreenRenderer....................................................................................................................... 167
OnEngineInitListener..................................................................................................................... 170
OnScreenCaptureListener........................................................................................................... 175
PositioningManager....................................................................................................................... 176
RoadElement................................................................................................................................... 187
Size.................................................................................................................................................... 202
TimeInterval.................................................................................................................................... 204
HERE SDK for Android Developer's Guide
► Contents
4
TransitType..................................................................................................................................... 206
Vector3f........................................................................................................................................... 210
Version..............................................................................................................................................214
ViewObject....................................................................................................................................... 215
ViewRect........................................................................................................................................... 219
mapping........................................................................................................................................................ 224
GeoMesh.......................................................................................................................................... 225
LocalMesh........................................................................................................................................ 227
Location............................................................................................................................................229
LocationInfo.................................................................................................................................... 230
Map.................................................................................................................................................... 241
MapBuildingGroup..........................................................................................................................301
MapBuildingLayer........................................................................................................................... 308
MapBuildingObject......................................................................................................................... 321
MapCartoMarker.............................................................................................................................322
MapCircle......................................................................................................................................... 323
MapCompatibilityFragment......................................................................................................... 328
MapContainer..................................................................................................................................341
MapFragment.................................................................................................................................. 344
MapGeoModel................................................................................................................................. 357
MapGesture..................................................................................................................................... 359
MapLabeledMarker........................................................................................................................ 383
MapLocalModel............................................................................................................................... 391
MapMarker....................................................................................................................................... 398
MapModelObject............................................................................................................................ 408
MapObject....................................................................................................................................... 418
MapOffScreenRenderer................................................................................................................ 428
MapOverlayType.............................................................................................................................434
MapPolygon..................................................................................................................................... 436
MapPolyline..................................................................................................................................... 442
MapProxyObject............................................................................................................................. 451
MapRasterTileSource.................................................................................................................... 455
MapRenderListener....................................................................................................................... 472
HERE SDK for Android Developer's Guide
► Contents
5
MapRoute......................................................................................................................................... 475
MapScreenMarker.......................................................................................................................... 481
MapState.......................................................................................................................................... 485
MapTransitLayer.............................................................................................................................489
MapView........................................................................................................................................... 494
Mesh.................................................................................................................................................. 508
OnMapRenderListener.................................................................................................................. 510
OperatingHours.............................................................................................................................. 515
PositionIndicator............................................................................................................................ 518
TransitAccessInfo.......................................................................................................................... 522
TransitAccessObject......................................................................................................................529
TransitDatabase............................................................................................................................. 531
TransitLineInfo............................................................................................................................... 542
TransitLineObject...........................................................................................................................548
TransitLineSegmentObject.......................................................................................................... 549
TransitStopInfo.............................................................................................................................. 551
TransitStopObject......................................................................................................................... 562
TransitSystemInfo......................................................................................................................... 564
UrlMapRasterTileSourceBase...................................................................................................... 571
routing.......................................................................................................................................................... 574
Maneuver......................................................................................................................................... 574
Route................................................................................................................................................ 605
RouteElement................................................................................................................................. 615
RouteManager................................................................................................................................ 619
RouteOptions.................................................................................................................................. 628
RoutePlan......................................................................................................................................... 645
RouteResult..................................................................................................................................... 649
RouteTta.......................................................................................................................................... 653
Signpost........................................................................................................................................... 657
search............................................................................................................................................................662
Address.............................................................................................................................................662
Category...........................................................................................................................................672
CategoryFilter................................................................................................................................. 679
HERE SDK for Android Developer's Guide
► Contents
6
ContactDetail.................................................................................................................................. 682
DiscoveryLink.................................................................................................................................. 684
DiscoveryRequest.......................................................................................................................... 686
DiscoveryResult.............................................................................................................................. 689
DiscoveryResultPage..................................................................................................................... 695
EditorialMedia................................................................................................................................. 698
ErrorCode.........................................................................................................................................699
ExploreRequest.............................................................................................................................. 709
ExtendedAttribute......................................................................................................................... 712
GeocodeRequest............................................................................................................................ 716
HereRequest................................................................................................................................... 719
ImageMedia..................................................................................................................................... 721
Link.................................................................................................................................................... 724
Location............................................................................................................................................726
Media.................................................................................................................................................730
MediaCollectionPage<T>.............................................................................................................. 735
MediaCollectionPageRequest<T>.............................................................................................. 738
NavigationPosition......................................................................................................................... 740
Place.................................................................................................................................................. 741
PlaceLink.......................................................................................................................................... 750
PlaceRequest.................................................................................................................................. 754
RatingMedia..................................................................................................................................... 756
Ratings.............................................................................................................................................. 757
ReportingLink.................................................................................................................................. 759
Request<T>..................................................................................................................................... 761
RequestCreator.............................................................................................................................. 766
ResultListener<T>..........................................................................................................................780
ReverseGeocodeRequest............................................................................................................. 781
ReviewMedia.................................................................................................................................... 782
RichTextFormatting....................................................................................................................... 785
SearchRequest................................................................................................................................787
SupplierLink..................................................................................................................................... 790
TextSuggestionRequest............................................................................................................... 792
HERE SDK for Android Developer's Guide
► Contents
7
TransitDeparture............................................................................................................................794
TransitDeparturesAttribute......................................................................................................... 799
TransitDestination......................................................................................................................... 800
TransitLine....................................................................................................................................... 802
TransitLineCategory...................................................................................................................... 805
TransitLineStyle..............................................................................................................................807
TransitLinesAttribute.................................................................................................................... 809
TransitOperator............................................................................................................................. 811
TransitOperatorLink...................................................................................................................... 813
TransitOperatorSupplier.............................................................................................................. 815
TransitSchedulePage.....................................................................................................................817
TransitSchedulePageRequest..................................................................................................... 820
UserLink........................................................................................................................................... 821
ViaLink.............................................................................................................................................. 823
HERE SDK for Android Developer's Guide
► Legal Notices
8
Legal Notices
© 2015 HERE. All rights reserved.
This material, including documentation and any related computer programs, is protected by
copyright controlled by HERE. All rights are reserved. Copying, including reproducing, storing,
adapting or translating, any or all of this material requires the prior written consent of HERE. This
material also contains confidential information, which may not be disclosed to others without the
prior written consent of HERE.
Trademark Acknowledgements
HERE and Nokia are trademarks or registered trademarks of Nokia Corporation in the United States
and other countries.
Other trade names are trademarks or registered trademarks of their owners.
Disclaimer
This content is provided "as-is" and without warranties of any kind, either express or implied,
including, but not limited to, the implied warranties of merchantability, fitness for a particular
purpose, satisfactory quality and non-infringement. Nokia does not warrant that the content is error
free and Nokia does not warrant or make any representations regarding the quality, correctness,
accuracy, or reliability of the content. You should therefore verify any information contained in the
content before acting on it.
To the furthest extent permitted by law, under no circumstances, including without limitation Nokia's
negligence, shall Nokia be liable for any damages, including, without limitation, direct, special,
indirect, punitive, consequential, exemplary and/ or incidental damages that result from the use or
application of this content, even if Nokia or an authorized representative has been advised of the
possibility of such damages.
HERE SDK for Android Developer's Guide
► Document Information
Document Information
Product
Name:
HERE SDK for Android
Version:
Online Version 2.1.1
Document
Name:
HERE SDK for Android Developer's Guide
Id:
01f7fd7-1425485694
Status:
FINAL
Date:
2015-Mar-04, 16:17 (GMT)
9
HERE SDK for Android Developer's Guide
► Overview
10
Chapter
1
Overview
Topics:
•
What is the HERE SDK for Android?
The articles that follow introduce the HERE SDK for Android,
explain essential concepts and describe the common features it
•
Feature List
supports.
HERE SDK for Android Developer's Guide
► Overview
11
What is the HERE SDK for Android?
The HERE SDK for Android provides a set of programming interfaces that enable developers to build
immersive, geographically-aware Android applications by leveraging a powerful and flexible mapping
platform. Through this SDK, developers can add rich location features such as routing, interactive
maps, and global place search to their applications. The powerful client-side HERE SDK for Android
also includes a sophisticated engine for rendering map data and calculated routes. In addition to
dynamic map data downloads, the SDK also supports offline maps using previously cached map data
or downloaded map packages.
Vector Maps
The HERE SDK delivers vector-based map data, in contrast to most mapping SDKs that only provide
APIs to display map data using raster tiles. With raster tiles, panning to a new location or moving to a
new zoom level requires additional raster tiles must be downloaded, leading to a negative impact on
application fluidity and the overall user experience.
Vector map data used by the HERE SDK consists of many data layers that are rendered based on rules
describing what to display and how to display it. This enables use cases typically not possible with
raster tiles, such as:
•
•
•
•
dynamically altering the look and style of the map (for example: changing to night mode) without
downloading new map data
zooming the map smoothly rather than in discrete zoom steps
rotating the map while maintaining correct label and icon orientation
tilting the map to show textured 3D landmarks
Moreover, vector map data requires significantly less storage space than raster map tiles, enabling
map data to be downloaded for offline use. The result is a powerful hybrid solution where map data
can be downloaded over a wireless data connection as needed, or maps for countries and regions can
be preloaded for later use, eliminating the need for an always-present wireless data connection.
The HERE SDK uses vector data for all normal maps. Raster tiles are used when satellite, terrain, and
custom maps are being displayed.
Feature List
The main features offered by the HERE SDK for Android are listed below:
HERE SDK for Android Developer's Guide
► Overview
12
Mapping:
•
•
•
•
•
•
•
•
•
•
•
Dynamically download vector maps for more than 190 countries in over 50 languages
Map styles: normal street map, satellite map, transit map, and more
Textured 3D landmarks
Touch gestures (including pan, flick, pinch zoom, rotate, and tilt)
Overlay objects on the map such as polylines, polygons, icons, and routes
Overlay 3D map objects
Overlay custom raster tiles on the map (for example, to display heat maps)
Ability to render raster tiles and map objects interleaved within different map layers
3D Extruded Buildings
3D Landmarks
Transit object interaction
Search:
•
•
•
•
Search through a broad set of geographical content, including 25 million streets, 200 million
address points, and over 60 million categorized places across the globe
Search for a specific place or explore by categories
Get rich details for a Point of Interest (including images, ratings, reviews, and editorials)
Perform geocoding and reverse geocoding lookups
Directions:
•
•
•
Get driving or pedestrian directions
Specify preferred route type (fastest/shortest) and attributes to avoid (toll roads, motorways,
parks, and more)
Alternate routes
HERE SDK for Android Developer's Guide
► Quick Start
Chapter
2
Quick Start
Topics:
•
Creating a Simple Application Using
the HERE SDK
•
Extending the Simple Application
•
Adding Route Calculation to the
Simple Application
The articles in this section provide information to help you start
using the HERE SDK for Android.
13
HERE SDK for Android Developer's Guide
► Quick Start
14
Creating a Simple Application Using the HERE SDK
This tutorial provides instructions on how to create a simple application that uses the HERE SDK for
Android to render a map on an Android device. With this application, users will be able to:
•
Pan around the map to view different geographical regions
•
Center the map on a specific part of the viewable area using standard Android single-tap
gestures
•
Zoom in and out using standard Android pinch-to-zoom, double-tap, or two-finger tap
•
Rotate the map using standard Android two-finger rotate gestures
•
Tilt the map using standard Android two-finger tilt gestures
Note: This tutorial applies to Eclipse and Android Developer Tools. For information on how to
perform the same tasks in Android Studio, refer to Creating a Simple HERE SDK Application
in Android Studio on page 93.
Development tasks for this basic application include:
•
Create a new Eclipse project
•
Add necessary resources, permissions and map fragment(s) to the project properties and
application manifest
•
Acquire credentials from HERE for accessing map services
•
Initialize the map fragment such that a map instance is created and associated with the map
fragment for rendering on the client device
Create a New Eclipse Project
The first stage of developing an application using the HERE SDK is to create a new project in Eclipse
as follows:
1.
From the Eclipse File menu, select New > Android Application Project to open the New Android
App dialog (or click
from the toolbar)
2.
In the New Android Application dialogue, under Application Name, specify an appropriate
application name (The remainder of this tutorial will refer the application name as
HelloHEREMaps)
3.
Under Project Name, specify an appropriate project name
4.
Under Package Name, specify an appropriate package name (For example,
com.mapstutorial.helloheremaps. This is the package name that this tutorial will use)
HERE SDK for Android Developer's Guide
► Quick Start
15
5.
Under Minimum Required SDK, select the lowest version of the Android SDK you wish to support.
For this sample application, we will use Android 4.0
6.
Under Target SDK, select your target Android SDK version with API level 14 (Ice Cream Sandwich
4.0.1) or above
7.
Click Next
8.
Click Next to use the default icons
9.
On the Create Activity dialog box, select Blank Activity and click Next
10. Click Finish
Result: A new project will appear within the Eclipse Package Explorer, which will expand to show the
location of the activity_main.xml file. The file itself will be opened in the main editor view, in Graphical
Layout mode for adding and editing UI elements.
Add HERE SDK Libraries to Your Project
After creating the skeleton of your new application, add the HERE SDK resources as follows:
1.
From the directory where you installed the HERE SDK, copy the contents of the HERE-sdk/libs/
folder, except HERE-sdk-javadoc.jar, to your project's libs/ folder.
2.
In your Eclipse project's libs/ folder, right-click the HERE-sdk.jar file and select Build Path >
Add to Build Path.
3.
Optional: If you plan on extending this application with HERE Places functionality, add the googlegson library (release 2.2.4 or a compatible version) into your project. One way to do this is to
download the google-gson-*-release.zip file from https://code.google.com/p/googlegson/, unzip the ZIP archive, and copy the gson-*.jar (not gson-*-sources.jar or gson*-javadoc.jar) into your project libs/ folder, then right-click on it in Eclipse, and select Build
Path > Add to Build Path. The google-gson library is required for all HERE Places operations. For
more information on using HERE Places, please see Places on page 78.
Result: Your project will be able to make use of APIs from the HERE SDK.
Note: Performing these steps should also link Javadoc files to the SDK library. If Javadoc
does not appear in Eclipse, please close and re-open your Eclipse project. If you would like to
change the location of the docs folder, update the HERE-sdk.jar.properties file in the
libs folder to match the docs folder location.
Edit AndroidManifest.xml
With resources added to your project, the next stage of creating an application with the HERE SDK is
to edit the project's AndroidManifest.xml file to specify Android permissions as follows:
1.
From the Package Explorer, double-click your project's AndroidManifest.xml file to open it for
editing.
2.
At the bottom of the editor view that displays the manifest, click the AndroidManifest.xml tab to
switch the file's view to text editor mode.
HERE SDK for Android Developer's Guide
► Quick Start
3.
16
Add the following markup beneath the <uses-sdk/> tag:
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission
android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
4.
Within the <application></application> block of tags, add the following markup directly
beneath the <activity></activity> tag:
<meta-data android:name="com.here.android.maps.appid"
android:value="YOUR APP ID"/>
<meta-data android:name="com.here.android.maps.apptoken"
android:value="YOUR APP CODE"/>
5.
Replace the YOUR APP ID and YOUR APP CODE strings with appropriate credentials for your
application, which you can acquire by contacting your HERE account representative.
Note: All users of the HERE SDK are required to register for a HERE App_Id and
App_Code, and to specify those values in their Android manifest XML file. Failure to do
so will result in blocked access to certain features and could lead to degradation in the
quality of other services.
6.
Within the same <application></application> section in your AndroidManifest.xml
file, add the following lines:
<service
android:name="com.here.android.mpa.service.MapService"
android:label="HereMapService"
android:process="global.Here.Map.Service.v2"
android:exported="true" >
<intent-filter>
<action android:name="com.here.android.mpa.service.MapService"
>
</action>
</intent-filter>
</service>
Result: Your application is now configured to use the minimum Android device permissions that are
required by HERE Maps
HERE SDK for Android Developer's Guide
► Quick Start
17
Edit activity_main.xml
Along with permissions and credentials, you must add an Android <fragment /> tag to set up the
map fragment that your application activity will be associated with. In this section, we will display a
text label (generated as part of the default new application) and a map right below label as follows:
1.
From the Package Explorer, under the res/layout/ folder of your project, double-click the
activity_main.xml file to open it for editing.
2.
At the bottom of the editor view that displays the layout for MainActivity, click the
activity_main.xml tab to switch the file's view to text editor mode.
3.
Ensure that the XML file has <LinearLayout></LinearLayout> as its root element.
Depending on your version of Eclipse, this may be a RelativeLayout instead. If that is the
case, replace the contents of the file with the following:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</LinearLayout>
4.
Add the following markup beneath the <TextView/> tag:
<!-- Map Fragment embedded with the map object -->
<fragment
class="com.here.android.mpa.mapping.MapFragment"
android:id="@+id/mapfragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Result: When MapFragment is initialized, your application's MainActivity will contain a
MapFragment UI element (with the ID mapfragment) that owns a Map object.
Initializing the Map Fragment
When you have defined the basic layout of the application and acquired necessary permissions, the
final step is to initialize the instance of the MapFragment class, thus creating and associating a Map
with the MapFragment declared in the activity_main.xml file:
•
From the Package Explorer, under the src/ folder of your project, double-click the
MainActivity.java file to open it for editing.
HERE SDK for Android Developer's Guide
► Quick Start
•
18
Revise the import statements and functional logic of the MainActivity to look like the following:
package com.mapstutorial.helloheremaps;
import android.app.Activity;
import android.os.Bundle;
import
import
import
import
com.here.android.mpa.common.GeoCoordinate;
com.here.android.mpa.common.OnEngineInitListener;
com.here.android.mpa.mapping.Map;
com.here.android.mpa.mapping.MapFragment;
public class MainActivity extends Activity {
// map embedded in the map fragment
private Map map = null;
// map fragment embedded in this activity
private MapFragment mapFragment = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Search for the map fragment to finish setup by calling init().
mapFragment = (MapFragment)getFragmentManager().findFragmentById(
R.id.mapfragment);
mapFragment.init(new OnEngineInitListener() {
@Override
public void onEngineInitializationCompleted(
OnEngineInitListener.Error error)
{
if (error == OnEngineInitListener.Error.NONE) {
// retrieve a reference of the map from the map fragment
map = mapFragment.getMap();
// Set the map center to the Vancouver region (no animation)
map.setCenter(new GeoCoordinate(49.196261, -123.004773, 0.0),
Map.Animation.NONE);
// Set the zoom level to the average between min and max
map.setZoomLevel(
(map.getMaxZoomLevel() + map.getMinZoomLevel()) / 2);
} else {
System.out.println("ERROR: Cannot initialize Map Fragment");
}
}
});
}
}
Result: You can run your simple application by pressing the key combination Ctrl + F11 from within
Eclipse (if prompted, run the project as an "Android Application"). The application will render a map
retrieved from the HERE servers. When you are running your application on a device, make sure a
data connection is enabled.
See folder BasicMapSolution for a completed example. You will need to add your own App_Id and
App_Code for this completed example to work.
HERE SDK for Android Developer's Guide
► Quick Start
19
Extending the Simple Application
Beyond creating a basic application, you can extend your application with the use of features from
the HERE SDK for Android. This tutorial introduces methods to change map attributes such as map
center, tilt angle, orientation, daytime/nighttime map schemes, and zoom levels.
Getting Started
You can import the Android project from the BasicMapSolution folder as a starting point for this
exercise. (Please note that MainActivity is changed to BasicMapActivity in this version of the
project.)
Note: The tasks presented on this page assume that you gave the name "HelloHEREMaps" to
your Eclipse project and the name com.mapstutorial.helloheremaps to your application
package.
Add a "Go Home" Button
This task introduces the following HERE SDK for Android class methods:
•
com.here.android.mpa.mapping.Map.setOrientation()
•
com.here.android.mpa.mapping.Map.setTilt()
Within a map-based application, users can pan around the map to different regions, zoom in and out,
even rotate or tilt the map itself. A user-friendly app might, in turn, offer users a UI element that
allows them to reset the initial map view.
Add a "Go Home" Button element to the HelloHEREMaps application as follows:
1.
From the Package Explorer, double-click the HelloHEREMaps/res/values/strings.xml file to open
it for editing.
2.
At the bottom of the editor view that displays the string resources, click the strings.xml tab to
switch the file's view to text editor mode.
3.
Add the following line to the group of <string></string> tags:
<string name="label_button_gohome">Go Home</string>
4.
From the Package Explorer, double-click the HelloHEREMaps/res/layout/activity_main.xml file
to open it for editing.
HERE SDK for Android Developer's Guide
► Quick Start
5.
20
Add the following markup directly above the <fragment /> tag:
<!-- UI element declaration for "Go Home" button -->
<android.widget.Button
android:id="@+id/homebutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_button_gohome"
android:onClick="goHome" />
6.
From the Package Explorer, double-click the HelloHEREMaps/src/
com.mapstutorial.helloheremaps/MainActivity.java file to open it for editing.
7.
Add the following lines to the import statements near the top of the source file:
import android.view.View;
import java.util.List;
8.
Add the following method to the end of the class:
// Functionality for taps of the "Go Home" button
public void goHome(View view) {
if (map != null) {
// Change map view to "home" coordinate and zoom level, plus
// eliminate any rotation or tilt
map.setCenter(new GeoCoordinate(49.196261, -123.004773, 0.0),
Map.Animation.NONE);
map.setZoomLevel((map.getMaxZoomLevel() + map.getMinZoomLevel()) / 2);
map.setOrientation(0);
map.setTilt(0);
// Reset the map scheme to the initial scheme
map.setMapScheme(initial_scheme);
}
}
9.
Press the key combination Ctrl + F11 within Eclipse to run this extended basic HERE SDK for
Android application.
Result: Your HERE SDK for Android application displays a map centered initially on the Vancouver
municipal region, plus a "Go Home" button near the top-left corner that allows users to reset the map to
its initial view.
Add a "Change Map Scheme" Button
This task introduces the following HERE SDK for Android class methods:
•
com.here.android.mpa.mapping.Map.getMapScheme()
•
com.here.android.mpa.mapping.Map.getMapSchemes()
•
com.here.android.mpa.mapping.Map.setMapScheme()
HERE SDK for Android Developer's Guide
► Quick Start
21
There are numerous map schemes available from HERE SDK for Android. You can add a UI element to
your application that allows users to change the scheme of the map they are viewing.
Add a "Change Map Scheme" Button element to the HelloHEREMaps application as follows:
1.
From the Package Explorer, double-click the HelloHEREMaps/res/values/strings.xml file to open
it for editing.
2.
Add the following lines to the group of <string></string> tags:
<string name="label_button_changescheme">Change Map Scheme</string>
3.
From the Package Explorer, double-click the HelloHEREMaps/res/layout/activity_main.xml file
to open it for editing.
4.
Add the following markup directly beneath the homebutton tag but above the <fragment />
tag:
<!-- UI element declaration for "Change Map Scheme" button -->
<android.widget.Button
android:id="@+id/schemebutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_button_changescheme"
android:onClick="changeScheme" />
5.
From the Package Explorer, double-click the HelloHEREMaps/src/
com.mapstutorial.helloheremaps/MainActivity.java file to open it for editing.
6.
Add the following to the import statements near the top of the source file:
import java.util.List;
7.
Add variable declarations for initial_scheme to the top of the MainActivity class,
immediately beneath the declaration for map, as follows:
public class MainActivity extends Activity {
// map embedded in the map fragment
private Map map = null;
// map fragment embedded in this activity
private MapFragment mapFragment = null;
// Initial map scheme, initialized in onCreate() and accessed in goHome()
private static String initial_scheme = "";
@Override
public void onCreate(Bundle savedInstanceState) {
...
HERE SDK for Android Developer's Guide
► Quick Start
8.
22
Create function private void onMapFragmentInitializationCompleted() and move all
the existing text within OnEngineInitListener's onEngineInitializationCompleted()
into it:
private void onMapFragmentInitializationCompleted() {
// retrieve a reference of the map from the map fragment
map = mapFragment.getMap();
// Set the map center coordinate to the Vancouver region (no animation)
map.setCenter(new GeoCoordinate(49.196261, -123.004773, 0.0),
Map.Animation.NONE);
// Set the map zoom level to the average between min and max (no
// animation)
map.setZoomLevel((map.getMaxZoomLevel() + map.getMinZoomLevel()) / 2);
}
9.
Update the OnEngineInitListener's onEngineInitializationCompleted()
implementation as follows:
mapFragment.init(new OnEngineInitListener() {
@Override
public void onEngineInitializationCompleted(OnEngineInitListener.Error error) {
if (error == OnEngineInitListener.Error.NONE) {
onMapFragmentInitializationCompleted();
}
...
10. Add the following method to the end of the class:
// Functionality for taps of the "Change Map Scheme" button
public void changeScheme(View view) {
if (map != null) {
// Local variable representing the current map scheme
String current = map.getMapScheme();
// Local array containing string values of available map schemes
List<String> schemes = map.getMapSchemes();
// Local variable representing the number of available map schemes
int total = map.getMapSchemes().size();
if (initial_scheme.isEmpty())
{
//save the initial scheme
initial_scheme = current;
}
// If the current scheme is the last element in the array, reset to
// the scheme at array index 0
if (schemes.get(total - 1).equals(current))
map.setMapScheme(schemes.get(0));
else {
// If the current scheme is any other element, set to the next
// scheme in the array
for (int count = 0; count < total - 1; count++) {
if (schemes.get(count).equals(current))
map.setMapScheme(schemes.get(count + 1));
}
}
}
}
HERE SDK for Android Developer's Guide
► Quick Start
23
11. To ensure that a tap of the "Go Home" button resets the map scheme while it is resetting
everything else (coordinates, zoom level, etc.), add the following lines to the end of the
goHome() method:
// Reset the map scheme to the initial scheme
if (!initial_scheme.isEmpty()) {
map.setMapScheme(initial_scheme);
}
12. Press the key combination Ctrl + F11 within Eclipse to run this extended basic HERE SDK for
Android application.
Result: Your HERE SDK for Android application displays a map centered initially on the Vancouver
municipal region, plus a "Go Home" button near the top-left corner that allows users to reset the
map to its initial view, followed by a "Change Map Scheme" button that allows users to cycle through
available map schemes.
See folder ExtendedBasicMapSolution for a completed example. You will need to add your own
App_Id and App_Code for this completed example to work.
Adding Route Calculation to the Simple Application
An important feature of many map-based applications is offering directions to users by calculating
a route that can be rendered on the map. This tutorial lesson introduces the addition of such
functionality to applications developed using the HERE SDK for Android.
Getting Started
You can import the Android project from the BasicMapSolution folder as a starting point for this
exercise. (Please note that MainActivity is changed to BasicMapActivity in this version of the
project.)
Note: The tasks presented on this page assume that you gave the name "HelloHEREMaps" to
your Eclipse project and the name com.mapstutorial.helloheremaps to your application
package.
Add a "Get Directions" Button
Add a "Get Directions" Button element to the HelloHEREMaps application as follows:
1.
From the Package Explorer, double-click the HelloHEREMaps/res/values/strings.xml file to open
it for editing.
HERE SDK for Android Developer's Guide
► Quick Start
2.
24
Add the following lines to the existing group of strings
<string name="label_button_getdirections">
Get Directions
</string>
<string name="textview_routecoordinates_2waypoints">
Press "Get Directions" button to calculate a route:\nStart: Nokia,
Burnaby\nEnd: Airport, YVR
</string>
3.
From the Package Explorer, double-click the HelloHEREMaps/res/layout/activity_main.xml file
to open it for editing.
4.
Add the following markup directly beneath the LinearLayout tag:
<!-- UI element declaration for "Get Directions" button -->
<android.widget.Button
android:id="@+id/directionsbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_button_getdirections"
android:onClick="getDirections" />
5.
Next, change the <TextView/> tag to the following:
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/textview_routecoordinates_2waypoints"
tools:context=".MainActivity" />
6.
From the Package Explorer, double-click the HelloHEREMaps/src/
com.mapstutorial.helloheremaps/MainActivity.java file to open it for editing.
7.
Add the following lines to the import statements near the top of the source file:
import
import
import
import
import
import
import
import
import
import
import
8.
java.util.EnumSet;
java.util.List;
android.view.View;
android.widget.TextView;
android.widget.Toast;
com.here.android.mpa.common.GeoBoundingBox;
com.here.android.mpa.mapping.MapRoute;
com.here.android.mpa.routing.RouteManager;
com.here.android.mpa.routing.RouteOptions;
com.here.android.mpa.routing.RoutePlan;
com.here.android.mpa.routing.RouteResult;
Add the declaration of these private member variables above the onCreate function:
// TextView for displaying the current map scheme
private TextView textViewResult = null;
// MapRoute for this activity
HERE SDK for Android Developer's Guide
► Quick Start
25
private MapRoute mapRoute = null;
and to set up the member variables for use later, add these lines at the end of the onCreate
function:
textViewResult = (TextView) findViewById(R.id.title);
textViewResult.setText(R.string.textview_routecoordinates_2waypoints);
9.
Add code to handle the click of the "Get Directions" button at the end of the class: First, create
an implementation of the RouteManagerEventListener:
private RouteManager.Listener routeManagerListener =
new RouteManager.Listener()
{
public void onCalculateRouteFinished(RouteManager.Error errorCode,
List<RouteResult> result) {
if (errorCode == RouteManager.Error.NONE &&
result.get(0).getRoute() != null) {
// create a map route object and place it on the map
mapRoute = new MapRoute(result.get(0).getRoute());
map.addMapObject(mapRoute);
// Get the bounding box containing the route and zoom in
GeoBoundingBox gbb = result.get(0).getRoute().getBoundingBox();
map.zoomTo(gbb, Map.Animation.NONE,
Map.MOVE_PRESERVE_ORIENTATION);
textViewResult.setText(
String.format("Route calculated with %d maneuvers.",
result.get(0).getRoute().getManeuvers().size()));
} else {
textViewResult.setText(
String.format("Route calculation failed: %s",
errorCode.toString()));
}
}
public void onProgress(int percentage) {
textViewResult.setText(
String.format("... %d percent done ...", percentage));
}
};
Next, add the implementation of getDirections() below:
// Functionality for taps of the "Get Directions" button
public void getDirections(View view) {
// 1. clear previous results
textViewResult.setText("");
if (map != null && mapRoute != null) {
map.removeMapObject(mapRoute);
mapRoute = null;
}
// 2. Initialize RouteManager
RouteManager routeManager = RouteManager.getInstance();
// 3. Select routing options via RoutingMode
RoutePlan routePlan = new RoutePlan();
RouteOptions routeOptions = new RouteOptions();
routeOptions.setTransportMode(RouteOptions.TransportMode.CAR);
HERE SDK for Android Developer's Guide
► Quick Start
26
routeOptions.setRouteType(RouteOptions.Type.FASTEST);
routePlan.setRouteOptions(routeOptions);
// 4. Select Waypoints for your routes
// START: Nokia, Burnaby
routePlan.addWaypoint(new GeoCoordinate(49.1966286, -123.0053635));
// END: Airport, YVR
routePlan.addWaypoint(new GeoCoordinate(49.1947289, -123.1762924));
// 5. Retrieve Routing information via RouteManagerListener
RouteManager.Error error =
routeManager.calculateRoute(routePlan, routeManagerListener);
if (error != RouteManager.Error.NONE) {
Toast.makeText(getApplicationContext(),
"Route calculation failed with: " + error.toString(),
Toast.LENGTH_SHORT)
.show();
}
};
10. Save all files in the HelloHEREMaps project by selecting File > Save All or by pressing the key
combination Shift + Ctrl + S (within Eclipse).
11. Press the key combination Ctrl + F11 within Eclipse to run this HERE SDK for Android application
with route calculation functionality.
Result: your HERE SDK for Android application displays a map centered initially on the Vancouver
municipal region, with a "Get Directions" button and a text box reflecting current status. Tapping on
the button will trigger a route calculation for the hard-coded set of waypoints between Burnaby and
Airport, YVR and render, and have the route displayed on map if successful.
See the SimpleRoutingSolution folder for a completed example. You will need to add your own
App_Id and App_Code for this completed example to work.)
HERE SDK for Android Developer's Guide
► User Guide
27
Chapter
3
User Guide
Topics:
•
Authenticating Applications
•
Obfuscating Applications
•
Maps
•
Places
•
Directions
The articles in this section provide a guide to using the HERE SDK
for Android.
HERE SDK for Android Developer's Guide
► User Guide
28
Authenticating Applications
All applications using the HERE SDK must have a valid App_Id and App_Code in the application.
App_Id and App_Code are unique to an application name space. To obtain these credentials, please
contact your HERE account representative.
You can add the App_Id and App_Code as <meta-data/> attributes to the ApplicationManifest.xml
file of your application as follows:
1.
Open the Eclipse project that you created as one of the Quick Start Guide tasks.
2.
From the Package Explorer, double-click your project's AndroidManifest.xml file to open it for
editing (switch to text editor mode for the file).
3.
Within the <application></application> block of tags, add the following markup:
<meta-data android:name="com.here.android.maps.appid"
android:value="YOUR APP ID"/>
<meta-data android:name="com.here.android.maps.apptoken"
android:value="YOUR APP CODE"/>
4.
Replace the YOUR APP ID and YOUR APP CODE strings with appropriate credentials for your
application.
Obfuscating Applications
If you would like to use ProGuard to obfuscate your application, you must add HERE SDK-specific
options (in addition to your application options) to ensure that the HERE library is not further
obfuscated.
Typically, the ProGuard rules are specified through the proguard.config variable inside the
project.properties file, similar to the following:
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguardproject.txt
To add the HERE SDK-specific options, include the ProGuard configuration file (proguard-heresdk.txt) that is in the HERE SDK package by appending the filename to the proguard.config
variable. For example:
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguardproject.txt:proguard-here-sdk.txt
HERE SDK for Android Developer's Guide
► User Guide
29
For more information on modifying your application's ProGuard configuration, refer to the ProGuard
section of the Android Developer website.
Maps
The core feature of the HERE SDK for Android is Maps. The key concepts covered in this section
include adding a map to the Android application, changing the location displayed by the map and
its various properties. The classes covered include MapFragment and Map. MapFragment and
Map are parts of a Model-View-Controller (MVC) pattern where the Model is the Map, and the View
is the MapFragment. The MapFragment is a standard Android Fragment derived component. The
developer can create a controller class to coordinate all interactions using custom logic.
The first step to integrate a map into an application is to insert a MapFragment to the view layout of
the application. This is accomplished by adding com.here.android.mpa.mapping.MapFragment
to the Android XML layout file as follows.
<!-- Example fragment. This can be integrated and annotated
like any other android Fragment or View widget -->
<fragment
class="com.here.android.mpa.mapping.MapFragment"
android:id="@+id/mapfragment"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
The MapFragment class handles all user interactions such as panning, tapping or pinching, as well as
other standard HERE SDK touch gestures documented in MapGestures.
Initializing MapFragment
After adding the MapFragment to the layout, the fragment must be initialized. The MapFragment
initialization is processed asynchronously. During initialization, the MapEngine will be
initialized to create an instance of Map that will be associated with the MapFragment. The
MapFragment.init(OnEngineInitListener) method takes in an OnEngineInitListener
input parameter to signal the caller when initialization is completed and if it was successful. The
MapFragment also initializes a MapEngine instance and creates a Map object associated with the
MapFragment. The following code illustrates the basic initialization flow when an Activity is
created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Search for the Map Fragment
HERE SDK for Android Developer's Guide
► User Guide
30
final MapFragment mapFragment = (MapFragment)
getFragmentManager().findFragmentById(R.id.mapfragment);
// initialize the Map Fragment and
// retrieve the map that is associated to the fragment
mapFragment.init(new OnEngineInitListener() {
@Override
public void onEngineInitializationCompleted(
OnEngineInitListener.Error error) {
if (error == OnEngineInitListener.Error.NONE) {
// now the map is ready to be used
map = mapFragment.getMap();
} else {
System.out.println("ERROR: Cannot initialize
MapFragment");
}
}
});
}
Note: For performance reasons, com.here.android.mpa.mapping.MapFragment has set
Fragment.setRetainInstance(boolean) to true, and therefore onCreate(Bundle)
will not be called again when Activity is re-created (for example, after an orientation
change).
Note: The MapFragment class provides an asynchronous method,
getScreenCapture(OnScreenCaptureListener), for creating map snapshots of
the currently visible MapFragment area. When the snapshot has been created, an event
callback to OnScreenCaptureListener occurs, and the screenshot will be provided as an
android.graphics.Bitmap object. This method of screen capture only works if the view is
in the foreground and it is rendering. If a background or viewless screen capture is required,
use MapOffscreenRenderer.
Working with Map
Once the MapFragment is initialized, you get the Map associated with the MapFragment through
MapFragment.getMap(). The Map class represents the virtual model of the world in a digital
format. The map is rendered using Mercator projection. Key attributes of the Map include the center
GeoCoordinate, zoom level, orientation, and tilt. For example, the following code snippet illustrates
how to use Map.setCenter(GeoCoordinate, Map.Animation) to render the Map at Vancouver,
Canada.
// map fragment has been successfully initialized
...
// now the map is ready to be used
Map map = mapFragment.getMap();
// Set the map center to Vancouver, Canada.
map.setCenter(new GeoCoordinate(49.196261,
-123.004773), Map.Animation.NONE);
HERE SDK for Android Developer's Guide
► User Guide
31
...
In the preceding code:
•
•
The GeoCoordinate for the map center is created by a call to the new
GeoCoordinate(double, double) constructor.
When setting the center of a map, there is an option either to animate the change or to suppress
animation by passing the constant Map.Animation.NONE as the relevant parameter.
Center, Zoom, Tilt, and Orientation
Here are some examples to set and get attributes of the Map:
Map Center
The center of the Map is a GeoCoordinate location that your Map is focused on. You can move a
Map by redefining its center GeoCoordinate:
// Move the map to London.
map.setCenter( new GeoCoordinate(51.51,-0.11),
Map.Animation.NONE );
// Get the current center of the Map
GeoCoordinate coordinate = map.getCenter();
Zoom Level
The size of the geographical area displayed by Map can be controlled by changing the zoom level. The
zoom level ranges from getMinZoomLevel() to getMaxZoomLevel(), with the minimum value
displaying the entire world. The following code sets the zoom level to the median zoom level.
// Get the maximum,minimum zoom level.
double maxZoom = map.getMaxZoomLevel();
double minZoom = map.getMinZoomLevel();
// Set the zoom level to the median (10).
map.setZoomlevel((maxZoom + minZoom)/2);
// Get the zoom level back
double zoom = map.getZoomLevel();
Orientation
The map can be orientated freely in any direction. By default, the orientation is in a true North
position. The following code will change the orientation to South-up.
// Rotate 180 degrees.
map.setOrientation(180);
// Get the orientation, should be 180.
HERE SDK for Android Developer's Guide
► User Guide
float orientation = map.getOrientation();
Tilt
The map can be tilted and rendered in a three-dimensional perspective. By default, the tilt
is completely flat. You can retrieve the minimum and maximum possible tilt values by calling
getMinTilt() and getMaxTilt()
// Set the tilt to 45 degrees
map.setTilt(45);
// Get the tilt
float tilt = map.getTilt();
Animations
The map supports three types of animations when changing attributes:
•
•
•
Map.Animation.NONE
Map.Animation.LINEAR
Map.Animation.BOW
Note: If the map changes size or the app comes to the foreground while
Map.Animation.LINEAR or Map.Animation.BOW is being used in a Map attribute setter
method, then the animation will abort, and the transition will appear as failed. To avoid this
behavior, use the Map.Animation.NONE animation type or wait until the map is stable
before performing the transition operation.
// Rotate 90 degrees using a linear animation
map.setOrientation(90, Map.Animation.LINEAR);
// Move to Vancouver using bow animation
map.setCenter(new GeoCoordinate(49.0,-123.0),
Map.Animation.BOW);
Setting Multiple Attributes
Map.setCenter(GeoCoordinate point, Animation animation, double level,
float orientation, float tilt) is an extended API provided for changing one or
more attributes at the same time. The zoom level, tilt and perspective can be preserved and
unchanged using Map.MOVE_PRESERVE_ZOOM_LEVEL, Map.MOVE_PRESERVE_ORIENTATION,
Map.MOVE_PRESERVE_TILT respectively.
// Move to Vancouver using a bow animation, zoom level 17, 180
//degree orientation and 45 degree tilt.
map.setCenter(new GeoCoordinate(49.0,-123.0),
Map.Animation.BOW, 17.0d, 180, 45);
32
HERE SDK for Android Developer's Guide
► User Guide
33
Map Projection Mode
By default, the map is set to a globe projection mode. You can change it to use Mercator or
equirectangular projection by calling setProjectionMode(Projection). For example:
map.setProjectionMode(Map.Projection.MERCATOR);
It may be useful to set the projection modes when you need to predictably display certain types of
map information, such as custom raster tiles.
Figure 1: Globe Projection
Figure 2: Equirectangular Projection
Figure 3: Mercator Projection
MapState and Listening for Map Transform Events
MapState is an object which is a composite of the tilt, orientation, zoom level and center
map attributes. Your application can listen for updates to the MapState by using an
OnTransformListener.
Map transform events are triggered by any operation which causes the MapState to change.
These operations include user interaction (for example, map gestures) as well as programmatic
calls to the Map (for example, map.setCenter(GeoCoordinate, MapAnimation)). The
onMapTransformStart() method is called before MapState begins to change, while the
onMapTransformEnd(MapState) method is called after the MapState returns to a steady value.
Because of this, there can be a significant amount of time between the two callbacks in cases such as
animated map movement events and continuous user interaction.
The following code is an example of registering an OnTransformListener to listen for map
transform events:
map.addTransformListener(new OnTransformListener() {
@Override
public void onMapTransformStart() {
// map transform is about to start
HERE SDK for Android Developer's Guide
► User Guide
34
}
@Override
public void onMapTransformEnd(MapState mapState) {
// map transform has come to an end
}
});
If you need to update UI widgets as the MapState changes between these two callbacks, the
recommended approach is to trigger a Runnable when onMapTransformStart() is called,
which periodically checks (at no more than 30 frames per second) the current map state via
map.getMapState() and updates the UI widgets accordingly. This Runnable can then be canceled
upon a call to onMapTransformEnd(MapState). An Android Handler can be used to trigger these
Runnable objects.
Note: Do not update UI widgets in MapRenderListener.onPostDraw(boolean, long),
as this method is frequently called.
Pedestrian Features
By default, icons that indicate pedestrian access features (such as stairs or escalators)
are not displayed on the map. To display a pedestrian feature on the map view, call the
Map.setPedestrianFeaturesVisible(EnumSet) method with the desired set of
PedestrianFeature. To find out whether a feature type is currently enabled, call the
Map.getPedestrianFeaturesVisible() method.
Figure 4: Pedestrian Feature Icons
HERE SDK for Android Developer's Guide
► User Guide
35
Map Gestures
The MapGesture interface encapsulates all user interactions and touch gestures supported by the
HERE SDK for Android. The MapGesture associated with a particular fragment can be retrieved from
MapFragment.getMapGesture(). The default behavior of the map for each gesture type may
be used as-is, supplemented, or replaces entirely. The following table is a summary of the available
gestures and their default behavior.
To zoom the map in a fixed amount, tap the screen twice with one finger
To zoom out a fixed amount, tap the screen with two fingers
To move the map, press and hold one finger to the screen, and move it in any direction.
To tilt the map, press and hold two fingers to the screen, and move them in a vertical direction. No
behavior is predefined for other directions.
To pan the map kinetically, press and swipe one finger on the screen. The map will continue to move in
the same direction, and gradually slow to a stop.
HERE SDK for Android Developer's Guide
► User Guide
36
To zoom in or out continuously, press and hold two fingers to the screen, and increase or decrease the
distance between them
To rotate the map, press and hold two fingers to the screen, and rotate them around each other
Tap the screen with one finger. This gesture does not have a predefined map action.
Press and hold one finger to the screen. This gesture does not have a predefined map action.
The OnGestureListener Interface
The OnGestureListener interface represents a listener to provide notification upon completion of
a Map gesture event such as a single tap on a map.
To use a OnGestureListener in the basic application that you are creating as a compendium to this
guide, you can create a new OnGestureListener(), as illustrated below.
// Map gesture listener
private class MyOnGestureListener implements OnGestureListener {
@Override
public void onPanStart() {
}
@Override
public void onPanEnd() {
}
@Override
public void onMultiFingerManipulationStart() {
}
@Override
public void onMultiFingerManipulationEnd() {
HERE SDK for Android Developer's Guide
► User Guide
37
}
@Override
public boolean onMapObjectsSelected(List<ViewObject> objects) {
return false;
}
@Override
public boolean onTapEvent(PointF p) {
return false;
}
@Override
public boolean onDoubleTapEvent(PointF p) {
return false;
}
@Override
public void onPinchLocked() {
}
@Override
public boolean onPinchZoomEvent(float scaleFactor, PointF p) {
return false;
}
@Override
public void onRotateLocked() {
}
@Override
public boolean onRotateEvent(float rotateAngle) {
return false;
}
@Override
public boolean onTiltEvent(float angle) {
return false;
}
@Override
public boolean onLongPressEvent(PointF p) {
return false;
}
@Override
public void onLongPressRelease() {
}
@Override
public boolean onTwoFingerTapEvent(PointF p) {
return false;
}
}
To add the listener to your map, include a call to addOnGestureListener(OnGestureListener)
after the map fragment has been successfully initialized as follows:
...
mapFragment.init(new OnEngineInitListener() {
@Override
public void onEngineInitializationCompleted(OnEngineInitListener.Error
error) {
if (error == OnEngineInitListener.Error.NONE) {
// map fragment has been successfully initialized
HERE SDK for Android Developer's Guide
► User Guide
38
mapFragment.getMapGesture().addOnGestureListener(new
MyOnGestureListener());
}
}
});
...
Note: After you add an OnGestureListener to an application, remember to call
removeOnGestureListener(OnGestureListener) when you no longer need to listen for
map events to free up application resources.
The default implementation of a OnGestureListener in your basic application will not affect any
of the standard HERE SDK touch gestures. Each method within the MyOnGestureListener class
returns a value of false, which stipulates that the application should not override the underlying
action that a device will perform upon detecting a particular gesture.
If you want to customize an action that your application will perform upon detection of a
particular gesture, you must include appropriate commands within a relevant method of the
MyOnGestureListener class and return a value of true to override the default action, as
illustrated below with revisions to the onTwoFingerTapEvent(PointF) method.
@Override
public boolean onTwoFingerTapEvent(PointF p) {
// Reset the map view to its initial parameters
double level = map.getMinZoomLevel() + map.getMaxZoomLevel() / 2;
map.setCenter(new GeoCoordinate(49.196261, -123.004773),
Map.Animation.NONE);
map.setZoomLevel(level);
map.setOrientation(0);
map.setTilt(0);
return true;
}
Note: Since the onTapEvent(PointF) event is always triggered before the
onMapObjectsSelected(List<ViewObject>) event, you can leverage this behavior
to implement your own object selection logic. While implementing object selection,
it is recommended that you use both Map.getSelectedObject(PointF) and
Map.getSelectedObject(ViewRect) and combine the results, so that the user's tap input
is interpreted over a larger area, rather than only a single point.
After the revision, the basic application will respond to each two-finger tap gesture by returning to its
initial view (the view displayed upon application launch). Other touch gestures will continue to trigger
standard HERE SDK actions.
Map Schemes
The HERE SDK for Android provides a variety of map appearances for your application to choose
from, these appearances are otherwise known as map schemes.
HERE SDK for Android Developer's Guide
► User Guide
Map.Scheme defines visualization types that the HERE map service supports. There is a variety of
map schemes available that can be used, based on the specific use case:
•
Explore - Normal, Terrain, Pedestrian
•
Overlays - Grey, Transit, Reduced, Traffic
You can set a desired scheme by making a call to the Map.setMapScheme(String) method.
39
HERE SDK for Android Developer's Guide
► User Guide
Examples of Map Scheme
All available schemes are defined as constant strings in the Map.Scheme class. The following are
examples of string values that you can use to set the map scheme in your application:
Figure 5: Scheme.NORMAL_DAY
Figure 6: Scheme.SATELLITE_DAY
Figure 7: Scheme.HYBRID_DAY
Figure 8: Scheme.HYBRID_DAY_TRANSIT
40
HERE SDK for Android Developer's Guide
► User Guide
Note: In addition to the preceding schemes, Scheme.SATELLITE_NIGHT is also available. It
is similar to Scheme.SATELLITE_DAY, but the color of the sky is different when the map is
tilted.
Figure 9: Scheme.NORMAL_NIGHT
Figure 10: Scheme.NORMAL_NIGHT_TRANSIT
Figure 11: Scheme.TERRAIN_DAY
Figure 12: Scheme.NORMAL_DAY_TRANSIT
41
HERE SDK for Android Developer's Guide
► User Guide
42
Example Setting Map Scheme
Here's an example to demonstrate how to retrieve available map schemes and change the current
map scheme:
// Array containing string values of all available map schemes
List<String> schemes = map.getMapSchemes();
// Assume to select the 2nd map scheme in the available list
map.setMapScheme(schemes.get(1));
Listening for MapScheme Change Events
Applications can listen for map scheme change events by way of the
Map.OnSchemeChangedListener:
map.addSchemeChangedListener(new OnSchemeChangedListener() {
@Override
public void onMapSchemeChanged(String mapScheme) {
// react to map scheme change here
}
});
MapEngine Class
MapEngine is a singleton class used to manage active mapping resources for use in applications
developed with the HERE SDK. MapEngine must be initialized before Map and map-related objects,
such as MapMarker, RouteManager, and Places, can be instantiated and retrieved from the API. A
runtime exception will occur if MapEngine is not properly initialized before map-related objects are
used.
Initialization
MapEngine must be initialized before it can be used. MapEngine is automatically initialized
for your application by using either MapFragment or MapActivity. MapActivity is an
Activity class created for developers that do not need to display any maps in their application,
but would like to use the HERE SDK for Android headless APIs for operations such as Search
or Route calculations. MapFragment is a fragment class that applications can use as an UI
module in an activity for map display. For more information, see MapFragment and MapActivity.
However, if your application uses neither MapFragment or MapActivity classes, then
the application should initialize the MapEngine before using any HERE APIs. This is done by
MapEngine.init(OnEngineInitListener) API as shown below:
MapEngine mapEngine = MapEngine.getInstance(context);
HERE SDK for Android Developer's Guide
► User Guide
43
mapEngine.init(context, new OnEngineInitListener() {
@Override
public void onEngineInitializatonCompleted(Error error) {
if (error == OnEngineInitListener.Error.NONE) {
// Post initialization code goes here
} else {
// handle factory initialization failure
}
}
});
For examples of typical scenarios using the MapFragment that automatically initializes the
MapEngine, see Maps on page 29.
Map Objects and User Interaction
You can select ViewObject objects by using a single tap gesture. To enable
this in your code, create an OnGestureListener object and pass it to
MapFragment.addMapGestureListener(OnGestureListener). When a single tap occurs, the
listener will receive the onTapEvent(PointF) callback, and if that event is not handled, then the
listener will receive the onMapObjectsSelected(List<ViewObject>) callback. The application
can then define what to do with the selected ViewObject.
Types of ViewObject objects that are selectable are defined within the ViewObject.Type
enumeration, which includes:
•
•
•
USER_OBJECT - an object that the application adds to a map with a MapObject base class
(MapPolygon for example).
PROXY_OBJECT - an object that is added automatically to a map with a MapProxyObject base
class. A proxy object may contain special information about the object, depending on the type
(for example, TransitStopObject may provide transit stop-related information), but it cannot
be created or modified.
UNKNOWN_OBJECT - a selectable map object that is neither a USER_OBJECT nor a
PROXY_OBJECT
The ViewObject Abstract Class
The ViewObject abstract class represents the base implementation for all objects that are
selectable on a MapView or MapFragment. The MapFragment features user-selectable objects.
Sub-classes of the ViewObject class include:
•
•
MapObject
MapProxyObject
HERE SDK for Android Developer's Guide
► User Guide
44
MapObject and Geo Objects
MapObject represents an abstract class for all map-related objects that can be added on a Map. The
subclasses of this abstract class include:
•
•
•
•
•
•
•
•
•
•
MapContainer
MapCircle
MapPolyline
MapPolygon
MapRoute
MapMarker
MapLocalModel
MapGeoModel
MapLabeledMarker
MapScreenMarker
These objects can be created by calling the appropriate constructor methods with a geo object.
Geo objects (for example, GeoPolyline and GeoPolygon) are geographical data representations
that act as models to MapObjects, which act as views. Unlike map objects, geo objects cannot be
added directly to a Map. For more information on geo objects and creating map objects, see the API
Reference.
The following code snippet demonstrates how to create a MapPolyline and a GeoPolyline object:
List<GeoCoordinate> testPoints = new ArrayList<GeoCoordinate>();
testPoints.add(new GeoCoordinate(49.163, -123.137766, 10));
testPoints.add(new GeoCoordinate(59.163, -123.137766, 10));
testPoints.add(new GeoCoordinate(60.163, -123.137766, 10));
GeoPolyline polyline = new GeoPolyline(testPoints);
MapPolyline mapPolyline = new MapPolyline(polyline);
To add a MapObject to the map, use Map.addMapObject(MapObject)
or Map.addMapObjects(List<MapObject>). You can use the
setOverlayType(MapOverlayType) method to set the display layer that this map object will be
rendered. By default, map objects are assigned to the foreground.
MapContainer
You can use MapContainer as a container for other MapObject instances. Map containers
determine the stacking order of objects displayed on a map. To add a map object, call the
MapContainer.addMapObject(MapObject) method.
Note: MapRoute and MapContainer cannot be added to a MapContainer.
Note: If a map object is a part of a MapContainer, it will have the same MapOverlayType as
the map container.
HERE SDK for Android Developer's Guide
► User Guide
MapCircle
A MapCircle represents a type of MapObject in the shape of a circle, with an assigned
radius distance and a GeoCoordinate center. It can be created by calling the constructor
MapCircle(double radius, GeoCoordinate center).
Figure 13: A MapCircle object
45
HERE SDK for Android Developer's Guide
► User Guide
46
MapPolyline
A MapPolyline is a MapObject in the shape of a polyline with anchor points at any number of
GeoCoordinate points. It can be created via a GeoPolyline object, which can be created by calling
the GeoPolyline(List<GeoCoordinate> points) constructor.
Figure 14: A MapPolyline object
MapPolygon
A MapPolygon is a MapObject in the shape of a polygon. In contrast with a MapPolyline, it is
assumed that the last coordinate in the line's path is connected to the first coordinate, thereby
constructing an enclosed geometry. A MapPolygon may define separate border and fill colors. To
HERE SDK for Android Developer's Guide
► User Guide
47
create a MapPolygon, use the constructor MapPolygon(GeoPolygon polygon). A GeoPolygon
can be created by calling GeoPolygon(List<GeoCoordinate> points).
Figure 15: A MapPolygon object
MapRoute
A MapRoute is a MapObject that displays a calculated route on a map. For more information on
MapRoute, see Routing.
HERE SDK for Android Developer's Guide
► User Guide
48
MapMarker
A MapMarker is a MapObject that displays an icon at a geographical position on a map. You can
create a MapMarker with your own custom icon by calling MapMarker(GeoCoordinate, Image).
Figure 16: A MapMarker object
MapLabeledMarker
A MapLabeledMarker is a different type of marker object that avoids overlapping with other icons
and text on the map. By default, the visual appearance of a MapLabeledMarker is similar to a point
HERE SDK for Android Developer's Guide
► User Guide
49
of interest. You can choose a preset category icon (for example, IconCategory.ZOO) or set your
own Image as the marker icon.
Figure 17: A MapLabeledMarker object
Unlike MapMarker, setting the label text to a MapLabeledMarker does not require enabling an
info bubble. You can set the marker label text by providing a language and a localized string to
the MapLabeledMarker.setLabelText(String, String) method. The localized text in the
language that matches the current Map.getMapDisplayLanguage(), if available, will be displayed.
Otherwise, the first added localized text will be displayed instead.
Note: Although a MapLabeledMarker is visually similar to a point of interest, its overlay type
is set to FOREGROUND_OVERLAY by default.
MapLocalModel
A MapLocalModel is an arbitrary 3D map object that is drawn using a local coordinate (as opposed
to a geocoordinate) mesh. You can create a custom MapLocalModel by calling MapLocalModel(),
and setting the model mesh, texture, orientation, and geographical location before adding it to the
map. For example:
FloatBuffer buff = FloatBuffer.allocate(12); // Two triangles
buff.put(0- delta);
buff.put(0- delta);
buff.put(1.f);
buff.put(0 + delta);
buff.put(0 - delta);
buff.put(1.f);
buff.put(0 - delta);
buff.put(0 + delta);
buff.put(1.f);
buff.put(0 + delta);
buff.put(0 + delta);
buff.put(1.f);
HERE SDK for Android Developer's Guide
► User Guide
// Two triangles to generate the rectangle. Both front and back face
IntBuffer vertIndicieBuffer = IntBuffer.allocate(12);
vertIndicieBuffer.put(0);
vertIndicieBuffer.put(2);
vertIndicieBuffer.put(1);
vertIndicieBuffer.put(2);
vertIndicieBuffer.put(3);
vertIndicieBuffer.put(1);
vertIndicieBuffer.put(0);
vertIndicieBuffer.put(1);
vertIndicieBuffer.put(2);
vertIndicieBuffer.put(1);
vertIndicieBuffer.put(3);
vertIndicieBuffer.put(2);
// Texture coordinates
FloatBuffer textCoordBuffer = FloatBuffer.allocate(8);
textCoordBuffer.put(0.f);
textCoordBuffer.put(0.f);
textCoordBuffer.put(1.f);
textCoordBuffer.put(0.f);
textCoordBuffer.put(0.f);
textCoordBuffer.put(1.f);
textCoordBuffer.put(1.f);
textCoordBuffer.put(1.f);
LocalMesh myMesh = new LocalMesh();
mesh.setVertices(buff);
mesh.setVertexIndices(vertIndicieBuffer);
mesh.setTextureCoordinates(textCoordBuffer);
MapLocalModel myObject = new MapLocalModel();
myObject.setMesh(myMesh); //a LocalMesh object
myObject.setTexture(myImage); //an Image object
myObject.setAnchor(myLocation); //a GeoCoordinate object
myObject.setScale(20.0f);
myObject.setDynamicScalingEnabled(true);
myObject.setYaw(45.0f);
map.addMapObject(myObject);
Note: While translating the 3D model mesh to the map, a unit of 1.0f represents 1 meter
in the real world. For example, a Vector3f(100,200,300) represents an offset of +100
meters in the x-axis (East), +200 meters in the y-axis (North), and +300 meters in the z-axis
50
HERE SDK for Android Developer's Guide
► User Guide
51
direction (Up). You can further control the size of the 3D model mesh by setting a scaling
factor with the setScale() method.
Figure 18: A MapLocalModel object
Aside from setting a texture, a MapLocalModel can also be customized by setting its material and
lighting using the Phong reflection model. For example, the following code sets the ambient color,
diffuse color, and light source to the MapLocalModel.
// This light shines from above in the Z axis
DirectionalLight light = new DirectionalLight(new Vector3f(0, 0.5f, 1));
m_model.addLight(light);
// Give this a default color
PhongMaterial mat = new PhongMaterial();
mat.setAmbientColor(0xffffffff);
mat.setDiffuseColor(0x00000000);
m_model.setMaterial(mat);
MapGeoModel
A MapGeoModel is an arbitrary 3D map object that is drawn using geocoordinate verticies. You can
create a MapGeoModel by calling its constructor and setting a list of geocoordinates, a list indicating
the vertex order, a list of UV coordinates, and a texture Image. For example:
List<GeoCoordinate> myLocations = Arrays.asList(
new GeoCoordinate(37.783409, -122.439473),
new GeoCoordinate(37.785444, -122.424667),
new GeoCoordinate(37.774149, -122.429345));
// vertices must be specified in a counter-clockwise manner
IntBuffer vertIndicieBuffer = IntBuffer.allocate(3);
HERE SDK for Android Developer's Guide
► User Guide
52
vertIndicieBuffer.put(0);
vertIndicieBuffer.put(2);
vertIndicieBuffer.put(1);
FloatBuffer textCoordBuffer = FloatBuffer.allocate(6);
textCoordBuffer.put(0.5f);
textCoordBuffer.put(0.5f);
textCoordBuffer.put(0.5f);
textCoordBuffer.put(0.5f);
textCoordBuffer.put(0.5f);
textCoordBuffer.put(0.5f);
GeoMesh meshy = new GeoMesh();
meshy.setVertices(myLocations);
meshy.setVertexIndices(vertIndicieBuffer);
meshy.setTextureCoordinates(textCoordBuffer);
MapGeoModel myGeoModel = new MapGeoModel();
myGeoModel.setMesh(meshy);
myGeoModel.setTexture(myTexture);
As with MapLocalModel, you can also set the lighting and color properties for a MapGeoModel using
the addLight(DirectionalLight) and setMaterial(PhongMaterial) methods.
Figure 19: A MapGeoModel object
User Interactions with MapObject
This section provides an example on handling MapObject tap events. In the following code:
•
•
addMapObject() adds the object on the Map.
List<ViewObject> holds the objects that have been selected in this tap event. By looping
through this list of objects, your code can find the MapObject that should respond to this tap
event.
HERE SDK for Android Developer's Guide
► User Guide
53
Note: The onMapObjectsSelected(List) callback is triggered after the
onTapEvent(PointF) callback. For more information on this, refer to Map Gestures on page
35
// Create a custom marker image
com.here.android.mpa.common.Image myImage =
new com.here.android.mpa.common.Image();
try {
myImage.setImageResource(R.drawable.my_png);
} catch (IOException e) {
finish();
}
// Create the MapMarker
MapMarker myMapMarker =
new MapMarker(new GeoCoordinate(LAT, LNG), myImage);
map.addMapObject(myMapMarker);
...
// Create a gesture listener and add it to the MapFragment
MapGesture.OnGestureListener listener =
new MapGesture.OnGestureListener.OnGestureListenerAdapter() {
@Override
public boolean onMapObjectsSelected(List<ViewObject> objects) {
for (ViewObject viewObj : objects) {
if (viewObj.getBaseType() == ViewObject.Type.USER_OBJECT) {
if (((MapObject)viewObj).getType() == MapObject.Type.MARKER) {
// At this point we have the originally added
// map marker, so we can do something with it
// (like change the visibility, or more
// marker-specific actions)
((MapObject)viewObj).setVisible(false);
}
}
}
// return false to allow the map to handle this callback also
return false;
}
...
};
Handling MapProxyObject objects
The following code demonstrates how to handle tap events on a MapProxyObject:
•
•
•
The onMapObjectsSelected event of the OnGestureListener listens to object selected. For
more information on OnGestureListener, refer to Map Gestures on page 35.
If the selected object is a PROXY_OBJECT then you can safely cast the ViewObject into a
MapProxyObject.
If the selected object is a USER_OBJECT then you need to find the object using the hash map;
refer to the preceding example.
private MapGesture.OnGestureListener listener =
new MapGesture.OnGestureListener.OnGestureListenerAdapter() {
...
@Override
public boolean onMapObjectsSelected(List<ViewObject> objects) {
for (ViewObject obj : objects) {
switch (obj.getBaseType()) {
HERE SDK for Android Developer's Guide
► User Guide
case PROXY_OBJECT:
MapProxyObject proxyObj = (MapProxyObject) obj;
switch (proxyObj.getType()) {
case TRANSIT_ACCESS:
TransitAccessObject transitAccessObj =
(TransitAccessObject) proxyObj;
Log.d(TAG, "Found a TransitAccessObject");
break;
case TRANSIT_LINE:
TransitLineObject transitLineObj =
(TransitLineObject) proxyObj;
Log.d(TAG, "Found a TransitLineObject");
break;
case TRANSIT_STOP:
TransitStopObject transitStopObj =
(TransitStopObject) proxyObj;
Log.d(TAG, "Found a TransitStopObject");
break;
default:
Log.d(TAG, "ProxyObject.getType() unknown");
}
break;
// User objects are more likely to be handled
// as in the previous example
case USER_OBJECT:
default:
Log.d(TAG,
"ViewObject.getBaseType() is USER_OBJECT or unknown");
break;
}
}
return true;
}
...
};
Transit Information
Your application can use API calls from the HERE SDK for Android to display transit information for
users.
Note: The transit map schemes (NORMAL_DAY_TRANSIT, NORMAL_NIGHT_TRANSIT, and
HYBRID_DAY_TRANSIT) are specifically designed for displaying transit information. You can
opt to use one of these schemes when your app displays transit information.
MapTransitLayer
MapTransitLayer is a layer that displays the available transit data for a map area. To customize
the transit layer, call Map.getMapTransitLayer() to access the methods available through the
MapTransitLayer class. For example, to show all transit information available:
// Assumes map is instantiated
54
HERE SDK for Android Developer's Guide
► User Guide
55
map.getMapTransitLayer().setMode(MapTransitLayer.Mode.EVERYTHING);
Figure 20: MapTransitLayer set to show everything
To show only transit stops and accesses call:
// Assumes map is instantiated
map.getMapTransitLayer().setMode(MapTransitLayer.Mode.STOPS_AND_ACCESSES);
Figure 21: MapTransitLayer set to show only transit stops and accesses
To hide all transit information call:
// Assumes map is instantiated
HERE SDK for Android Developer's Guide
► User Guide
56
map.getMapTransitLayer().setMode(MapTransitLayer.Mode.NOTHING);
Highlighting Transit Objects
The following four types of transit data objects are currently available:
•
Transit Stop data - represented by TransitStopObject
•
Transit Line data - represented by TransitLineObject
•
Transit Access data - represented by TransitAccessObject
•
Transit Line Segment data - represented by TransitLineSegmentObject
Transit objects can be selected through tap gestures. For example, to highlight a single or a group of
TransitLineObject, you need to know the unique identifier of the line objects. Depending on the
use case, there are several ways of getting a single or a list of Identifier objects:
•
•
Call TransitLineObject.getLineId() when user has selected a TransitLineObject by
tapping on it. It returns an Identifier of the currently selected transit line.
Call TransitStopObject.getTransitStopInfo().getLines() when user has selected
a TransitStopObject via tapping. getLines() returns a list of Identifier of the lines
connected to the selected transit stop.
For details of handling tappable MapProxyObjects, see Handling MapProxyObject objects on page
53.
With a single or a list of Identifier objects, you call the following API to highlight the lines:
// Assumes map is instantiated and identifierList is
// filled with a list of Identifiers
HERE SDK for Android Developer's Guide
► User Guide
map.getMapTransitLayer().highlightTransitLines(identifierList);
Figure 22: MapTransitLayer highlighting transit lines connected to the selected transit stop
TransitStopObject
A TransitStopObject is a type of MapProxyObject that contains information about a transit
stop. The following figures show the different types of transit stops:
Figure 23: TransitStopObject: A metro station
Figure 24: TransitStopObject: A ferry station
57
HERE SDK for Android Developer's Guide
► User Guide
58
To acquire information about a tapped TransitStopObject (see Handling MapProxyObject objects
on page 53 ) use onMapObjectsSelected(List<ViewObject>) as in the following:
private MapGesture.OnGestureListener listener = new
MapGesture.OnGestureListener() {
...
@Override
public boolean onMapObjectsSelected(List<ViewObject> objects) {
for (ViewObject obj : objects) {
if (obj.getBaseType() == ViewObject.Type.PROXY_OBJECT) {
MapProxyObject proxyObj = (MapProxyObject) obj;
if (proxyObj.getType() == MapProxyObject.Type.TRANSIT_STOP) {
TransitStopObject transitStopObj
= (TransitStopObject) proxyObj;
Log.d(TAG, "Found a TransitStopObject");
Log.d(TAG, "position is "
+ transitStopObj.getCoordinate().toString());
TransitStopInfo transitStopInfo
= transitStopObj.getTransitStopInfo();
...
}
}
return true;
}
The TransitStopObject provides two methods for getting information about the transit stop:
•
•
getCoordinate() gets the location coordinates of the transit stop.
getTransitStopInfo() gets further information about the transit stop.
TransitStopInfo
The TransitStopInfo class contains transit stop information that is accessed by calling one or
more of the following methods
•
•
•
•
•
getOfficialName() gets the official name of the transit stop
getInformalName() gets the informal name of the transit stop
getId() gets the Identifier of the transit stop
getTransitTypes() gets the transit types this transit stop belongs to, it can be more than
one.
getLines() gets a list of Identifier objects for transit lines connected to this transit stop
Each Identifier is submitted to the TransitDatabase to get further information. For more
details, see TransitDatabase. Also they can be submitted to the MapTransitLayer to get
highlighted on the map. (See MapTransitLayer on page 54)
An example of getting information about the first transit line connected to the transit stop is
provided below. A TransitDatabase.OnGetTransitInfoListener will need to be implemented
to receive the TransitLineInfo. (See TransitLineInfo on page 60)
HERE SDK for Android Developer's Guide
► User Guide
59
An asynchronous request is submitted to the TransitDatabase along with the
OnGetTransitInfoListener.
TransitDatabase.OnGetTransitInfoListener listener
= new TransitDatabase.OnGetTransitInfoListener() {
......
@Override
public void onTransitLineInfo(TransitLineInfo info) {
......
}
// transitStopInfo is a TransitStopInfo object
......
mTransitDatabase.getLineInfo(transitStopInfo.getLines().get(0), listener);
TransitLineObject
A TransitLineObject is a type of MapProxyObject that contains information about a transit line.
The following figure shows examples of different types of transit lines:
Figure 25: Three types of transit lines: Metro, Train and Water
To acquire information about a tapped TransitLineObject (see Handling MapProxyObject objects
on page 53 ) use onMapObjectsSelected(List<ViewObject>) as illustrated in the following
code:
private MapGesture.OnGestureListener listener = new
MapGesture.OnGestureListener() {
...
@Override
public boolean onMapObjectsSelected(List<ViewObject> objects) {
HERE SDK for Android Developer's Guide
► User Guide
60
for (ViewObject obj : objects) {
if (obj.getBaseType() == ViewObject.Type.PROXY_OBJECT) {
MapProxyObject proxyObj = (MapProxyObject) obj;
if (proxyObj.getType() == MapProxyObject.Type.TRANSIT_LINE) {
TransitLineObject transitLineObj
= (TransitLineObject) proxyObj;
Log.d(TAG, "Found a TransitLineObject");
Log.d(TAG, "Id is "
+ transitLineObj.getLineId().toString());
mTransitDatabase.getLineInfo(m_lineIdList.get(0),
mOnGetTransitInfoListener);
}
}
}
return true;
}
The TransitLineObject provides a single method for getting the Identifier of the transit line.
This Identifier can be submitted to the MapTransitLayer to get highlighted on the map. (For
more information, please refer to MaptransitLayer)
As shown in the example above, the Identifier can also be submitted to the TransitDatabase
(see TransitDatabase) along with the OnGetTransitInfoListener to get more information about
the transit line. mOnGetTransitInfoListener is implemented to receive the TransitLineInfo
object from the TransitDatabase.
TransitDatabase.OnGetTransitInfoListener mOnGetTransitInfoListener
= new TransitDatabase.OnGetTransitInfoListener() {
...
@Override
public void onTransitLineInfo(TransitLineInfo info) {
...
}
}
TransitLineInfo
The TransitLineInfo class contains transit line information that is accessed by calling one or
more of the following methods:
•
•
•
•
getOfficialName() gets the official name of the transit line
getInformalName() gets the informal name of the transit line
getShortName() gets the short name of the transit line
getTransitType() gets the transit types this transit line belongs to.
HERE SDK for Android Developer's Guide
► User Guide
61
TransitAccessObject
A TransitAccessObject is a type of MapProxyObject that contains information about a transit
access. A transit access is an entrance/exit to a transit stop. There can be multiple transit accesses
to a transit stop.
Transit access is presented as a smaller transit stop with a downward triangle attached to the bottom
and is visible only in higher zoom levels. The icons presenting the transit stops and access vary
between different countries and companies. The following figures show two examples:
Figure 26: Transit Stop and Access: Metro Station with Single
Figure 27: Transit Stop and Access: Metro Station with
Access
Mutiple Accesses
To acquire information about a tapped TransitAccessObject (see Handling MapProxyObject
objects on page 53) use onMapObjectsSelected(List<ViewObject>) as in the following
code:
private MapGesture.OnGestureListener listener = new
MapGesture.OnGestureListener() {
...
@Override
public boolean onMapObjectsSelected(List<ViewObject> objects) {
for (ViewObject obj : objects) {
if (obj.getBaseType() == ViewObject.Type.PROXY_OBJECT) {
MapProxyObject proxyObj = (MapProxyObject) obj;
if (proxyObj.getType() == MapProxyObject.Type.TRANSIT_ACCESS)
{
TransitAccessObject transitAccessObj
= (TransitAccessObject) proxyObj;
Log.d(TAG, "position is " +
HERE SDK for Android Developer's Guide
► User Guide
62
transitAccessObj.getCoordinate().toString());
TransitAccessInfo transitAccessInfo
= transitAccessObj.getTransitAccessInfo();
...
break;
}
}
}
return true;
}
The TransitAccessObject provides two methods for getting information about the transit access:
•
•
getCoordinate() gets the location coordinates of the transit access.
getTransitAccessInfo() gets further information about the transit access.
TransitAccessInfo
The TransitAccessInfo class contains transit access information that can be accessed by calling
one or more of the following methods
•
•
getTransitTypes() gets the transit types this transit access belongs to, it can be more than
one.
getStopId() gets a unique Identifier of the transit stop that this transit access leads to.
In the next example, the unique identifier of the transit stop is submitted to the TransitDatabase
to get further information. For more details, see TransitDatabase.
// transitAccessInfo is a TransitAccessInfo object
Log.d(TAG, "transit type is " +
transitAccessInfo.getTransitTypes().toString());
Log.d(TAG, "Stop Id is " +
transitAccessInfo.getStopId().toString());
mTransitDatabase.getStopInfo(transitAccessInfo
.getStopId(), mOnGetTransitInfoListener);
An example of getting information about the destination transit stop of a transit access is
provided below. An OnGetTransitInfoListener will need to be implemented to receive the
TransitStopInfo object. (See TransitStopInfo) An asynchronous request is submitted to the
TransitDatabase along the OnGetTransitInfoListener.
TransitDatabase.OnGetTransitInfoListener mOnGetTransitInfoListener
= new TransitDatabase.OnGetTransitInfoListener(){
......
@Override
public void onTransitStopInfo(TransitStopInfo info) {
......
}
HERE SDK for Android Developer's Guide
► User Guide
63
}
// transitAccessInfo is a TransitAccessInfo object
......
mTransitDatabase.getStopInfo(transitAccessInfo.getStopId(),
mOnGetTransitInfoListener);
TransitSystemInfo
The TransitSystemInfo class contains information about a public transit system that can be
accessed by calling one or more of the following methods:
•
getSystemOfficialName() - gets the official name of the transit system
•
getSystemWebsitUrl() - gets the website URL of the transit system
•
getCompanyOfficialName() - gets the official transit system company name
•
getCompanyWebsiteUrl() - gets the website URL of the transit system company
•
getCompanyRoutePlannerUrl() - gets the route planner URL of the transit system company
•
getCompanyScheduleUrl() - gets the schedule url of the transit system company
•
getCompanyPhone() - gets the phone number for the transit system company
•
getBicycleHours() - gets the tranit system's bicycle parking hours
•
getSystemLogo() - gets the system logo (if present)
•
getCompanyLogo() - gets the companyLogo (if presents)
An example of retrieving transit system information is provided below. In this example, an
OnGetTransitInfoListener is implemented to receive the TransitSystemInfo object. For
more information, see the TransitDatabase section.
TransitDatabase.OnGetTransitInfoListener mOnGetTransitInfoListener =
new TransitDatabase.OnGetTransitInfoListener() {
...
@Override
public void onTransitSystemInfo(TransitSystemInfo systemInfo) {
String officialName = systemInfo.getSystemOfficialName();
}
...
}
// transitLineInfo is a TransitLineInfo object
mTransitDatabase.getSystemInfo(transitLineInfo.getSystemId(),
mOnGetTransitInfoListener);
HERE SDK for Android Developer's Guide
► User Guide
64
TransitDatabase
The TransitDatabase class is responsible for querying transit information of various types
from a unique Identifier , with a OnGetTransitInfoListener for monitoring query
results and triggering appropriate callback methods upon completion. Applications can call the
TransitDatabase constructor to activate a TransitDatabase for querying transit information.
The OnGetTransitInfoListener interface can be used to monitor query results of the
TransitDatabase. It is required to be implemented within the application and submitted as part of
the asynchronous query request.
TransitDatabase.OnGetTransitInfoListener mOnGetTransitInfoListener
= new TransitDatabase.OnGetTransitInfoListener() {
@Override
public void onTransitLineInfo(TransitLineInfo info) {
...
}
@Override
public void onTransitStopInfo(TransitStopInfo info) {
...
}
@Override
public void onTransitAccessInfo(TransitAccessInfo info) {
...
}
@Override
public void onTransitSystemInfo(TransitSystemInfo info) {
...
}
@Override
public void onEnd(TransitDatabaseError error) {
...
}
};
The OnGetTransitInfoListener class provides five callbacks:
•
•
•
•
•
onTransitLineInfo provides a TransitLineInfo object. (See TransitLineInfo on page 60)
onTransitStopInfo provides a TransitStopInfo object. (See TransitStopInfo on page 58)
onTransitAccessInfo provides a TransitAccessInfo object. (See TransitAccessInfo on
page 62)
onTransitSystemInfo provides a TransitSystemInfo object. (See TransitSystemInfo on
page 63)
onEnd is a callback that signifies the asynchronous query request has completed.
HERE SDK for Android Developer's Guide
► User Guide
65
Note: TransitDatabase rejects all subsequent requests unless it has completed the
current request. An INVALID_OPERATION will result if the TransitDatabase is busy.
An asynchronous request is submitted to the TransitDatabase along with the
OnGetTransitInfoListener. Note that the TransitDatabase instance is created by simply
calling the TransitDatabase constructor.
The following lists the main use cases of the TransitDatabase:
•
getLineInfo() - Pass in TransitLineObject.getLineId() when user has selected a
TransitLineObject by tapping on it. This method returns an Identifier of the currently
selected transit line.
// transitLineObject is a TransitLineObject object
......
mTransitDatabase.getLineInfo(transitLineObject
.getLineId(), mOnGetTransitInfoListener);
•
getLineInfo() - Pass in TransitStopObject.getTransitStopInfo().getLines()
when user has selected a TransitStopObject by tapping on it. This method returns a list of
Identifier of the lines connected to the selected transit stop.
// transitStopInfo is a TransitStopInfo object
......
// Requesting transit line info of the first identifier on the list.
mTransitDatabase.getLineInfo(transitStopInfo
.getLines().get(0), mOnGetTransitInfoListener);
•
getStopInfo() - Pass in TransitAccessInfo.getStopId() when user has selected a
TransitAccessObject by tapping on it. This method returns a an Identifier of the stop
that the transit access leads to.
// transitAccessInfo is a TransitAccessInfo object
......
mTransitDatabase.getStopInfo(transitAccessInfo
.getStopId(), mOnGetTransitInfoListener);
Transit-related enumerations
•
•
The TransitType enum - represents values describing different transit types, such as
BUS_PUBLIC, RAIL_METRO or TRAIN_REGIONAL.
The TransitDatabase.Error enum - represents values describing possible transit database
errors, such as NONE or INVALID_PARAMETERS
Positioning
The HERE SDK for Android provides the following interfaces for users to retrieve location updates
and to display their current location on a map:
HERE SDK for Android Developer's Guide
► User Guide
•
PositioningManager
•
OnPositionChangedListener
•
PositionIndicator
66
PositioningManager Class
A PositioningManager class provides information related to the device's geographical location,
like the current position and the average speed. Applications can register to receive position updates
using one of the positioning mechanisms described in the LocationMethod:
•
•
•
GPS - positioning using the real GPS available on the device.
GPS_NETWORK - positioning is provided using a wireless network or the real GPS available on the
device
NETWORK - positioning using a wireless network.
The current status of a particular location method is represented by the LocationStatus value
returned from the PositioningManager.getLocationStatus(LocationMethod) method.
PositioningManager can be accessed by calling PositioningManager.getInstance().
An application can start receiving real time positioning updates by calling
PositioningManager.start(LocationMethod) with one of the location methods listed above
and can stop the positioning updates by calling PositioningManager.stop(). While position
updates are being received, an application can retrieve the current position of the client device via
the PositioningManager.getPosition() method.
OnPositionChangedListener Interface
In addition to the PositionManager's getPosition() method, applications can
subscribe to position update notifications from the PositioningManager through
the PositionManager.OnPositionChangedListener interface. To add or remove
OnPositionChangedListener, applications can use the following methods:
PositioningManager.addListener(WeakReference<OnPositionChangedListener>)
PositioningManager.removeListener(OnPositionChangedListener)
The positioning manager enhances your application with the current position of the user's device.
The registration of the positioning listener should be performed after the MapFragment, MapView,
MapActivity, or MapEngine is initialized as described in the following code snippet.
// Define positioning listener
private OnPositionChangedListener positionListener = new
OnPositionChangedListener() {
HERE SDK for Android Developer's Guide
► User Guide
public void onPositionUpdated(LocationMethod method,
GeoPosition position, boolean isMapMatched) {
// set the center only when the app is in the foreground
// to reduce CPU consumption
if (!paused) {
map.setCenter(position.getCoordinate(),
Map.Animation.NONE);
}
}
public void onPositionFixChanged(LocationMethod method,
LocationStatus status) {
}
};
// Register positioning listener
PositioningManager.getInstance().addListener(
new WeakReference<OnPositionChangedListener>(positionListener));
...
In order to avoid unnecessary position updates while the activity is in the background, you need
to start or stop the PositioningManager within your activity's onResume() and onPause()
methods.
// Resume positioning listener on wake up
public void onResume() {
super.onResume();
paused = false;
PositioningManager.getInstance().start(
PositioningManager.LocationMethod.GPS_NETWORK);
}
// To pause positioning listener
public void onPause() {
PositioningManager.getInstance().stop();
super.onPause()
paused = true;
}
// To remove the positioning listener
public void onDestroy() {
// Cleanup
PositioningManager.getInstance().removeListener(
positionListener);
map = null;
super.onDestroy();
}
PositionIndicator Class
PositionIndicator is a special map marker object that allows the current client device
position to be shown on a map. Every HERE SDK Map object has an integrated position
67
HERE SDK for Android Developer's Guide
► User Guide
indicator, set to invisible, by default. The indicator can be retrieved and set to visible by calling
Map.getPositionIndicator() and PositionIndicator.setVisible(), as follows:
// map fragment has been successfully initialized,
// now the map is ready to be used
map = mapFragment.getMap();
// Display position indicator
map.getPositionIndicator().setVisible(true);
By default, the position indicator is rendered as a marker surrounded by a circle, the diameter
of which illustrates the accuracy of the indicated position. You can change this marker by calling
PositionIndicator.setMarker(Image).
Figure 28: A PositionIndicator
68
HERE SDK for Android Developer's Guide
► User Guide
69
Note: For the position indicator to stay in the center of the map and illustrate real-time
updates of the device's position, it is necessary to update the map's center whenever a new
location update is received.
Note: PositionIndicator only works if the application has started the
PositioningManager.
MapActivity Class
MapActivity is an Activity class created for applications that use the HERE SDK for Android
headless APIs, but do not require for a map to be displayed. Examples of these activities include
search and route calculation.
MapActivity is a class derived from android.app.Activity. It handles the initialization and
management of the MapEngine internally. Upon onCreate() being called, the MapActivity
will initialize the MapEngine. It takes care of the necessary actions that is needed for the activity
to switch between background and foreground. Moreover, the inheriting activity can override the
method MapActivity.onInitialized(OnEngineInitListener.Error error) to be notified
when MapEngine completes its initialization and if it is ready for use. The following is an example of
an activity that only uses headless APIs from the HERE SDK for Android:
public class CalculateRouteActivity extends MapActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// customized onCreate() for this activity
...
}
// override to handle actions when MapFactory finishes initialization,
// for instance route calculation that uses headless APIs from the
// Android SDK.
protected boolean onInitialized(OnEngineInitListener.Error error) {
if (error == OnEngineInitListener.Error.NONE) {
// eg. do route calculation
RouteManager.getInstance().calculateRoute(...)
} else {
// MapEngine initialization failed!
}
}
...
}
HERE SDK for Android Developer's Guide
► User Guide
70
Extruded Buildings
Figure 29: Extruded Buildings on a Map of San Francisco
HERE SDK for Android supports 3D representations of buildings and structures. This feature is called
extruded buildings, and you can display them by using the setExtrudedBuildingsVisible()
method in com.here.android.mpa.mapping.Map. Extruded buildings are available for most
metropolitan areas in North America and Europe.
The MapBuildingLayer Class
The main entry point for extruded buildings is the MapBuildingLayer class, which can be retrieved
by calling getMapBuildingLayer() from a Map. MapBuildingLayer provides methods for
working with building groups and individual buildings such as:
•
getBuilding()
•
createNewBuildingGroup()
•
releaseBuildingGroup()
•
getDefaultBuildingGroup()
These APIs provide a way for the developer to create groups of buildings (for example, to highlight
them in a blue color), or to retrieve a default group containing all possible extruded buildings onscreen.
Note: The extruded building methods are in effect even when buildings are invisible. For
example, calling getDefaultBuildingGroup() returns the default group, even if you have
HERE SDK for Android Developer's Guide
► User Guide
71
called setExtrudedBuildingsShown(false) or if the current zoom level does not allow
for visible extruded buildings.
The MapBuildingGroup Class
The MapBuildingGroup class represents a group of buildings. There are two types of groups:
•
New building groups - Created by calling createNewBuildingGroup(). No building is attached
to this group when it is created. An application can have a maximum of six new building groups at
a time.
•
Default building groups - Retrieved by calling getDefaultBuildingGroup(). The default
building group is a generic group that represents all possible buildings in the entire world. There
are two distinct types of default building groups— IMPORTANT_BUILDINGS, which are textured
landmark buildings, and NORMAL_BUILDINGS, which include all other buildings.
Each MapBuildingGroup holds an EnumSet of building faces, a color, as well as a building height
scaling factor. To control the appearance of extruded buildings, you can set these attributes and add
buildings to the group. For example, to highlight a building's roof, create a new building group, set
the group's roof color as Color.RED, and then add a building to this group, as in the following code:
// retrieve a reference of the map from the map fragment
map = mapFragment.getMap();
// Create a custom building group
buildingGroup = map.getMapBuildingLayer().createNewBuildingGroup();
// Set the buildingGroup's roof color to "red"
buildingGroup.setColor(Color.RED, EnumSet.of(MapBuildingGroup.BuildingFace.ROOF));
// Set the buildingGroup's height
buildingGroup.setVerticalScale(0.90f);
buildingGroup.addBuilding(myBuildingIdentifier);
HERE SDK for Android Developer's Guide
► User Guide
Note: Remember to call releaseBuildingGroup() to release any unused building groups.
Otherwise, users may receive a null pointer exception after the device has been rotated a few
times.
Figure 30: Highlighting a Building
Note: By default, a new MapBuildingGroup has the color
MapBuildingLayer.DefaultBuildingColor.SELECTED on all building faces.
The following table shows the values that can be used to highlight building faces:
MapBuildingGroup.BuildingFace.ROOF
72
HERE SDK for Android Developer's Guide
► User Guide
MapBuildingGroup.BuildingFace.OUTLINE
MapBuildingGroup.BuildingFace.WALLBOTTOM
MapBuildingGroup.BuildingFace.WALLTOP
73
HERE SDK for Android Developer's Guide
► User Guide
74
MapBuildingGroup.BuildingFace.LANDMARKS - Please note that
this value is only applicable for landmarks. When this value is used, the
entire landmark is shaded.
The MapBuildingObject Class
The MapBuildingObject class represents a single building, with the following attributes:
•
a name
•
a geocoordinate position
•
the building height, in meters
•
a unique map building identifier
To detect whether a user has tapped on an extruded building, use
MapGesture.OnGestureListener and look for the selected MapBuildingObject:
private MapGesture.OnGestureListener gestureListener =
new MapGesture.OnGestureListener.OnGestureListenerAdapter() {
public boolean onMapObjectsSelected(List<ViewObject> objects) {
for (ViewObject vo : objects) {
if (vo instanceof MapBuildingObject) {
// Remove currently selected building
buildingGroup.removeAllBuildings();
// Add this building to the group.
MapBuildingObject building = (MapBuildingObject) vo;
buildingGroup.addBuilding(building.getIdentifier());
}
}
return false;
}
};
HERE SDK for Android Developer's Guide
► User Guide
75
3D Landmarks
Figure 31: A Landmark on a Map of San Francisco
Another related feature in the Map class is 3D landmarks. By calling
Map.setLandmarksVisible(true), you can enable certain landmark structures to become
visible. These structures are presented with textures and more details in their 3D geometry, as seen
in the screenshot above. Landmarks are not visible when the map is set to a Hybrid or Satellite map
scheme.
Custom Raster Tiles
You can use the HERE SDK for Android to enhance maps with custom raster tiles. Custom raster tiles
are tile images that you can add to a map to customize it with enhanced information. For example,
you may wish to use this feature to add heat maps over a map of New York City. You can store
HERE SDK for Android Developer's Guide
► User Guide
76
custom raster tile images locally or on a remote server for users to access when they navigate in a
map. If the application is set to display custom raster tiles, users will see them whenever they are
viewing a designated geographical area at a specified zoom level or range of zoom levels.
Dividing a Map and Tile Lookup
To use your own custom raster tile images, you need to have a scheme of dividing your map
according to the zoom level and map coordinates, and then provide map tiles according to this
scheme. Your application will then use this scheme in the implementation of one of the following
classes:
•
MapRasterTileSource - Implement this class if you plan to fetch local tile images, create
dynamic images, or if you would like to provide your own method of retrieving images from a
remote server.
•
UrlMapRasterTileSourceBase - This is a convenience child class of
MapRasterTileSource. Implement this if you plan to fetch tile images from a remote server
using a URL over HTTP.
Note: Raster tiles can be one of the following supported image types:
•
PNG
•
•
JPEG
BMP
Once a tile source has been implemented, you can toggle its display by adding or removing
it to the map using Map.addRasterTileSource(MapRasterTileSource) or
Map.removeRasterTileSource(MapRasterTileSource).
The MapRasterTileSource Abstract Class
MapRasterTileSource is the common way for you to define your raster tile source. If your
application uses local tile images or remote images that require custom server authentication, then
you should implement this class by defining the hasTile() and getTileWithError() methods.
For example:
public class MyTileSource extends MapRasterTileSource {
@Override
public boolean hasTile(int x, int y, int zoomLevel) {
return true;
}
@Override
public TileResult getTileWithError(int x, int y, int zoomLevel) {
byte[] myImageData = null;
// perform tile retrieval logic such as server authentication
// also translate the x, y, and zoomlevel to address an image
TileResult result = new TileResult(Error.none, myImageData);
HERE SDK for Android Developer's Guide
► User Guide
77
return result;
}
}
Note: Ensure that getTileWithError() returns within a reasonable amount of time. If your
operation takes a longer period of time, launch an asynchronous operation and return the
TileResult.Error.NOT_READY error code while the operation is in progress.
The UrlMapRasterTileSourceBase Abstract Class
UrlMapRasterTileSourceBase is a child abstract class of MapRasterTileSource that you
can use if you plan to fetch tile images from a remote server using image URLs. The following
is a sample implementation of UrlMapRasterTileSourceBase. In this example, we use the
MapRasterTileSource.MapTileSystemHelper.tileXYToQuadKey() method to address our
map tiles. This helper method assumes that we are using a quadtree/quadkey scheme, where the
map is divided into a quadtree (a tree data structure where each node has exactly four children) with
20 levels. Each level of this map quadtree has (2Floor(zoomlevel))2 tiles, so for level 0, there is 1 x 1 = 1 tile,
level 1 has 2 x 2 = 4 tiles, level 2 has 4 x 4 = 16 tiles and level 3.7 has 8 x 8 = 64 tiles.
For more information about the quadkey/quadtree division scheme, see the tileXYToQuadKey()
API reference.
public class LiveMapRasterTileSource extends UrlMapRasterTileSourceBase {
private final static String URL_FORMAT =
"http://1.communitymaptiles.nokia.com/tilehub/live/map/png/%s";
public LiveMapRasterTileSource() {
// We want the tiles placed over everything else
setOverlayType(MapOverlayType.FOREGROUND_OVERLAY);
// We don't want the map visible beneath the tiles
setTransparency(Transparency.OFF);
// We don't want the tiles visible between these zoom levels
hideAtZoomRange(12, 20);
// Do not cache tiles
setCachingEnabled(false);
}
// Implementation of UrlMapRasterTileSourceBase
public String getUrl(int x, int y, int zoomLevel) {
String url = null;
// Utility to map the x, y coordinates easily into an equivalent
// quadkey at a specified zoomLevel
String quadKey =
MapTileSystemHelper.tileXYToQuadKey(x, y, zoomLevel);
try {
// Append the quadkey to the URL template to get a real URL
url = String.format(URL_FORMAT, quadKey);
} catch (Exception ex) {
ex.printStackTrace();
}
return url;
}
}
HERE SDK for Android Developer's Guide
► User Guide
78
The example above generates a quadkey from the x, y coordinates and the zoom level and
appends it to the URL. However, this is server-specific and the method of converting x, y and
zoom level to a URL can be done in many ways. Also, it is worth noting that tiles can be cached with
setCachingEnabled(true).
Changing the Overlay Rendering Order
You can choose to customize the order that raster tiles are rendered by calling
MapRasterTileSource.setOverlayType(MapOverlayType). For example
MapOverlayType.BACKGROUND_OVERLAY and MapOverlayType.BACKGROUND_REPLACEMENT
are similar to rendering raster tiles with streets rendered on top.
MapOverlayType.FOREGROUND_OVERLAY will render tiles on top of everything on the map.
Caching Tiles
Tiles can be cached to the disk by calling the following:
// Give the tile source a custom prefix so it can be cached on the disk
MapRasterTileSource.setCachePrefix( Sting cache )
// Give each raster tile file an expiration time in seconds.
MapRasterTileSource.setCacheExpiration( int seconds )
If no expiration time is set, then the raster tiles will remain on the device. It is recommended to set
both a cache prefix and expiration time.
Places
This section provides an overview of the Places feature in the HERE SDK. The Places feature enables
developers to build rich, location-aware applications by adding point of interest search, discovery,
interaction, and information retrieval.
For example, when an application submits a place discovery request using this API, the application
receives a response that contains a list of links to places resources (among other information). By
accessing one of the linked Place resources, the application can get detailed information about that
place, including ratings, images, reviews, editorials, and owner content. This detailed place response
also contains references to other related places, allowing the applications users to discover other
places relevant or related to their original search.
Note: To use the HERE Places feature, your application must include the google-gson library
(release 2.2.4 or a compatible version) on its class path. This library can be downloaded from
HERE SDK for Android Developer's Guide
► User Guide
79
the google-gson project website at http://code.google.com/p/google-gson/ . Attempting to use
the Places feature without adding this library will cause runtime errors.
Geocoding and Reverse Geocoding
Geocoding and reverse geocoding APIs from the HERE SDK for Android allow application developers
to offer search functionality for requesting location information and structured addresses.
Geocoding APIs resolve to a GeoCoordinate from geographic data such as Address, while reverse
geocoding APIs resolve to a geographic data, such as Address, from a GeoCoordinate. Address
provides textual address information, which includes house number, street name, city, country, and
district. It encompasses everything about an address or a point on the map. Location represents
a physical point on the map where additional attributes can be retrieved. These additional attributes
include a unique identifier, label, Address, GeoCoordinate and GeoBoundingBox for the Location.
The GeocodeRequest Class
GeocodeRequest represents an extended Request. GeocodeRequest can be created using a
structured Address:
new GeocodeRequest(Address)
The GeocodeRequest can also be created as a one-box (free-formatted text) search using a
combination of a text query string and geographical area arguments. The following shows the
method used to create a one-box request:
GeocodeRequest request = new
GeocodeRequest(String).setSearchArea(GeoCoordinate, int)
The preceding two methods return a GeocodeRequest object. To begin the search, call
GeocodeRequest.execute(). This method requires a ResultListener as an argument. When
the search is completed, the ResultListener.onCompleted() method is called with a result
status and a list of found locations.
After a request is invoked, it can be cancelled using the GeocodeRequest.cancel() method, which
returns true if the request was cancelled successfully. For GeocodeRequest, a list of Location
objects are expected at the completion of the request.
The following code example demonstrates how to perform a GeocodeRequest using an Address:
// Implementation of ResultListener
class GeocodeListener implements ResultListener<List<Location>> {
@Override
public void onCompleted(List<Location> data, ErrorCode error) {
if (error != ErrorCode.NONE) {
HERE SDK for Android Developer's Guide
► User Guide
// Handle error
...
} else {
// Process result data
...
}
}
}
// Instantiate an Address object
Address berlin_address = new Address();
berlin_address.setHouseNumber("100");
berlin_address.setStreet("INVALIDENSTRASSE");
berlin_address.setPostalCode("10115");
berlin_address.setCity("Berlin");
berlin_address.setCountryCode("DEU");
ResultListener<List<Location>> listener = new GeocodeListener();
GeocodeRequest request = new GeocodeRequest(berlin_address);
if (request.execute(listener) != ErrorCode.NONE) {
// Handle request error
...
}
The following code example demonstrates how to perform a GeocodeRequest using new
GeocodeRequest(String).setSearchArea(GeoCoordinate, int):
// Implementation of ResultListener
class GeocodeListener implements ResultListener<List<Location>> {
@Override
public void onCompleted(List<Location> data, ErrorCode error) {
if (error != ErrorCode.NONE) {
// Handle error
...
} else {
// Process result data
...
}
}
}
// Instantiate a GeoCoordinate object
GeoCoordinate vancouver = new GeoCoordinate( 49.2849,- 123.1252);
// Example code for creating a OneBox Request
ResultListener<List<Location>> listener = new GeocodeListener();
GeocodeRequest request = new
GeocodeRequest("Granville").setSearchArea(vancouver, 5000);
if (request.execute(listener) != ErrorCode.NONE) {
// Handle request error
...
}
80
HERE SDK for Android Developer's Guide
► User Guide
81
The ReverseGeocodeRequest Class
The ReverseGeocodeRequest class represents an extended Request used to retrieve Address
data. The request is created using a GeoCoordinate as shown below:
new ReverseGeocodeRequest(GeoCoordinate)
The above method returns a ReverseGeocodeRequest object. To invoke the request, you can
then call the execute() method of the returned ReverseGeocodeRequest object and pass in a
ResultListener to retrieve the information about the completion of the request. Once a request
is invoked, the request can be cancelled via the ReverseGeocodeRequest.cancel() method.
cancel() returns true if the request was cancelled successfully. For ReverseGeocodeRequest, a
structured Address is expected at the completion of the request.
The following is an example of creating ReverseGeocodeRequest using new
ReverseGeocodeRequest(GeoCoordinate):
// Implementation of ResultListener
class ReverseGeocodeListener implements ResultListener<Address> {
@Override
public void onCompleted(Address data, ErrorCode error) {
if (error != ErrorCode.NONE) {
// Handle error
...
} else {
// Process result data
...
}
}
}
// Instantiate a GeoCoordinate object
GeoCoordinate vancouver = new GeoCoordinate( 49.2849,- 123.1252);
// Example code for createReverseGeocodeRequest(GeoCoordinate)
ResultListener<Address> listener = new ReverseGeocodeListener();
ReverseGeocodeRequest request = new ReverseGeocodeRequest(vancouver);
if (request.execute(listener) != ErrorCode.NONE) {
// Handle request error
...
}
Search and Discovery
The HERE SDK for Android provides application developers the Places API which allows places
discovery and information retrieval.
HERE SDK for Android Developer's Guide
► User Guide
82
Steps for performing a search
1.
Implement the ResultListener interface to handle the completion of the search
2.
Create a request and apply request options
3.
Invoke the request by calling Request.execute(ResultListener)
4.
The ResultListener.onCompleted() callback is triggered when the request is finished
Note: Generally, applications that use the Places API must honor the following prescribed
workflow:
1.
Search
2.
Request for Details
3.
Perform Actions
It is not permitted to write applications that preload results that are linked from a response in
order to improve performance. For more information about usage restrictions, please consult
the API Implementation Check List in the REST HERE Places API documentation.
Discovery Requests
The HERE Places Search API supports the following discovery requests:
•
•
•
Search - finds places that match user-provided search terms.
Explore - finds interesting places nearby, or in the map viewport, sorted by popularity. Use this
type of request if you are trying to answer the question "What are the interesting places near
here?" The results may be optionally restricted to a given set of categories, which acts as a filter
in terms of what places get returned.
Here - helps users identify places at the given location by finding places of interest near a given
point, sorted by distance. Use this type of request if you are trying to answer the question "What
is near this location?" or "Where am I?" You can use this endpoint to implement features like
"check-in" (by identifying places at the user's current position) or "tap to get more information
about this place of interest".
Note: Normally, the closest known places are returned with the Here Discovery request, but
if the uncertainty in the given position is high, then some nearer places are excluded from the
result in favour of more popular places in the area of uncertainty.
New discovery requests can be created using the following constructors:
new SearchRequest(String)
new ExploreRequest()
new HereRequest()
HERE SDK for Android Developer's Guide
► User Guide
83
The following code example demonstrates how to perform a search discovery request:
// Example Search request listener
class SearchRequestListener implements ResultListener<DiscoveryResultPage> {
@Override
public void onCompleted(DiscoveryResultPage data, ErrorCode error) {
if (error != ErrorCode.NONE) {
// Handle error
...
} else {
// Process result data
...
}
}
}
// Create a request to search for restaurants in Seattle
try {
GeoCoordinate seattle
= new GeoCoordinate(47.592229, -122.315147);
DiscoveryRequest request =
new SearchRequest("restaurant").setSearchCenter(seattle);
// limit number of items in each result page to 10
request.setCollectionSize(10);
ErrorCode error = request.execute(new SearchRequestListener());
if( error != ErrorCode.NONE ) {
// Handle request error
...
}
} catch (IllegalArgumentException ex) {
// Handle invalid create search request parameters
...
}
The result of a discovery request (Search, Explore, Here) is a DiscoveryResultPage. The
DiscoveryResultPage represents a paginated collection of items from which the following can be
retrieved:
•
•
Next page request - a discovery request used to retrieve additional pages of search items
Items for the current page - a List of DiscoveryResult
When additional pages of search results are needed, retrieve and invoke the DiscoveryRequest
returned by DiscoveryResultPage.getNextPageRequest(). If the next page request is null, no
additional results are available.
The following is an example:
DiscoveryResultPage mResultPage = null;
// Example Search request listener
class SearchRequestListener implements ResultListener<DiscoveryResultPage> {
@Override
public void onCompleted(DiscoveryResultPage data, ErrorCode error) {
if (error != ErrorCode.NONE) {
// Handle error
...
} else {
HERE SDK for Android Developer's Guide
► User Guide
84
// Store the last DiscoveryResultPage for later processing
mResultPage = data;
...
}
}
}
...
// When the next page of results is needed...
DiscoveryRequest nextPageRequest = mResultPage.getNextPageRequest();
if (nextPageRequest != null) {
// More data is available if the nextPageRequest is not null
ErrorCode error = nextPageRequest.execute(new SearchRequestListener());
if( error != ErrorCode.NONE ) {
// Handle request error
...
}
}
Calling DiscoveryResultPage.getItems(), returns a List containing one of the following types
of objects, which are DiscoveryResult instances. DiscoveryResult is a collection of Link
instances.
•
•
PlaceLink - Represents discovery information about a Place. The PlaceLink contains a brief
summary about a place. Details about a place are available from the Place that the PlaceLink
references.
DiscoveryLink - Represents a discovery-related API link used to retrieve additional
DiscoveryResultPage. This type of Link can be a result item in an Explore or Here type of
search. The DiscoveryLink references refined discovery requests resulting in more specific
results. For example, the DiscoveryLink may link to a discovery request to search for 'Eat &
Drink', 'Going Out', 'Accommodation', and so on.
Since there may be new types of Link items in the future, it is recommended that each type of
DiscoveryResult be checked before it is used (as shown in the following code snippet). In the
following example, it is shown how a Place is retrieved through a PlaceLink:
// Implement a search result listener
ResultListener<DiscoveryResultPage> searchListener = new
ResultListener<DiscoveryResultPage>() {
@Override
public void onCompleted(DiscoveryResultPage results, ErrorCode error) {
if (error == ErrorCode.NONE) {
// The results is a DiscoveryResultPage which represents a
// paginated collection of items.
List<DiscoveryResult> items = results.getItems();
// Iterate through the found place items.
for (DiscoveryResult item : items) {
// A Item can either be a PlaceLink (meta information
// about a Place) or a DiscoveryLink (which is a reference
// to another refined search that is related to the
// original search; for example, a search for
// "Leisure & Outdoor").
if (item.getResultType() == ResultType.PLACE) {
PlaceLink placeLink = (PlaceLink) item;
// PlaceLink should be presented to the user, so the link can be
// selected in order to retrieve additional details about a place
HERE SDK for Android Developer's Guide
► User Guide
85
// of interest.
...
} else if (item.getResultType() == ResultType.DISCOVERY) {
DiscoveryLink discoveryLink = (DiscoveryLink) item;
// DiscoveryLink can also be presented to the user.
// When a DiscoveryLink is selected, another search request should be
// performed to retrieve results for a specific category.
...
}
}
} else {
// Handle search request error.
}
}
};
...
// Implement a Place listener for handling user interaction with a displayed PlaceLink
class PlaceListener implements ResultListener<Place> {
@Override
public void onCompleted(Place data, ErrorCode error) {
if (error != ErrorCode.NONE) {
// Handle error
...
} else {
// Present the place details to the user.
String placeName = data.getName();
List<Category> placeCategories = data.getCategories();
...
}
}
}
// Retrieve the place details when the user selects a displayed PlaceLink.
private void onPlaceLinkSelected(PlaceLink placeLink) {
PlaceRequest placeRequest = placeLink.getDetailsRequest();
if( placeRequest.execute(new PlaceListener()) == ErrorCode.NONE ) {
// Request successful. Additional work can be done here, however, place details will
// be returned in PlaceListener.onCompleted().
...
} else {
// Handle the error
...
}
}
The Place Class
The Place class represents a detailed set of data about a physical place, acting as a container for
various attributes, collections of media about a place, and key-value pairs of related places. Places
object can belong to a specific Category, and has attributes such as:
•
•
•
•
•
•
a unique identifier (ID)
a name
a list of alternative names(optional)
a Location object representing the physical location of the place
a List of Category objects that link to the categories assigned to the place
a URL to the icon that best represents the place
HERE SDK for Android Developer's Guide
► User Guide
•
•
a SupplierLink object containing a link to the supplier's brand icon (optional)
a String object containing attribute information (optional)
•
•
•
•
•
•
•
•
•
a list of ExtendedAttribute objects
a page of Image objects(optional)
a list of contacts (optional)
a collection of media reviews (optional)
a collection of media ratings (optional)
an average of user ratings (optional)
a page of Editorial objects (optional)
a reference identifier (optional)
a map of DiscoveryLink objects specifying related places (optional)
Additional Search Requests
Additionally, the HERE Places Search API also supports the following related request type:
•
Text suggestion - retrieves a list of suggested search terms that are related to a specified
location context and a partial search term. For example, if you make a request with the String
"rest" in Berlin, the results will contain search terms such as "Restaurant", "Rest area", and
"Restorf, Höhbeck, Germany".
To use text suggestions, implement a listener to handle a list of strings and call new
TextSuggestionRequest(String) as follows:
// Example Search request listener
class SuggestionQueryListener implements ResultListener<List<String>> {
@Override
public void onCompleted(List<String> data, ErrorCode error) {
if (error != ErrorCode.NONE) {
// Handle error
// ...
} else {
for (String r : data) {
//Process result data
}
}
}
}
try {
String term = "rest";
TextSuggestionRequest request = null;
request = new TextSuggestionRequest(term).setSearchCenter(myMap.getCenter());
if (request.execute(new SuggestionQueryListener()) !=
ErrorCode.NONE ) {
//Handle request error
//...
}
} catch (IllegalArgumentException ex) {
//Handle invalid create search request parameters
}
86
HERE SDK for Android Developer's Guide
► User Guide
87
Directions
This section provides an overview of the Directions feature in the HERE SDK. The Directions feature
allows developers to define and display routes between a start and a destination point within their
application. It supports many navigation options such as toll road preference and transport type.
Route Calculation for Walking, Driving, Or Riding
Transit
The HERE SDK for Android supports route calculation with multiple waypoints, optimized for walking,
driving or public transit.
A route describes a path between at least two waypoints, the starting point and the destination, with
optional intermediate waypoints in between. Applications can provide route information to users in
two ways:
•
•
a line rendered on a map that displays a connecting path between all waypoints
turn-by-turn directions in text format
The RouteManager Class
The RouteManager class is responsible for calculating a route by using a RoutePlan and a
RouteManager.Listener instance. An application can initiate a route calculation by calling the
RouteManager.calculateRoute(RoutePlan, Listener) method, providing options and
waypoints through RoutePlan, and receive progress updates through the Listener.
Applications can call the RouteManager.getInstance() method to retrieve a RouteManager
singleton instance.
The RoutePlan Class
The RoutePlan class is a parameter list that is used for route calculation. A RoutePlan
object is comprised of a list of GeoCoordinate objects and an optional RouteOptions
object. If a RouteOptions is not specified, default values will be used. Applications can
add an individual waypoint to a RoutePlan by passing a GeoCoordinate object to the
addCoordinate(GeoCoordinate) method.
HERE SDK for Android Developer's Guide
► User Guide
88
The RouteOptions Class
The RouteOptions class is a model of the parameters required to calculate one route,
encapsulating "building block" parameters for a route such as:
•
•
•
•
•
•
The desired number of routes
The routing type, such as fastest travel time or shortest distance
The mode of transportation, such as by walking or driving
The arrival or departure time
The maximum number of transit line changes
The allowed types of route segments, such as dirt roads, highways, or ferries
Note: The HERE SDK also supports alternate routes between two waypoints. The alternate
route feature allows more than one route to be returned after a route calculation. You can
use the RouteOptions class to set the desired number of routes, and the HERE SDK will then
return different routes according to this limit. Note that the first element of the returned list
of RouteResult is the main route, and the rest of the returned routes are not listed in any
specific order.
The RouteResult Class
The RouteResult class represents a route calculation result. Applications can retrieve a Route
object and the corresponding set of violated routing conditions using the following methods:
•
•
getRoute()
getViolatedOptions()
Violated routing options are the conditions that a routing result was unable to adhere to. For example,
after specifying a route calculation that avoids tolls and ferries, you may get a RouteResult that
contains a Route object along with RouteResult.ViolatedOption.AVOID_TOLL_ROADS. This
indicates that although a route was found, this route goes through at least one toll road—violating a
condition of your route request.
The Route Class
The Route class is a distinct calculated path connecting two or more waypoints, consisting of a list of
maneuvers and route links. By using RouteManager.calculateRoute(RoutePlan, Listener)
to trigger a route calculation, your application can use the RouteManager.Listener to monitor
the calculation and trigger callback methods. These callback methods have parameters which include
a list of the calculated RouteResult objects. Using these RouteResult objects, you can call
getRoute() to retrieve the routes.
A Route object contains route information that can be accessed by calling methods, such as:
•
•
getRoutePlan() - returns the RoutePlan for the route
getWaypoints() - returns the array of all waypoints for the route
HERE SDK for Android Developer's Guide
► User Guide
89
•
•
getStart() - returns the starting waypoint for the route
getDestination() - returns the destination waypoint for the route
•
getManeuvers() - returns the array of all maneuvers that travelers will encounter along the
route. .
getLength() - returns the length of the route, in meters
getBoundingBox() - returns the smallest GeoBoundingBox that contains the entire route
getRouteGeometry() - returns the array of all GeoCoordinate values representing, in order,
the polyline of the route
getSublegCount() - returns the amount of sub-legs the route has. A sub-leg is the part of a
route between two stop waypoints
•
•
•
•
The MapRoute Class
The MapRoute class is a type of MapObject that displays a calculated route on a map. Typically, an
application will create a MapRoute after a route calculation, passing the relevant Route object as a
parameter to the MapRoute(Route) constructor before adding the MapRoute to the map by calling
Map.addMapObject(MapRoute).
HERE SDK for Android Developer's Guide
► User Guide
90
For example, if you want to render a route that connects two waypoints (start and destination), you
can add the following application logic:
Figure 32: Calculate Route
1.
Get a RouteManager by calling RouteManager.getInstance().
// Declare the rm variable (the RouteManager) and Get the RouteManager
RouteManager rm = RouteManager.getInstance();
2.
Create a RoutePlan and add two GeoCoordinate waypoints.
// Create the RoutePlan and add two waypoints
RoutePlan routePlan = new RoutePlan();
routePlan.addWaypoint(new GeoCoordinate(49.1966286, -123.0053635));
routePlan.addWaypoint(new GeoCoordinate(49.1947289, -123.1762924));
HERE SDK for Android Developer's Guide
► User Guide
3.
91
Create a new RouteOptions object, set itsType and TransportMode values by calling
appropriate RouteOptions methods, and then add it to RoutePlan.
// Create the RouteOptions and set its transport mode & routing type
RouteOptions routeOptions = new RouteOptions();
routeOptions.setTransportMode(RouteOptions.TransportMode.CAR);
routeOptions.setRouteType(RouteOptions.Type.FASTEST);
routePlan.setRouteOptions(routeOptions);
4.
To make sure route calculation can handle returning a Route object that in turn can be used
to create a MapRoute instance for rendering on the map, add an inner class by implementing
RouteManager.Listener in the appropriate activity class.
private class RouteListener implements RouteManager.Listener {
// Method defined in Listener
public void onProgress(int percentage) {
// Display a message indicating calculation progress
}
// Method defined in Listener
public void onCalculateRouteFinished(RouteManager.Error error, List<RouteResult>
routeResult) {
// If the route was calculated successfully
if (error == RouteManager.Error.NONE) {
// Render the route on the map
mapRoute = new MapRoute(routeResult.get(0).getRoute());
map.addMapObject(mapRoute);
}
else {
// Display a message indicating route calculation failure
}
}
}
5.
After adding the inner listener class (named RouteListener for this example), calculate the
route by calling RouteManager.calculateRoute(RoutePlan, Listener) (making use of
an instantiated RouteListener object).
// Calculate the route
rm.calculateRoute(routePlan, new RouteListener());
Routing-related Enumerations
Route calculations make use of HERE SDK enumerations that include:
•
The RouteOptions.Type enum - represents values describing different routing types, such as
FASTEST, SHORTEST, or ECONOMIC
•
The RouteOptions.TransportMode enum - represents values describing different transport
modes, such as CAR or PEDESTRIAN
The RouteManager.Error enum - represents values describing possible route calculation
errors, such as NONE or VIOLATES_OPTIONS
The RouteResult.ViolatedOption enum - represents values describing possible route
option violations, such as AVOID_HIGHWAYS or AVOID_FERRIES
•
•
HERE SDK for Android Developer's Guide
► Supplemental Information
92
Chapter
4
Supplemental Information
Topics:
•
Creating a Simple HERE SDK
Application in Android Studio
•
Adding a MapFragment at Runtime
•
Compatibility Fragments
•
Size Management
•
Development Tips
This section provides supplemental information for using the HERE
SDK for Android.
HERE SDK for Android Developer's Guide
► Supplemental Information
93
Creating a Simple HERE SDK Application in Android
Studio
This tutorial provides instructions on how to create a simple application using the HERE SDK for
Android in Android Studio. It is equivalent to the Eclipse tutorial, which is located at Creating a Simple
Application Using the HERE SDK on page 14.
Development tasks for this basic application include:
•
Create a new Android Studio project
•
Add necessary resources, permissions and map fragment(s) to the project properties and
application manifest
•
Acquire credentials from HERE for accessing map services
•
Initialize the map fragment such that a map instance is created and associated with the map
fragment for rendering on the client device
Create a New Android Studio Project
The first stage of developing an application using the HERE SDK is to create a new project in Android
Studio as follows:
1.
From the Welcome to Android Studio dialogue box, select New Project... to open the Create New
Project dialog
2.
In the New Android Application dialog, under Application name, specify an appropriate application
name The remainder of this tutorial will refer the application name as HelloHEREMaps.
3.
Under Company Domain, specify an appropriate domain. By default, your application
package name is composed of Company Domain and Application Name. For example, if
mapstutorial.com is your Company Domain, and the Application Name is HelloHEREMaps
then the package name is com.mapstutorial.helloheremaps. The package name can also
be changed by clicking the Edit link box.
4.
Under Project Location, specify an appropriate project location in the file system
5.
Click Next
6.
Select the form factors your application will run on. For the purpose of this tutorial, check Phone
and Tablet.
7.
Under Minimum SDK, select the lowest version of the Android SDK you wish to support. For this
sample application, we will use Android 3.0
8.
Click Next
HERE SDK for Android Developer's Guide
► Supplemental Information
9.
94
You may be prompted to agree to a License Agreement. Click Accept, and then Next to install
SDK components. After the installation is complete, click Next again.
10. In the "Add an activity to Mobile" dialog box, select Blank Activity and click Next
11. In the "Choose options for your new file" dialog box, specify an appropriate activity name in
Activity Name. This tutorial will use the name MainActivity.
12. Under Layout Name, specify an appropriate layout name. This tutorial will use activity_main)
13. Under Title, specify an appropriate title. (This tutorial will use MainActivity)
14. Under Menu Resource Name, specify an appropriate menu resource name. (This tutorial will use
menu_main)
15. Click Finish
Result: Andriod Studio creates the structure for your project and opens the development
environment.
A few views are available in the Android Studio development environment. The Android View shows
a flattened view of the application's structure, and the Project View shows a flattened view of the
project's structure, including Gradle-related files.
The Android View provides quick access to key source files of your Android application. Selecting the
activity_main.xml file in Android View opens the file in the Layout Editor and allows you to dragand-drop widgets into your layout.
HERE SDK for Android Developer's Guide
► Supplemental Information
95
The following image shows how to switch between Android and Project view.
Figure 33: Switching Views in Android Studio
Add HERE SDK Libraries to Your Project
After creating the skeleton of your new application, add the HERE SDK resources as follows:
1.
From the directory where you installed the HERE SDK, copy the contents of the HERE-sdk/libs/
folder, except the armeabi-v7a folder, to your project's libs/ folder.
2.
In your Android Studio project's libs/ folder, right-click the HERE-sdk.jar file and select Add as
Library..., then under the Add To module, select app and click OK.
3.
Optional: If you plan on extending this application with HERE Places functionality, add the googlegson library (release 2.2.4 or a compatible version) into your project. One way to do this is to
download the google-gson-*-release.zip file from https://code.google.com/p/googlegson/, unzip the ZIP archive, and copy the gson-*.jar (not gson-*-sources.jar or gson*-javadoc.jar) into your project libs/ folder, then right-click on it in Android Studio, and
select Add as Library..., then under the Add To module, select app and click OK. The google-gson
HERE SDK for Android Developer's Guide
► Supplemental Information
96
library is required for all HERE Places operations. For more information on using HERE Places,
please see Places on page 78.
4.
From the directory where you installed the HERE SDK, copy the contents of the HERE-sdk/
libs/armeabi-v7a folder to your project's app/src/main/jniLibs/armeabi folder. You
will need to create the jniLibs and armeabi subfolders.
5.
From the Android Studio Project View, click .idea > libraries, ensure HERE_sdk_javadoc.xml is
not on the list. If it exists, delete HERE_sdk_javadoc.xml.
6.
Optional: To enable quick javadoc reference within your Android Studio environment, click on
HERE_sdk.xml to edit it, and then add the following after </CLASSES> and before <SOURCES /
>:
<JAVADOC>
<root url="jar://$PROJECT_DIR$/app/libs/HERE-sdk-javadoc.jar!/" />
</JAVADOC>
Result: Your project will be able to make use of APIs from the HERE SDK.
Edit AndroidManifest.xml
With resources added to your project, the next stage of creating an application with the HERE SDK is
to edit the project's AndroidManifest.xml file to specify Android permissions as follows:
1.
From the Android View, under the manifests folder, double-click your project's
AndroidManifest.xml file to open it for editing.
2.
Add the following markup within the <manifest></manifest> block of tags, before
<application></application>:
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission
android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
3.
Within the <application></application> block of tags, add the following markup directly
beneath the <activity></activity> tag:
<meta-data android:name="com.here.android.maps.appid"
android:value="YOUR APP ID"/>
<meta-data android:name="com.here.android.maps.apptoken"
android:value="YOUR APP CODE"/>
4.
Replace the YOUR APP ID and YOUR APP CODE strings with appropriate credentials for your
application, which you can acquire by contacting your HERE account representative.
HERE SDK for Android Developer's Guide
► Supplemental Information
97
Note: All users of the HERE SDK are required to register for a HERE App_Id and
App_Code, and to specify those values in their Android manifest XML file. Failure to do
so will result in blocked access to certain features and could lead to degradation in the
quality of other services.
5.
Within the same <application></application> section in your AndroidManifest.xml
file, add the following lines:
<service
android:name="com.here.android.mpa.service.MapService"
android:label="HereMapService"
android:process="global.Here.Map.Service.v2"
android:exported="true" >
<intent-filter>
<action android:name="com.here.android.mpa.service.MapService"
>
</action>
</intent-filter>
</service>
Result: Your application is now configured to use the minimum Android device permissions that are
required by HERE Maps
Edit activity_main.xml
Along with permissions and credentials, you must add an Android <fragment /> tag to set up the
map fragment that your application activity will be associated with. In this section, we will display a
text label (generated as part of the default new application) and a map right below label as follows:
1.
From the Android View, under the res/layout/ folder of your project, double-click the
activity_main.xml file to open it for editing.
2.
Ensure that the XML file has <LinearLayout></LinearLayout> as its root element.
Depending on your version of Android Studio, this may be a RelativeLayout instead. If that is
the case, replace the contents of the file with the following:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</LinearLayout>
HERE SDK for Android Developer's Guide
► Supplemental Information
3.
98
Add the following markup beneath the <TextView/> tag:
<!-- Map Fragment embedded with the map object -->
<fragment
class="com.here.android.mpa.mapping.MapFragment"
android:id="@+id/mapfragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Result: When MapFragment is initialized, your application's MainActivity will contain a
MapFragment UI element (with the ID mapfragment) that owns a Map object.
Initializing the Map Fragment
When you have defined the basic layout of the application and acquired necessary permissions, the
final step is to initialize the instance of the MapFragment class, thus creating and associating a Map
with the MapFragment declared in the activity_main.xml file:
•
•
From the Android View, double-click the MainActivity.java file to open it for editing.
Revise the import statements and functional logic of the MainActivity to look like the following:
package com.mapstutorial.helloheremaps;
import android.app.Activity;
import android.os.Bundle;
import
import
import
import
com.here.android.mpa.common.GeoCoordinate;
com.here.android.mpa.common.OnEngineInitListener;
com.here.android.mpa.mapping.Map;
com.here.android.mpa.mapping.MapFragment;
public class MainActivity extends Activity {
// map embedded in the map fragment
private Map map = null;
// map fragment embedded in this activity
private MapFragment mapFragment = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Search for the map fragment to finish setup by calling init().
mapFragment = (MapFragment)getFragmentManager().findFragmentById(
R.id.mapfragment);
mapFragment.init(new OnEngineInitListener() {
@Override
public void onEngineInitializationCompleted(
OnEngineInitListener.Error error)
{
if (error == OnEngineInitListener.Error.NONE) {
// retrieve a reference of the map from the map fragment
map = mapFragment.getMap();
// Set the map center to the Vancouver region (no animation)
map.setCenter(new GeoCoordinate(49.196261, -123.004773, 0.0),
Map.Animation.NONE);
// Set the zoom level to the average between min and max
map.setZoomLevel(
(map.getMaxZoomLevel() + map.getMinZoomLevel()) / 2);
HERE SDK for Android Developer's Guide
► Supplemental Information
99
} else {
System.out.println("ERROR: Cannot initialize Map Fragment");
}
}
});
}
}
Result: You can run your simple application by pressing the key combination Ctrl + R from within
Android Studio. The application will render a map retrieved from the HERE servers. When you are
running your application on a device, make sure a data connection is enabled.
Adding a MapFragment at Runtime
Earlier tutorials in this document featured adding a MapFragment to an activity by editing the layout
XML file. You can also add a MapFragment to an activity dynamically, during runtime, by performing
the following steps in the Activity class:
1.
Create a layout container:
final int CONTAINER_ID = 1234567;
LinearLayout layoutContainer = new LinearLayout(this);
layoutContainer.setOrientation(LinearLayout.HORIZONTAL);
layoutContainer.setId(CONTAINER_ID);
2.
Define a map tag:
final String MAP_TAG = "map_tag";
3.
Create a map fragment and add it using the fragment manager:
mapFragment = new MapFragment();
getFragmentManager().beginTransaction().add(layoutContainer.getId(), mapFragment,
MAP_TAG).commit();
4.
Initialize the map fragment by implementing OnEngineInitListener:
MyOnEngineInitListener onEngineInitListener = new MyOnEngineInitListener();
mapFragment.init(this, onEngineInitListener);
5.
Finally, show the content view:
setContentView(layoutContainer);
For more information on adding a fragment at runtime, please see this article: https://
developer.android.com/training/basics/fragments/fragment-ui.html#AddAtRuntime.
HERE SDK for Android Developer's Guide
► Supplemental Information
100
Compatibility Fragments
The HERE SDK for Android previously provided the MapCompatibilityFragment for applications
targeting Android SDK versions 2.3.3 to 2.3.7. As of HERE SDK version 2.1, this is deprecated and not
further supported. It is recommended that developers migrate to use MapFragment , with at least
version 4.0 of the Android SDK, as soon as possible.
Size Management
This section provides tips on reducing the size of the HERE SDK so your application will use less
storage on consumer devices.
Remove Unused Font Files
By default, the HERE SDK for Android includes a number of font files to support different languages.
These files may range from a few hundred kilobytes to a few megabytes in size. You can remove
unused font files to reduce the size of your HERE SDK-enabled application.
To remove HERE SDK font files, perform these steps on your existing application project:
1.
From the Eclipse Package Explorer, double-click on the libs folder to reveal its contents
HERE SDK for Android Developer's Guide
► Supplemental Information
2.
101
Double-click on the armeabi-v7a folder to reveal its contents
Figure 34: Fonts in Eclipse
3.
Right-click and delete any unused font files. The optional fonts included in this directory are:
•
libNanumGothicFontPkg.so - Korean
•
libPureArabicFontPkg.so - Arabic
•
libPureChineseFontPkg.so - Chinese
•
libPureIndicSouthFontPkg.so - Hindi
•
libPureThaiFontPkg.so - Thai
Note: Be careful while performing this step. Deleting a file that is not in this list will cause
errors in your application.
After completing these steps, your application will take up less space when it is installed on a device.
The maximum amount that you can save with these steps is approximately 3.5MB.
HERE SDK for Android Developer's Guide
► Supplemental Information
102
Development Tips
This section provides tips on building your application using the HERE SDK for Android.
Lapsed Listeners and Garbage Collection
The HERE SDK provides a number of listener interfaces, such as Map.OnSchemeChangedListener,
Map.OnMapTransformListener, and MapGesture.OnGestureListener. To use one of these
listeners, you are required to implement and create a listener instance, and register it with another
object (using a method such as addSchemeChangedListener()) in order to be notified when the
relevant event occurs. Unfortunately, this coding pattern can also easily lead to the lapsed listener
problem, where available memory is used up by listener objects that are not explicitly unregistered
and automatically garbage collected.
In order to avoid this issue, the HERE SDK, in some cases, accepts listener objects in
WeakReference containers. This has the advantage of avoiding lapsed listeners, but it also means
that you will need to be aware that registered listeners may be garbage collected. In order to avoid
any issues with this design, please be sure to retain a strong reference to your listener instances
(for example, by assigning it to a class variable) if you would like to manage its garbage collection
lifecycle. The listener object will not be automatically garbage collected as long as a strong reference
exists.
Working with Getters
Please note that classes in the HERE SDK return copies of objects in its getters. For example,
MapPolyline.getPolyline() does not return the same GeoPolyline instance that was
used to construct the MapPolyline object; instead, a copy of the GeoPolyline is returned.
Since this returned object is a copy, you cannot dynamically modify the MapPolyline instance
by modifying this object. If you would like to make changes to MapPolyline, you must call
setGeoPolyline(GeoPolyline) instead.
HERE SDK for Android Developer's Guide
► API Reference
103
Chapter
5
API Reference
Topics:
•
common
•
mapping
•
routing
•
search
The HERE SDK for Android allows you to add HERE Maps, Routing
and Search functionality to your Android applications. The
following pages provide a detailed reference to the packages and
classes that make up the SDK.
Open Source Software Notices
If you use the HERE SDK for Android in your application, you must
embed or link to the HERE copyright and various open source
software licenses. You can find a copy of these licenses in the SDK
Release Notes, or in the [SDK package]/copyright.txt file.
HERE SDK for Android Developer's Guide
► API Reference
104
common
The package common is a member of com.here.android.mpa.
Package Summary
common
This package includes classes, interfaces, and enumerations that are generally used by other
packages in the Android SDK.
Package Details
This package includes classes, interfaces, and enumerations that are generally used by other
packages in the Android SDK.
However, the following classes are key classes that serves as the entry point to services provided by
our SDK:
•
•
•
MapEngine - is the entry point for all services provided. It must be initialized before using our
services.
PositioningManager - is the entry point for our positioning service.
MapActivity - can be used for applications that uses our headless APIs without having to manually
handle the MapEngine setup.
For more information, please refer to our User Guide or the documentation provided by the individual
classes above.
ConnectionInfo
The class ConnectionInfo is a member of com.here.android.mpa.common .
Class Summary
public final class ConnectionInfo
extends java.lang.Object
Encapsulates information related to network connections.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
105
Constructor Summary
Table 1: Constructors in ConnectionInfo
Constructors
ConnectionInfo ()
Public constructor.
Method Summary
Table 2: Methods in ConnectionInfo
Methods
public long
getBytesDownloaded ()
Gets the amount of data downloaded in bytes.
Class Details
Encapsulates information related to network connections.
Constructor Details
ConnectionInfo ()
Public constructor.
Method Details
public long getBytesDownloaded ()
Gets the amount of data downloaded in bytes.
The amount is cumulative since the application process was created. If the process is terminated and
recreated, the count will begin again from 0.
Returns:
The data downloaded in bytes
HERE SDK for Android Developer's Guide
► API Reference
CopyrightLogoPosition
The enumeration CopyrightLogoPosition is a member of com.here.android.mpa.common .
Enumeration Summary
public final enumeration CopyrightLogoPosition
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values that describe on-display view positions for the HERE copyright logo.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 3: Enum Constants in CopyrightLogoPosition
Fields
public static final CopyrightLogoPosition
TOP_LEFT
The copyright logo is positioned at the top-left portion of the display view.
public static final CopyrightLogoPosition
TOP_CENTER
The copyright logo is positioned at the top-center portion of the display view.
public static final CopyrightLogoPosition
TOP_RIGHT
The copyright logo is positioned at the top-right portion of the display view.
public static final CopyrightLogoPosition
BOTTOM_CENTER
The copyright logo is positioned at the bottom-center portion of the display view.
public static final CopyrightLogoPosition
BOTTOM_LEFT
Deprecated: As of release 2.1, BOTTOM_LEFT will have identical behaviours as BOTTOM_CENTER in the MapView and
TOP_CENTER in the StreetLevelView.
The copyright logo is positioned at the bottom-left portion of the display view.
public static final CopyrightLogoPosition
BOTTOM_RIGHT
Deprecated: As of release 2.1, BOTTOM_RIGHT will have identical behaviours as BOTTOM_CENTER in the MapView and
TOP_CENTER in the StreetLevelView.
The copyright logo is positioned at the bottom-right portion of the display view.
106
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 4: Methods in CopyrightLogoPosition
Methods
public static CopyrightLogoPosition
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static CopyrightLogoPosition[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values that describe on-display view positions for the HERE copyright logo.
Enum Constant Details
public static final CopyrightLogoPosition TOP_LEFT
The copyright logo is positioned at the top-left portion of the display view.
public static final CopyrightLogoPosition TOP_CENTER
The copyright logo is positioned at the top-center portion of the display view.
public static final CopyrightLogoPosition TOP_RIGHT
The copyright logo is positioned at the top-right portion of the display view.
public static final CopyrightLogoPosition BOTTOM_CENTER
The copyright logo is positioned at the bottom-center portion of the display view.
public static final CopyrightLogoPosition BOTTOM_LEFT
Deprecated: As of release 2.1, BOTTOM_LEFT will have identical behaviours as BOTTOM_CENTER in the MapView and
TOP_CENTER in the StreetLevelView.
The copyright logo is positioned at the bottom-left portion of the display view.
107
HERE SDK for Android Developer's Guide
► API Reference
108
public static final CopyrightLogoPosition BOTTOM_RIGHT
Deprecated: As of release 2.1, BOTTOM_RIGHT will have identical behaviours as BOTTOM_CENTER in the MapView and
TOP_CENTER in the StreetLevelView.
The copyright logo is positioned at the bottom-right portion of the display view.
Method Details
public static CopyrightLogoPosition valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static CopyrightLogoPosition[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
GeoBoundingBox
The class GeoBoundingBox is a member of com.here.android.mpa.common .
Class Summary
public final class GeoBoundingBox
extends java.lang.Object
Represents a rectangular area in a geographic coordinate system.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
Constructor Summary
Table 5: Constructors in GeoBoundingBox
Constructors
GeoBoundingBox ()
Deprecated: As of SDK 2.1.
Constructor that creates a bounding box with a top left coordinate of (0,0,0) and a bottom right coordinate of (0,0,0).
GeoBoundingBox (GeoCoordinate topLeft, GeoCoordinate bottomRight)
Creates a GeoBoundingBox with specified top-left and bottom-right coordinates.
GeoBoundingBox (GeoCoordinate center, float height, float width)
Creates a GeoBoundingBox with a specified center and width and height in distance.
Method Summary
Table 6: Methods in GeoBoundingBox
Methods
public boolean
contains (GeoBoundingBox bbox)
Determines whether the specified GeoBoundingBox is covered entirely by this GeoBoundingBox .
public boolean
contains (GeoCoordinate coord)
Determines whether the specified GeoCoordinate is contained within this GeoBoundingBox.
public boolean
equals (Object other)
For documentation, see java.lang.Object
public void
expand (float latitudeMeters, float longitudeMeters)
Expands the GeoBoundingBox by a fixed distance.
public GeoCoordinate
getBottomRight ()
Gets the current bottom-right coordinate of the GeoBoundingBox.
public GeoCoordinate
getCenter ()
Gets the center GeoCoordinate of the GeoBoundingBox.
public double
getHeight ()
Gets the current GeoBoundingBox height, in degrees.
public GeoCoordinate
getTopLeft ()
Gets the current top-left coordinate of the GeoBoundingBox.
109
HERE SDK for Android Developer's Guide
► API Reference
110
Methods
public double
getWidth ()
Gets the current GeoBoundingBox width, in degrees.
public int
hashCode ()
For documentation, see java.lang.Object
public boolean
intersects (GeoBoundingBox bbox)
Determines whether the intersection of this GeoBoundingBox instance and the specified GeoBoundingBox is non-empty.
public boolean
isEmpty ()
Determines whether the size of the enclosed GeoBoundingBox area is 0.
public boolean
isValid ()
Deprecated: As of SDK 2.1, it is now impossible to create an invalid bounding box.
This method is no longer useful as the constructor will throw an IllegalArgumentException if the coordinates would
create an invalid bounding box.
public GeoBoundingBox
merge (GeoBoundingBox bbox)
Merges two GeoBoundingBox objects by returning the smallest GeoBoundingBox covering both this GeoBoundingBox and
the specified GeoBoundingBox .
public GeoBoundingBox
bboxes)
merge (java.util.List <com.here.android.mpa.common.GeoBoundingBox>
Merges multiple GeoBoundingBox objects by returning the smallest GeoBoundingBox covering all specified
GeoBoundingBox objects.
public void
resizeToCenter (GeoCoordinate coord)
Increases the size of the GeoBoundingBox until the specified GeoCoordinate is located at the center.
public boolean
setBottomRight (GeoCoordinate bottomRight)
Sets a bottom-right coordinate for the GeoBoundingBox.
public boolean
setCoordinates (GeoCoordinate topLeft, GeoCoordinate bottomRight)
Sets coordinates for the GeoBoundingBox.
public boolean
setTopLeft (GeoCoordinate topLeft)
Sets a top-left coordinate for the GeoBoundingBox.
public String
toString ()
For documentation, see java.lang.Object
HERE SDK for Android Developer's Guide
► API Reference
111
Class Details
Represents a rectangular area in a geographic coordinate system.
Although a bounding box is specified by its top-left and bottom-right corner, the box is not
necessarily the smallest rectangle spanned by these two points. It is possible to define geobounding
boxes that are wider than 180 degrees or higher then 90 degrees (e.g. by setting the longitude of the
top-left corner to a bigger value than the longitude of the bottom-right corner). Please note the topleft corner's latitude must be greater than or equal to bottom-right corner's latitude. Otherwise, the
bounding box will be in invalid state.
For example, a geobounding box with longitude of -180 degrees for the top-left corner and a
longitude of 180 degrees for the bottom-right corner will construct an area that encircles the globe,
whereas a geobounding box with the same longitude value for both corners will construct an area
with a width of 0 degrees.
Constructor Details
GeoBoundingBox ()
Deprecated: As of SDK 2.1.
Use GeoBoundingBox(GeoCoordinate, GeoCoordinate) instead.
Constructor that creates a bounding box with a top left coordinate of (0,0,0) and a bottom right
coordinate of (0,0,0).
GeoBoundingBox (GeoCoordinate topLeft, GeoCoordinate bottomRight)
Creates a GeoBoundingBox with specified top-left and bottom-right coordinates.
Parameters:
topLeft
A GeoCoordinate representing the top-left corner of the bounding box
bottomRight
A GeoCoordinate representing the bottom-right corner of the bounding
box
GeoBoundingBox (GeoCoordinate center, float height, float width)
Creates a GeoBoundingBox with a specified center and width and height in distance.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
112
center
A GeoCoordinate representing the geographical center of the bounding box.
height
The geographical height in meters
width
The geographical width in meters
Method Details
public boolean contains (GeoBoundingBox bbox)
Determines whether the specified GeoBoundingBox is covered entirely by this GeoBoundingBox .
Parameters:
bbox
A GeoBoundingBox to check for containment within this GeoBoundingBox
Returns:
True if covered by the GeoBoundingBox, false otherwise
See also:
public boolean contains (GeoCoordinate coord)
Determines whether the specified GeoCoordinate is contained within this GeoBoundingBox.
Parameters:
coord
A GeoCoordinate to check for containment within this GeoBoundingBox
Returns:
True if contained within the GeoBoundingBox, false otherwise
See also:
public boolean equals (Object other)
For documentation, see java.lang.Object
HERE SDK for Android Developer's Guide
► API Reference
Parameters:
other
public void expand (float latitudeMeters, float longitudeMeters)
Expands the GeoBoundingBox by a fixed distance.
Parameters:
latitudeMeters
The geographical height in meters to expand the GeoBoundingBox
longitudeMeters
The geographical width in meters to expand the GeoBoundingBox
public GeoCoordinate getBottomRight ()
Gets the current bottom-right coordinate of the GeoBoundingBox.
Returns:
The current bottom-right GeoCoordinate
public GeoCoordinate getCenter ()
Gets the center GeoCoordinate of the GeoBoundingBox.
Returns:
The center coordinate of the GeoBoundingBox
public double getHeight ()
Gets the current GeoBoundingBox height, in degrees.
Returns:
The current height
public GeoCoordinate getTopLeft ()
113
HERE SDK for Android Developer's Guide
► API Reference
114
Gets the current top-left coordinate of the GeoBoundingBox.
Returns:
The current top-left GeoCoordinate
public double getWidth ()
Gets the current GeoBoundingBox width, in degrees.
Returns:
The current width
public int hashCode ()
For documentation, see java.lang.Object
public boolean intersects (GeoBoundingBox bbox)
Determines whether the intersection of this GeoBoundingBox instance and the specified
GeoBoundingBox is non-empty.
Parameters:
bbox
A GeoBoundingBox to check for intersection with this GeoBoundingBox
Returns:
True if the intersection of GeoBoundingBox objects is non-empty, false otherwise
public boolean isEmpty ()
Determines whether the size of the enclosed GeoBoundingBox area is 0.
Returns:
True if the size of the enclosed area is 0, false otherwise
public boolean isValid ()
Deprecated: As of SDK 2.1, it is now impossible to create an invalid bounding box.
HERE SDK for Android Developer's Guide
► API Reference
115
This method is no longer useful as the constructor will throw an IllegalArgumentException if
the coordinates would create an invalid bounding box.
Returns:
true always.
public GeoBoundingBox merge (GeoBoundingBox bbox)
Merges two GeoBoundingBox objects by returning the smallest GeoBoundingBox covering both this
GeoBoundingBox and the specified GeoBoundingBox .
Parameters:
bbox
A GeoBoundingBox to merge with this GeoBoundingBox
Returns:
The smallest GeoBoundingBox that covers both of the merged GeoBoundingBox objects
See also:
common.GeoBoundingBox.merge (List)
public GeoBoundingBox merge (java.util.List
<com.here.android.mpa.common.GeoBoundingBox> bboxes)
Merges multiple GeoBoundingBox objects by returning the smallest GeoBoundingBox covering all
specified GeoBoundingBox objects.
Parameters:
bboxes
A list of GeoBoundingBox objects to merge
Returns:
The smallest GeoBoundingBox that covers all of the merged GeoBoundingBox objects
See also:
common.GeoBoundingBox.merge (GeoBoundingBox)
public void resizeToCenter (GeoCoordinate coord)
Increases the size of the GeoBoundingBox until the specified GeoCoordinate is located at the center.
HERE SDK for Android Developer's Guide
► API Reference
116
Parameters:
coord
A GeoCoordinate that will become the center of the resized GeoBoundingBox
public boolean setBottomRight (GeoCoordinate bottomRight)
Sets a bottom-right coordinate for the GeoBoundingBox.
Parameters:
bottomRight
A GeoCoordinate representing the desired bottom-right coordinate
Returns:
True if setBottomRight complete successfully.
public boolean setCoordinates (GeoCoordinate topLeft, GeoCoordinate
bottomRight)
Sets coordinates for the GeoBoundingBox.
Parameters:
topLeft
A GeoCoordinate representing the desired top-left coordinate
bottomRight
A GeoCoordinate representing the desired bottom-right coordinate
Returns:
True if setCoordinates complete successfully.
public boolean setTopLeft (GeoCoordinate topLeft)
Sets a top-left coordinate for the GeoBoundingBox.
Parameters:
topLeft
A GeoCoordinate representing the desired top-left coordinate
Returns:
True if setTopLeft complete successfully.
HERE SDK for Android Developer's Guide
► API Reference
public String toString ()
For documentation, see java.lang.Object
GeoCoordinate
The class GeoCoordinate is a member of com.here.android.mpa.common .
Class Summary
public final class GeoCoordinate
extends java.lang.Object
Represents a WGS84 coordinate with double precision.
[For complete information, see the section Class Details]
Constructor Summary
Table 7: Constructors in GeoCoordinate
Constructors
GeoCoordinate (double latitude, double longitude)
Creates a GeoCoordinate with specified latitude and longitude values.
GeoCoordinate (double latitude, double longitude, double altitude)
Creates a GeoCoordinate with specified latitude, longitude and altitude values.
GeoCoordinate (GeoCoordinate coordinate)
Creates a copy of an existing GeoCoordinate object.
Field Summary
Table 8: Fields in GeoCoordinate
Fields
public static final int
UNKNOWN_ALTITUDE
Definition of an unknown altitude.
117
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 9: Methods in GeoCoordinate
Methods
public double
distanceTo (GeoCoordinate coord)
Calculates the distance (using the Haversine formula), as measured in meters, between this GeoCoordinate and the
specified GeoCoordinate .
public boolean
equals (Object other)
For documentation, see java.lang.Object
public double
getAltitude ()
Gets the current altitude, as measured in meters above sea level, of the GeoCoordinate (z-axis on a map).
public double
getHeading (GeoCoordinate coord)
Returns heading from this point to the given coordinate in degrees.
public double
getLatitude ()
Gets the current latitude, as measured in degrees, of the GeoCoordinate .
public double
getLongitude ()
Gets the current longitude, as measured in degrees, of the GeoCoordinate .
public int
hashCode ()
For documentation, see java.lang.Object
public boolean
isValid ()
Determines whether the GeoCoordinate object is valid.
public void
setAltitude (double altitude)
Sets an altitude value, in meters above sea level, for the GeoCoordinate .
public void
setLatitude (double latitude)
Sets a latitude value, in degrees, for the GeoCoordinate .
public void
setLongitude (double longitude)
Sets a longitude value, in degrees, for the GeoCoordinate .
public String
toString ()
For documentation, see java.lang.Object
118
HERE SDK for Android Developer's Guide
► API Reference
119
Class Details
Represents a WGS84 coordinate with double precision. A GeoCoordinate encapsulates a latitude
and longitude value, plus an optional altitude value.
Constructor Details
GeoCoordinate (double latitude, double longitude)
Creates a GeoCoordinate with specified latitude and longitude values.
Parameters:
latitude
Initial latitude value, in degrees, between -90.0 and 90.0 inclusive. If a
passed value is above the maximum or below the minimum, it will be adjusted to the nearest acceptable value
longitude
Initial longitude value, in degrees, greater than or equal to -180.0 and less
than 180.0. Any unsupported value will be converted to its equivalent within the supported range (e.g. a value of -200.0 will be corrected to 160.0
(-200.0 + 360.0))
See also:
common.GeoCoordinate.GeoCoordinate (double, double, double)
GeoCoordinate (double latitude, double longitude, double altitude)
Creates a GeoCoordinate with specified latitude, longitude and altitude values.
Parameters:
latitude
Initial latitude value, in degrees, between -90.0 and 90.0 inclusive. If a
passed value is above the maximum or below the minimum, it will be adjusted to the nearest acceptable value
longitude
Initial longitude value, in degrees, greater than or equal to -180.0 and less
than 180.0. Any unsupported value will be converted to its equivalent within the supported range (e.g. a value of -200.0 will be corrected to 160.0
(-200.0 + 360.0))
HERE SDK for Android Developer's Guide
► API Reference
altitude
See also:
common.GeoCoordinate.GeoCoordinate (double, double)
common.GeoCoordinate.GeoCoordinate (GeoCoordinate)
GeoCoordinate (GeoCoordinate coordinate)
Creates a copy of an existing GeoCoordinate object.
Parameters:
A GeoCoordinate object used to initialize the new GeoCoordinate
See also:
common.GeoCoordinate.GeoCoordinate (double, double, double)
common.GeoCoordinate.GeoCoordinate (double, double)
Field Details
public static final int UNKNOWN_ALTITUDE
Definition of an unknown altitude.
Method Details
public double distanceTo (GeoCoordinate coord)
Calculates the distance (using the Haversine formula), as measured in meters, between this
GeoCoordinate and the specified GeoCoordinate .
Parameters:
coord
Returns:
Initial altitude value, in meters, between -10000.0 and 10000.0 inclusive. If a
passed value is above the maximum or below the minimum, it will be adjusted to the nearest acceptable value
coordinate
120
A second GeoCoordinate some distance away
HERE SDK for Android Developer's Guide
► API Reference
121
The distance between the coordinates
public boolean equals (Object other)
For documentation, see java.lang.Object
Parameters:
other
public double getAltitude ()
Gets the current altitude, as measured in meters above sea level, of the GeoCoordinate (z-axis on a
map).
Returns:
The current altitude (returns 0.0 if the altitude is unavailable)
public double getHeading (GeoCoordinate coord)
Returns heading from this point to the given coordinate in degrees.
Parameters:
coord
A second GeoCoordinate to which the heading is calculated
Returns:
Heading from this coordinate to the given coordinate, in degrees, from north increasing clockwise.
public double getLatitude ()
Gets the current latitude, as measured in degrees, of the GeoCoordinate . Latitude represents the
north-south coordinate, or the y-axis on a map.
Returns:
The current latitude
public double getLongitude ()
HERE SDK for Android Developer's Guide
► API Reference
122
Gets the current longitude, as measured in degrees, of the GeoCoordinate . Longitude represents
the east-west coordinate, or the x-axis on a map.
Returns:
The current longitude
public int hashCode ()
For documentation, see java.lang.Object
public boolean isValid ()
Determines whether the GeoCoordinate object is valid. An invalid GeoCoordinate may be
returned by PositioningManager if there is no positive lock on a GPS position.
Returns:
True if the GeoCoordinate is valid, false otherwise
public void setAltitude (double altitude)
Sets an altitude value, in meters above sea level, for the GeoCoordinate .
Parameters:
altitude
A double-precision altitude value, a range of between -10000.0 and 10000.0
inclusive. If an invalid value is specified, it will be adjusted to the closest possible altitude value (For example, a specified value of -10200.0 will be set to
-10000.0)
public void setLatitude (double latitude)
Sets a latitude value, in degrees, for the GeoCoordinate .
Parameters:
latitude
A double-precision latitude value, a range between -90.0 and 90.0 inclusive.
If an invalid value is specified, it will be adjusted to the closest possible latitude value (For example, a specified value of -100 will be set to -90.0)
HERE SDK for Android Developer's Guide
► API Reference
123
public void setLongitude (double longitude)
Sets a longitude value, in degrees, for the GeoCoordinate .
Parameters:
longitude
A double-precision longitude value, a range between -180.0 and less than
180.0 inclusive. If an invalid value is specified, it will be adjusted to the closest possible longitude value (For example, a specified value of -200.0 will be
set to 160.0)
public String toString ()
For documentation, see java.lang.Object
GeoPolygon
The class GeoPolygon is a member of com.here.android.mpa.common .
Class Summary
public final class GeoPolygon
extends com.here.android.mpa.common.GeoPolyline, java.lang.Object
Represents a GeoPolygon a polygon object defined in terms of the geographic coordinates of its
vertices.
[For complete information, see the section Class Details]
Constructor Summary
Table 10: Constructors in GeoPolygon
Constructors
GeoPolygon ()
Default Constructor
GeoPolygon (java.util.List <com.here.android.mpa.common.GeoCoordinate> points)
HERE SDK for Android Developer's Guide
► API Reference
124
Constructors
Constructor that creates a new instance of GeoPolygon from a list of points.
Method Summary
Table 11: Methods in GeoPolygon
Methods
public boolean
equals (Object other)
Checks whether the given GeoPolygon object is equal to that supplied by the caller.
public int
hashCode ()
Obtains the hash code for the given object.
Class Details
Represents a GeoPolygon a polygon object defined in terms of the geographic coordinates of its
vertices.
The only difference between a GeoPolygon and a GeoPolyline is that the polygon represents a
closed loop of points. The minimum number of points in a GeoPolygon must be three.
This class can be used with MapPolygon to render a polygon.
Constructor Details
GeoPolygon ()
Default Constructor
GeoPolygon (java.util.List <com.here.android.mpa.common.GeoCoordinate>
points)
Constructor that creates a new instance of GeoPolygon from a list of points.
Parameters:
points
See also:
A list of points to form the GeoPolygon.
HERE SDK for Android Developer's Guide
► API Reference
125
Method Details
public boolean equals (Object other)
Checks whether the given GeoPolygon object is equal to that supplied by the caller. Two objects are
equal if they are both instances of GeoPolygon and the coordinates of their vertices are the same.
Parameters:
other
A polygon object to compare to the given polygon.
Returns:
true if the polygons are equal, otherwise false.
public int hashCode ()
Obtains the hash code for the given object.
Returns:
A value representing the hash code.
GeoPolyline
The class GeoPolyline is a member of com.here.android.mpa.common .
Class Summary
public class GeoPolyline
extends java.lang.Object
Interface representing a GeoPolyline .
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
Constructor Summary
Table 12: Constructors in GeoPolyline
Constructors
GeoPolyline ()
Public Constructor
GeoPolyline (java.util.List <com.here.android.mpa.common.GeoCoordinate> points)
Creates a GeoPolyline from a list of points.
Method Summary
Table 13: Methods in GeoPolyline
Methods
public void
add (java.util.List <com.here.android.mpa.common.GeoCoordinate> points)
Add a list of new points into the GeoPolyline
public void
add (GeoCoordinate point)
Add a new point into the GeoPolyline
public void
clear ()
Remove all points from the GeoPolyline
public boolean
contains (GeoCoordinate point)
Check to see if a GeoCoordinate resides within this GeoPolyline
public boolean
equals (Object other)
For documentation, see java.lang.Object
public GeoBoundingBox
getBoundingBox ()
Get the geographic bounding box that contains this GeoPolyline .
public GeoCoordinate
getNearest (GeoCoordinate point)
Gets the GeoCoordinate along the path of the MapPolyline that is closest to the specified GeoCoordinate .
public int
getNearestIndex (GeoCoordinate point)
Gets the index in the path array that is closest to the specified GeoCoordinate .
public int
getNumberOfPoints ()
Get the total number of points currently in the GeoPolyline .
public GeoCoordinate
getPoint (int index)
126
HERE SDK for Android Developer's Guide
► API Reference
127
Methods
Get a point in the GeoPolyline .
public int
hashCode ()
For documentation, see java.lang.Object
public void
insert (GeoCoordinate point, int index)
Insert a point into the GeoPolyline at index
public double
length ()
The geographical length of this GeoPolyline .
public void
remove (int index)
Remove a specific point from the GeoPolyline
Class Details
Interface representing a GeoPolyline . A GeoPolyline consists of 2 or more points. This class can
be used with MapPolyline to render a polyline.
Constructor Details
GeoPolyline ()
Public Constructor
GeoPolyline (java.util.List <com.here.android.mpa.common.GeoCoordinate>
points)
Creates a GeoPolyline from a list of points.
Parameters:
points
See also:
A list of points to form the GeoPolyline
HERE SDK for Android Developer's Guide
► API Reference
128
Method Details
public void add (java.util.List <com.here.android.mpa.common.GeoCoordinate>
points)
Add a list of new points into the GeoPolyline
Parameters:
points
A list of {code GeoCoordinate}s to be added
public void add (GeoCoordinate point)
Add a new point into the GeoPolyline
Parameters:
point
Point to be added
public void clear ()
Remove all points from the GeoPolyline
public boolean contains (GeoCoordinate point)
Check to see if a GeoCoordinate resides within this GeoPolyline
Parameters:
point
The coordinate that will be used to match against the points in this
GeoPolyline
Returns:
boolean true if the point is in this GeoPolyline
public boolean equals (Object other)
For documentation, see java.lang.Object
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
other
129
public GeoBoundingBox getBoundingBox ()
Get the geographic bounding box that contains this GeoPolyline .
Returns:
GeoBoundingBox that contains this GeoPolyline. Can be null if the line has fewer than 2 points.
public GeoCoordinate getNearest (GeoCoordinate point)
Gets the GeoCoordinate along the path of the MapPolyline that is closest to the specified
GeoCoordinate .
Parameters:
point
A GeoCoordinate reference point for finding the nearest GeoCoordinate
along the MapPolyline path
Returns:
The GeoCoordinate along the MapPolyline path that is closest to the specified GeoCoordinate
See also:
common.GeoPolyline.getNearestIndex (GeoCoordinate)
public int getNearestIndex (GeoCoordinate point)
Gets the index in the path array that is closest to the specified GeoCoordinate .
Parameters:
point
A GeoCoordinate reference point for finding the nearest index in the path
array
Returns:
The index of the path array that is closest to the specified GeoCoordinate
See also:
common.GeoPolyline.getNearest (GeoCoordinate)
HERE SDK for Android Developer's Guide
► API Reference
130
public int getNumberOfPoints ()
Get the total number of points currently in the GeoPolyline .
Returns:
int total number of points
public GeoCoordinate getPoint (int index)
Get a point in the GeoPolyline .
Parameters:
index
index of the point to get.
Returns:
GeoCoordinate. Returns null if the index is out of bound.
public int hashCode ()
For documentation, see java.lang.Object
public void insert (GeoCoordinate point, int index)
Insert a point into the GeoPolyline at index
Parameters:
point
Point to be added
index
Index to add the point into the list. index must be within the bounds of 0
and current count of points.
public double length ()
The geographical length of this GeoPolyline .
Returns:
HERE SDK for Android Developer's Guide
► API Reference
double length in meters.
public void remove (int index)
Remove a specific point from the GeoPolyline
Parameters:
index
index of the point to be removed.
GeoPosition
The class GeoPosition is a member of com.here.android.mpa.common .
Class Summary
public class GeoPosition
extends java.lang.Object
Represents position, speed, and heading information as provided by a positioning device.
[For complete information, see the section Class Details]
Constructor Summary
Table 14: Constructors in GeoPosition
Constructors
GeoPosition (GeoCoordinate coordinate)
Public constructor
Field Summary
Table 15: Fields in GeoPosition
Fields
public static final int
UNKNOWN
Definition of an unknown accuracy, course (heading/bearing) or speed
131
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 16: Methods in GeoPosition
Methods
public boolean
equals (Object other)
For documentation, see java.lang.Object
public float
getAltitudeAccuracy ()
Gets the current altitude accuracy as measured by the enabled positioning device.
public GeoCoordinate
getCoordinate ()
Gets the current GeoCoordinate as measured by the enabled positioning device.
public double
getHeading ()
Gets the current course heading as measured by the enabled positioning device.
public float
getLatitudeAccuracy ()
Gets the current latitude accuracy as measured by the enabled positioning device.
public float
getLongitudeAccuracy ()
Gets the current longitude accuracy as measured by the enabled positioning device.
public double
getSpeed ()
Gets the current speed as measured by the enabled positioning device.
public Date
getTimestamp ()
Gets the timestamp for the last position measured by the enabled positioning device.
public int
hashCode ()
For documentation, see java.lang.Object
public boolean
isValid ()
Determines whether the GeoPosition object is valid.
Class Details
Represents position, speed, and heading information as provided by a positioning device.
Constructor Details
GeoPosition (GeoCoordinate coordinate)
Public constructor
132
HERE SDK for Android Developer's Guide
► API Reference
Parameters:
coordinate
A GeoCoordinate to be used by this object.
Field Details
public static final int UNKNOWN
Definition of an unknown accuracy, course (heading/bearing) or speed
Method Details
public boolean equals (Object other)
For documentation, see java.lang.Object
Parameters:
other
public float getAltitudeAccuracy ()
Gets the current altitude accuracy as measured by the enabled positioning device.
Returns:
The current altitude accuracy or GeoPosition.UNKNOWN if unknown.
public GeoCoordinate getCoordinate ()
Gets the current GeoCoordinate as measured by the enabled positioning device.
Returns:
The current GeoCoordinate
public double getHeading ()
Gets the current course heading as measured by the enabled positioning device.
133
HERE SDK for Android Developer's Guide
► API Reference
Returns:
The current course heading or GeoPosition.UNKNOWN if unknown.
public float getLatitudeAccuracy ()
Gets the current latitude accuracy as measured by the enabled positioning device.
Returns:
The current latitude accuracy or GeoPosition.UNKNOWN if unknown.
public float getLongitudeAccuracy ()
Gets the current longitude accuracy as measured by the enabled positioning device.
Returns:
The current longitude accuracy or GeoPosition.UNKNOWN if unknown.
public double getSpeed ()
Gets the current speed as measured by the enabled positioning device.
Returns:
The current speed or GeoPosition.UNKNOWN if unknown.
public Date getTimestamp ()
Gets the timestamp for the last position measured by the enabled positioning device.
Returns:
The timestamp
public int hashCode ()
For documentation, see java.lang.Object
public boolean isValid ()
134
HERE SDK for Android Developer's Guide
► API Reference
Determines whether the GeoPosition object is valid. A GeoPosition is valid if its associated
GeoCoordinate is valid.
Returns:
True if the GeoPosition is valid, false otherwise
IconCategory
The enumeration IconCategory is a member of com.here.android.mpa.common .
Enumeration Summary
public final enumeration IconCategory
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents all the possible categories for an icon.
[For complete information, see the section Enumeration Details]
See also:
common.Image.setCategory (IconCategory)
Enum Constant Summary
Table 17: Enum Constants in IconCategory
Fields
public static final IconCategory
AIRLINE_ACCESS
public static final IconCategory
AMUSEMENT_PARK
public static final IconCategory
CAR_DEALER
public static final IconCategory
CASINO
public static final IconCategory
CINEMA
public static final IconCategory
COMPANY
public static final IconCategory
CONCERT_HALL
public static final IconCategory
CONGRESS
public static final IconCategory
COURTHOUSE
135
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final IconCategory
CULTURAL_CENTRE
public static final IconCategory
EXHIBITION_CENTRE
public static final IconCategory
GOLF_COURSE
public static final IconCategory
GOVERNMENT_OFFICE
public static final IconCategory
HOLIDAY_PARK
public static final IconCategory
MUSEUM
public static final IconCategory
OPERA
public static final IconCategory
PARKING_GARAGE
public static final IconCategory
PETROL_STATION
public static final IconCategory
PLACE_OF_WORSHIP
public static final IconCategory
POST_OFFICE
public static final IconCategory
RENT_A_CAR_FACILITY
public static final IconCategory
REST_AREA
public static final IconCategory
RESTAURANT
public static final IconCategory
SHOP
public static final IconCategory
SHOPPING_CENTRE
public static final IconCategory
STADIUM
public static final IconCategory
THEATRE
public static final IconCategory
TOURIST_ATTRACTION
public static final IconCategory
TOURIST_INFORMATION_CENTRE
public static final IconCategory
UNIVERSITY
public static final IconCategory
ZOO
public static final IconCategory
LIBRARY
public static final IconCategory
CAMPING
public static final IconCategory
BAR_DISCO
public static final IconCategory
EMBASSY
136
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final IconCategory
FERRY_TERMINAL
public static final IconCategory
FRONTIER_CROSSING
public static final IconCategory
HOSPITAL
public static final IconCategory
HOTEL
public static final IconCategory
PARKING_AREA
public static final IconCategory
POLICE
public static final IconCategory
RAILWAY_STATION
public static final IconCategory
METRO_STATION
public static final IconCategory
AIRPORT
public static final IconCategory
MOUNTAIN_PASS
public static final IconCategory
MOUNTAIN_PEAK
public static final IconCategory
CAR_REPAIR
public static final IconCategory
CASH_DISPENSER
public static final IconCategory
PARK_RECREATION
public static final IconCategory
PHARMACY
public static final IconCategory
BEACH
public static final IconCategory
BUS_STATION
public static final IconCategory
EDUCATION
public static final IconCategory
RESIDENTIAL_AREA
public static final IconCategory
NIGHT_CLUB
public static final IconCategory
PUBLIC_TOILET
public static final IconCategory
LAUNDRY
public static final IconCategory
TAXI_STAND
public static final IconCategory
RAILWAY_ACCESS
public static final IconCategory
BARS_CAFES
public static final IconCategory
PARKING
137
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final IconCategory
SPORT_OUTDOOR
public static final IconCategory
METRO_ACCESS
public static final IconCategory
AUT_METRO_ACCESS
public static final IconCategory
AUT_METRO_STOP
public static final IconCategory
BEL_METRO_ACCESS
public static final IconCategory
BEL_METRO_STOP
public static final IconCategory
CZE_METRO_ACCESS
public static final IconCategory
CZE_METRO_STOP
public static final IconCategory
DEN_METRO_ACCESS
public static final IconCategory
DEN_METRO_STOP
public static final IconCategory
FIN_METRO_ACCESS
public static final IconCategory
FIN_METRO_STOP
public static final IconCategory
FRA_METRO_ACCESS
public static final IconCategory
FRA_METRO_STOP
public static final IconCategory
FRA_RER_ACCESS
public static final IconCategory
FRA_RER_STOP
public static final IconCategory
DEU_METRO_ACCESS
public static final IconCategory
DEU_METRO_STOP
public static final IconCategory
DEU_SBAHN_ACCESS
public static final IconCategory
DEU_SBAHN_STOP
public static final IconCategory
ITA_METRO_ACCESS
public static final IconCategory
ITA_METRO_STOP
public static final IconCategory
NOR_METRO_ACCESS
public static final IconCategory
NOR_METRO_STOP
public static final IconCategory
PRT_METRO_ACCESS
public static final IconCategory
PRT_METRO_STOP
138
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final IconCategory
ESP_BARCELONA_METRO_ACCESS
public static final IconCategory
ESP_BARCELONA_METRO_STOP
public static final IconCategory
ESP_CERCANIAS_METRO_ACCESS
public static final IconCategory
ESP_CERCANIAS_METRO_STOP
public static final IconCategory
ESP_MADRID_METRO_ACCESS
public static final IconCategory
ESP_MADRID_METRO_STOP
public static final IconCategory
SWE_METRO_ACCESS
public static final IconCategory
SWE_METRO_STOP
public static final IconCategory
GBR_GLASGOW_METRO_ACCESS
public static final IconCategory
GBR_GLASGOW_METRO_STOP
public static final IconCategory
GBR_LONDON_METRO_ACCESS
public static final IconCategory
GBR_LONDON_METRO_STOP
public static final IconCategory
ALL
Method Summary
Table 18: Methods in IconCategory
Methods
public static IconCategory
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static IconCategory[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents all the possible categories for an icon.
See also:
common.Image.setCategory (IconCategory)
139
HERE SDK for Android Developer's Guide
► API Reference
Enum Constant Details
public static final IconCategory AIRLINE_ACCESS
public static final IconCategory AMUSEMENT_PARK
public static final IconCategory CAR_DEALER
public static final IconCategory CASINO
public static final IconCategory CINEMA
public static final IconCategory COMPANY
public static final IconCategory CONCERT_HALL
public static final IconCategory CONGRESS
public static final IconCategory COURTHOUSE
public static final IconCategory CULTURAL_CENTRE
public static final IconCategory EXHIBITION_CENTRE
public static final IconCategory GOLF_COURSE
public static final IconCategory GOVERNMENT_OFFICE
140
HERE SDK for Android Developer's Guide
► API Reference
public static final IconCategory HOLIDAY_PARK
public static final IconCategory MUSEUM
public static final IconCategory OPERA
public static final IconCategory PARKING_GARAGE
public static final IconCategory PETROL_STATION
public static final IconCategory PLACE_OF_WORSHIP
public static final IconCategory POST_OFFICE
public static final IconCategory RENT_A_CAR_FACILITY
public static final IconCategory REST_AREA
public static final IconCategory RESTAURANT
public static final IconCategory SHOP
public static final IconCategory SHOPPING_CENTRE
public static final IconCategory STADIUM
141
HERE SDK for Android Developer's Guide
► API Reference
public static final IconCategory THEATRE
public static final IconCategory TOURIST_ATTRACTION
public static final IconCategory TOURIST_INFORMATION_CENTRE
public static final IconCategory UNIVERSITY
public static final IconCategory ZOO
public static final IconCategory LIBRARY
public static final IconCategory CAMPING
public static final IconCategory BAR_DISCO
public static final IconCategory EMBASSY
public static final IconCategory FERRY_TERMINAL
public static final IconCategory FRONTIER_CROSSING
public static final IconCategory HOSPITAL
public static final IconCategory HOTEL
142
HERE SDK for Android Developer's Guide
► API Reference
public static final IconCategory PARKING_AREA
public static final IconCategory POLICE
public static final IconCategory RAILWAY_STATION
public static final IconCategory METRO_STATION
public static final IconCategory AIRPORT
public static final IconCategory MOUNTAIN_PASS
public static final IconCategory MOUNTAIN_PEAK
public static final IconCategory CAR_REPAIR
public static final IconCategory CASH_DISPENSER
public static final IconCategory PARK_RECREATION
public static final IconCategory PHARMACY
public static final IconCategory BEACH
public static final IconCategory BUS_STATION
143
HERE SDK for Android Developer's Guide
► API Reference
public static final IconCategory EDUCATION
public static final IconCategory RESIDENTIAL_AREA
public static final IconCategory NIGHT_CLUB
public static final IconCategory PUBLIC_TOILET
public static final IconCategory LAUNDRY
public static final IconCategory TAXI_STAND
public static final IconCategory RAILWAY_ACCESS
public static final IconCategory BARS_CAFES
public static final IconCategory PARKING
public static final IconCategory SPORT_OUTDOOR
public static final IconCategory METRO_ACCESS
public static final IconCategory AUT_METRO_ACCESS
public static final IconCategory AUT_METRO_STOP
144
HERE SDK for Android Developer's Guide
► API Reference
public static final IconCategory BEL_METRO_ACCESS
public static final IconCategory BEL_METRO_STOP
public static final IconCategory CZE_METRO_ACCESS
public static final IconCategory CZE_METRO_STOP
public static final IconCategory DEN_METRO_ACCESS
public static final IconCategory DEN_METRO_STOP
public static final IconCategory FIN_METRO_ACCESS
public static final IconCategory FIN_METRO_STOP
public static final IconCategory FRA_METRO_ACCESS
public static final IconCategory FRA_METRO_STOP
public static final IconCategory FRA_RER_ACCESS
public static final IconCategory FRA_RER_STOP
public static final IconCategory DEU_METRO_ACCESS
145
HERE SDK for Android Developer's Guide
► API Reference
public static final IconCategory DEU_METRO_STOP
public static final IconCategory DEU_SBAHN_ACCESS
public static final IconCategory DEU_SBAHN_STOP
public static final IconCategory ITA_METRO_ACCESS
public static final IconCategory ITA_METRO_STOP
public static final IconCategory NOR_METRO_ACCESS
public static final IconCategory NOR_METRO_STOP
public static final IconCategory PRT_METRO_ACCESS
public static final IconCategory PRT_METRO_STOP
public static final IconCategory ESP_BARCELONA_METRO_ACCESS
public static final IconCategory ESP_BARCELONA_METRO_STOP
public static final IconCategory ESP_CERCANIAS_METRO_ACCESS
public static final IconCategory ESP_CERCANIAS_METRO_STOP
146
HERE SDK for Android Developer's Guide
► API Reference
147
public static final IconCategory ESP_MADRID_METRO_ACCESS
public static final IconCategory ESP_MADRID_METRO_STOP
public static final IconCategory SWE_METRO_ACCESS
public static final IconCategory SWE_METRO_STOP
public static final IconCategory GBR_GLASGOW_METRO_ACCESS
public static final IconCategory GBR_GLASGOW_METRO_STOP
public static final IconCategory GBR_LONDON_METRO_ACCESS
public static final IconCategory GBR_LONDON_METRO_STOP
public static final IconCategory ALL
Method Details
public static IconCategory valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
HERE SDK for Android Developer's Guide
► API Reference
148
public static IconCategory[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Identifier
The class Identifier is a member of com.here.android.mpa.common .
Class Summary
public final class Identifier
implements android.os.Parcelable
extends java.lang.Object
Represents a 64-bit or 128-bit numeric identifier of an instance of ViewObject .
[For complete information, see the section Class Details]
Field Summary
Table 19: Fields in Identifier
Fields
public static final android.os.Parcelable.Creator <com.here.android.mpa.common.Identifier>
CREATOR
Method Summary
Table 20: Methods in Identifier
Methods
public int
describeContents ()
For documentation, see android.os.Parcelable.describeContents()
public boolean
equals (Object other)
For documentation, see java.lang.Object
public int
hashCode ()
Obtains the hash code for the given object.
HERE SDK for Android Developer's Guide
► API Reference
149
Methods
public String
toString ()
Returns a string representing an Identifier in the form of a 64-bit or 128-bit number.
public void
writeToParcel (Parcel dest, int flags)
For documentation, see android.os.Parcelable.writeToParcel()
Class Details
Represents a 64-bit or 128-bit numeric identifier of an instance of ViewObject . The identifiers are
used by:
•
•
•
•
•
•
•
•
TransitDatabase
MapTransitLayer
MapBuildingLayer
MapBuildingGroup
TransitLineObject
TransitLineInfo
TransitAccessInfo
TransitStopInfo
Field Details
public static final android.os.Parcelable.Creator
<com.here.android.mpa.common.Identifier> CREATOR
Method Details
public int describeContents ()
For documentation, see android.os.Parcelable.describeContents()
public boolean equals (Object other)
For documentation, see java.lang.Object
Parameters:
other
HERE SDK for Android Developer's Guide
► API Reference
public int hashCode ()
Obtains the hash code for the given object.
Returns:
A value representing the hash code.
public String toString ()
Returns a string representing an Identifier in the form of a 64-bit or 128-bit number.
Returns:
A string representation of the Identifier.
public void writeToParcel (Parcel dest, int flags)
For documentation, see android.os.Parcelable.writeToParcel()
Parameters:
dest
flags
Image
The class Image is a member of com.here.android.mpa.common .
Class Summary
public final class Image
extends java.lang.Object
Encapsulates an image file.
[For complete information, see the section Class Details]
150
HERE SDK for Android Developer's Guide
► API Reference
Nested Class Summary
Table 21: Nested Classes in Image
Nested Classes
public static final enumeration
Image.Type
This helps the application know the base type of the Image .
Constructor Summary
Table 22: Constructors in Image
Constructors
Image ()
Public Constructor
Method Summary
Table 23: Methods in Image
Methods
public boolean
equals (Object other)
For documentation, see java.lang.Object
public Bitmap
getBitmap ()
Creates an android.graphics.Bitmap from this Image if the type is BITMAP, null otherwise.
public Image
getBitmapImage (int width, int height)
Creates a new Image object of BITMAP if this object has type SVG, returns null otherwise.
public long
getHeight ()
Gets the current height of the Image , in pixels.
public Image.Type
getType ()
Gets the file type of this Image.
public long
getWidth ()
Gets the current width of the Image , in pixels.
public int
hashCode ()
For documentation, see java.lang.Object
151
HERE SDK for Android Developer's Guide
► API Reference
152
Methods
public boolean
isValid ()
Determines whether the Image object contains a valid image.
public boolean
setBitmap (Bitmap bitmap)
Sets a Bitmap for the Image .
public void
setCategory (IconCategory category)
Sets IconCategory for the Image .
public void
setImageAsset (String assetName)
Sets Image data by an image in the assets directory.
public void
setImageData (byte[] bytes)
Sets an array of byte data for the Image .
public void
setImageFile (String fileName)
Sets Image data by an image file located in the internal storage.
public void
setImageResource (int id)
Sets data for the Image by way of an application's resource.
public void
setLocalUrl (String localUrl)
Sets a local URL that the Image can access for an image.
Class Details
Encapsulates an image file.
Note: although BMP, JPEG and PNG data formats are supported, only basic parsing of a BMP header is
done (gamma correction and color profile information are ignored), and supported BMP data formats
are limited to:
•
•
BMP v3 (standard BMP) with 24/32 bits per pixel without compression
BMP v4/v5 (newer BMP formats) with 24/32 bits per pixel, bit fields compression and A8R8G8B8
pixel format
Constructor Details
Image ()
Public Constructor
HERE SDK for Android Developer's Guide
► API Reference
153
Method Details
public boolean equals (Object other)
For documentation, see java.lang.Object
Parameters:
other
public Bitmap getBitmap ()
Creates an android.graphics.Bitmap from this Image if the type is BITMAP, null otherwise.
Returns:
An android.graphics.Bitmap or null if this Image is not BITMAP.
public Image getBitmapImage (int width, int height)
Creates a new Image object of BITMAP if this object has type SVG, returns null otherwise.
Parameters:
width
The width (in pixels) of the new Image.
height
The height (in pixels) of the new Image.
Returns:
The new Image of type BITMAP or null if the current image type is not SVG or the parameters are
invalid.
public long getHeight ()
Gets the current height of the Image , in pixels.
Returns:
The current height
public Image.Type getType ()
HERE SDK for Android Developer's Guide
► API Reference
Gets the file type of this Image.
Returns:
The Image.Type for this Image object.
public long getWidth ()
Gets the current width of the Image , in pixels.
Returns:
The current width
public int hashCode ()
For documentation, see java.lang.Object
public boolean isValid ()
Determines whether the Image object contains a valid image.
Returns:
True if the Image object is valid and can render an image, false otherwise
public boolean setBitmap (Bitmap bitmap)
Sets a Bitmap for the Image .
Parameters:
bitmap
A Bitmap to be used by the Image
Returns:
True if the Bitmap is set successfully, false otherwise
public void setCategory (IconCategory category)
Sets IconCategory for the Image .
Parameters:
154
HERE SDK for Android Developer's Guide
► API Reference
category
155
An category (such as "museum") for the icon image.
public void setImageAsset (String assetName)
Sets Image data by an image in the assets directory. In particular, this calls openFileInput(String).
Throws:
IOException
throws exception when failure to read the resource
Parameters:
assetName
The name of an image in the assets directory.
public void setImageData (byte[] bytes)
Sets an array of byte data for the Image .
Note: JPEG and BMP are supported.
Parameters:
bytes
An array of byte data containing the Image
public void setImageFile (String fileName)
Sets Image data by an image file located in the internal storage. In particular, this calls
openFileInput(String).
Throws:
IOException
throws exception when failure to read the resource
Parameters:
fileName
The name of the image file.
public void setImageResource (int id)
HERE SDK for Android Developer's Guide
► API Reference
Sets data for the Image by way of an application's resource.
Throws:
IOException
Upon a failure to read the resource
Parameters:
id
An ID for the resource
public void setLocalUrl (String localUrl)
Sets a local URL that the Image can access for an image.
Parameters:
localUrl
The local URL that the Image uses
Type
The enumeration Type is a member of com.here.android.mpa.common.Image .
Enumeration Summary
public static final enumeration Image.Type
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
This helps the application know the base type of the Image .
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 24: Enum Constants in Type
Fields
public static final Image.Type
UNKNOWN
Unknown image type.
public static final Image.Type
BITMAP
156
HERE SDK for Android Developer's Guide
► API Reference
Fields
Bitmap image type.
public static final Image.Type
JPEG
JPEG image type.
public static final Image.Type
PNG
PNG image type.
public static final Image.Type
SVG
SVG image type.
Method Summary
Table 25: Methods in Type
Methods
public static Image.Type
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Image.Type[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
This helps the application know the base type of the Image .
Enum Constant Details
public static final Image.Type UNKNOWN
Unknown image type.
public static final Image.Type BITMAP
Bitmap image type.
public static final Image.Type JPEG
JPEG image type.
157
HERE SDK for Android Developer's Guide
► API Reference
158
public static final Image.Type PNG
PNG image type.
public static final Image.Type SVG
SVG image type.
Method Details
public static Image.Type valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Image.Type[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
MapActivity
The class MapActivity is a member of com.here.android.mpa.common .
Class Summary
public class MapActivity
extends java.lang.Object
An activity class for managing the resource state of the MapEngine.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
159
Constructor Summary
Table 26: Constructors in MapActivity
Constructors
MapActivity ()
Method Summary
Table 27: Methods in MapActivity
Methods
protected void
onCreate (Bundle savedInstanceState)
Called when an instance of the given class is created (map activity begins).
protected void
onInitialized (OnEngineInitListener.Error error)
Called when MapEngine initialization completes.
protected void
onPause ()
Called when map activity pauses (is suspended).
protected void
onResume ()
Called when the given instance of map activity resumes.
Class Details
An activity class for managing the resource state of the MapEngine. When onCreate(Bundle) is called,
it automatically initializes the MapEngine .
Only activities that consume or use an API needs to inherit from MapActivity .
This class overrides the methods android.app.android.app.Activity#onCreate(Bundle),
android.app.android.app.Activity#onResume(), and
android.app.android.app.Activity#onPause() defined in
android.app.android.app.Activity.
Constructor Details
MapActivity ()
HERE SDK for Android Developer's Guide
► API Reference
160
Method Details
protected void onCreate (Bundle savedInstanceState)
Called when an instance of the given class is created (map activity begins). The method issues
an initialization request to the MapEngine. When MapEngine initialization has completed,
onInitialized(Error) is called.
Parameters:
savedInstanceState An object representing the previous saved state of MapActivity; used if a
new instance of this class is to be recreated from a previous session.
See also:
common.MapActivity.onInitialized (OnEngineInitListener.Error)
protected void onInitialized (OnEngineInitListener.Error error)
Called when MapEngine initialization completes. User of MapActivity class can override this to
detect when or if MapEngine is ready for use.
Parameters:
error
An OnEngineInitListener.Error enum value indicates if Engine initialization is
successful or if an error has occurred
protected void onPause ()
Called when map activity pauses (is suspended).
protected void onResume ()
Called when the given instance of map activity resumes.
MapEngine
The class MapEngine is a member of com.here.android.mpa.common .
HERE SDK for Android Developer's Guide
► API Reference
Class Summary
public final class MapEngine
extends java.lang.Object
MapEngine manages all mapping resources and services provided in this SDK.
[For complete information, see the section Class Details]
Nested Class Summary
Table 28: Nested Classes in MapEngine
Nested Classes
public static abstract interface
MapEngine.OnMapDownloadListener
Represents a listener to provide notification upon the start and completion of a data download event.
Method Summary
Table 29: Methods in MapEngine
Methods
public void
addMapDataDownloadListener (MapEngine.OnMapDownloadListener listener)
Adds a OnMapDownloadListener to listen for map data download events.
public static MapEngine
getInstance (Context ctx)
Deprecated: Since 2.1 use getInstance() with init(Context, OnEngineInitListener) instead.
Returns the MapEngine singleton if one has been created.
public static MapEngine
getInstance ()
Returns the MapEngine singleton, if one has already been created.
public int
getResourceReferenceCount ()
Get the current reference count of map resource usage for this application.
public void
init (OnEngineInitListener listener)
Deprecated: Since 2.1 use init(Context, OnEngineInitListener) instead.
Asynchronously initialize the MapEngine .
public void
init (Context context, OnEngineInitListener listener)
Asynchronously initialize the MapEngine .
public void
onPause ()
161
HERE SDK for Android Developer's Guide
► API Reference
162
Methods
Decrements the reference count of map resource usage.
public void
onResume ()
Increments the reference count of map resource usage.
public void
removeMapDataDownloadListener (MapEngine.OnMapDownloadListener listener)
Removes an existing MapDataDownloadListener .
Class Details
MapEngine manages all mapping resources and services provided in this SDK.
MapEngine must be initialized before any of the services can be used. For more information, see
init(OnEngineInitListener).
Users can maintain reference count through the use of onPause() and onResume() thus control when
to relinquish MapEngine services.
MapEngine also allows users to subscribe to data download notifications to provide extra
information.
Method Details
public void addMapDataDownloadListener (MapEngine.OnMapDownloadListener
listener)
Adds a OnMapDownloadListener to listen for map data download events.
Parameters:
listener
A OnMapDownloadListener to add to the MapEngine
See also:
common.MapEngine.removeMapDataDownloadListener (OnMapDownloadListener)
public static MapEngine getInstance (Context ctx)
Deprecated: Since 2.1 use getInstance() with init(Context, OnEngineInitListener) instead.
Returns the MapEngine singleton if one has been created. If not, creates an instance and returns it.
Once the MapEngine instance is available, it must be initialized through one of the following
methods before it can be used:
HERE SDK for Android Developer's Guide
► API Reference
•
•
init(OnEngineInitListener)
MapFragment#init(OnEngineInitListener)
•
•
•
MapFragment#init(Context, OnEngineInitListener)
MapCompatibilityFragment#init(OnEngineInitListener)
MapCompatibilityFragment#init(Context, OnEngineInitListener)
163
Parameters:
ctx
The calling context being used to instantiate the MapEngine.
Returns:
MapEngine instance
public static MapEngine getInstance ()
Returns the MapEngine singleton, if one has already been created.
Once the MapEngine instance is available, it must be initialized through one of the following
methods before it can be used:
•
•
•
•
•
init(OnEngineInitListener)
MapFragment#init(OnEngineInitListener)
MapFragment#init(Context, OnEngineInitListener)
MapCompatibilityFragment#init(OnEngineInitListener)
MapCompatibilityFragment#init(Context, OnEngineInitListener)
Returns:
MapEngine instance
public int getResourceReferenceCount ()
Get the current reference count of map resource usage for this application. When this returns 0, it
indicates that no reference to map resources is being held and the engine is paused. As a result, SDK
functions will not work. When this returns 1 or greater, it is an indication that a reference to map
resources is being held and the engine is active.
It is very important that an application holds a reference to map resources while in active operation
and releases this reference when not in use (e.g. sent to the background). This method is a useful
tool to use while developing an application. This value can be logged while testing to ensure that
references to map resources are handled properly during the lifecycle of the app.
HERE SDK for Android Developer's Guide
► API Reference
164
For users of MapFragment, MapCompatibilityFragment, and MapActivity classes, map resource usage
is handled automatically.
Returns:
The current reference count of map resource usage
public void init (OnEngineInitListener listener)
Deprecated: Since 2.1 use init(Context, OnEngineInitListener) instead.
Asynchronously initialize the MapEngine . MapEngine cannot be used until it has been
initialized successfully. This method is particularly useful for users of headless APIs as the
MapEngine is being automatically initialized as part of the setup process of MapFragments or
MapCompatibilityFragments.
Parameters:
listener
OnEngineInitListener to provide information when MapEngine initialization
completes and if it has been successful.
See also:
mapping.MapFragment.init (OnEngineInitListener)
mapping.MapFragment.init (Context, OnEngineInitListener)
mapping.MapCompatibilityFragment.init (OnEngineInitListener)
mapping.MapCompatibilityFragment.init (Context, OnEngineInitListener)
public void init (Context context, OnEngineInitListener listener)
Asynchronously initialize the MapEngine . MapEngine cannot be used until it has been
initialized successfully. This method is particularly useful for users of headless APIs as the
MapEngine is being automatically initialized as part of the setup process of MapFragments or
MapCompatibilityFragments.
Parameters:
context
context to be used during initialization.
listener
OnEngineInitListener to provide information when MapEngine initialization
completes and if it has been successful.
HERE SDK for Android Developer's Guide
► API Reference
165
See also:
mapping.MapFragment.init (OnEngineInitListener)
mapping.MapFragment.init (Context, OnEngineInitListener)
mapping.MapCompatibilityFragment.init (OnEngineInitListener)
mapping.MapCompatibilityFragment.init (Context, OnEngineInitListener)
public void onPause ()
Decrements the reference count of map resource usage. When the count drops to 0 the engine
will be paused. This should usually be called in an activity's onPause . For users of MapFragment,
MapCompatibilityFragment, and MapActivity classes, it is not necessary to call onPause() as it is
handled automatically.
public void onResume ()
Increments the reference count of map resource usage. This will open all mapping resources if
the reference count becomes 1. This should usually be called in an activity's onResume . For users
of MapFragment, MapCompatibilityFragment, and MapActivity classes, it is not necessary to call
onResume() as it is handled automatically.
public void removeMapDataDownloadListener (MapEngine.OnMapDownloadListener
listener)
Removes an existing MapDataDownloadListener .
Parameters:
listener
A MapDataDownloadListener to remove from the MapEngine
OnMapDownloadListener
The interface OnMapDownloadListener is a member of com.here.android.mpa.common.MapEngine .
Interface Summary
public static abstract interface MapEngine.OnMapDownloadListener
HERE SDK for Android Developer's Guide
► API Reference
166
Represents a listener to provide notification upon the start and completion of a data download event.
[For complete information, see the section Interface Details]
Method Summary
Table 30: Methods in OnMapDownloadListener
Methods
public abstract void
onMapDataDownloadEnd ()
A callback indicating that the map data download has completed
public abstract void
onMapDataDownloadInProgress ()
A callback indicating that a map data download is in progress.
public abstract void
onMapDataDownloadStart ()
A callback indicating that a map data download has started.
Interface Details
Represents a listener to provide notification upon the start and completion of a data download
event. This listener provides callback notifications for any data download event performed by the
SDK regardless of the type of data that is downloaded (map data, traffic data, route data etc.) and
regardless of the operation that triggered the download. Data download is triggered automatically
by the SDK when not enough offline data is available on the device to perform an operation like:
move the Map to a new location, display traffic, calculate a route etc. There can be multiple cycles
of #onMapDataDownloadStart(), #onMapDataDownloadEnd() before all required map data is
downloaded for a specific operation. Users are suggested to wait at least 1 second after receiving
the callback #onMapDataDownloadEnd() to see if there is any new #onMapDataDownloadStart()
notifications. No new notifications means that all required data was downloaded. The only operation
that will not trigger these notifications is when search is performed.
Method Details
public abstract void onMapDataDownloadEnd ()
A callback indicating that the map data download has completed
public abstract void onMapDataDownloadInProgress ()
HERE SDK for Android Developer's Guide
► API Reference
A callback indicating that a map data download is in progress. This notification will be sent after
onMapDataDownloadStart.
public abstract void onMapDataDownloadStart ()
A callback indicating that a map data download has started.
OffScreenRenderer
The interface OffScreenRenderer is a member of com.here.android.mpa.common .
Interface Summary
public abstract interface OffScreenRenderer
Base interface for an offscreen renderer.
[For complete information, see the section Interface Details]
See also:
Nested Class Summary
Table 31: Nested Classes in OffScreenRenderer
Nested Classes
public static abstract interface
OffScreenRenderer.SurfaceUpdatedListener
Listener interface to be notified when the surface has been re-drawn and comitted.
Method Summary
Table 32: Methods in OffScreenRenderer
Methods
public abstract void
getScreenCapture (OnScreenCaptureListener listener)
Returns the full screen bitmap for the Map.
public abstract OffScreenRenderer
setSize (int width, int height)
167
HERE SDK for Android Developer's Guide
► API Reference
168
Methods
Set the size of the requested screen surface
public abstract void
start ()
Start the offscreen renderer.
public abstract void start (SurfaceHolder renderTarget,
OffScreenRenderer.SurfaceUpdatedListener listener)
Start the offscreen renderer.
public abstract void
stop ()
Stop the offscreen renderer.
Interface Details
Base interface for an offscreen renderer. This interface is useful for drawing a Map image without an
actual View.
See also:
Method Details
public abstract void getScreenCapture (OnScreenCaptureListener listener)
Returns the full screen bitmap for the Map. This method is asynchronous and will invoke a callback
once the operation is completed through the OnScreenCaptureListener. The OffScreenRenderer
must be running to create the screen capture.
Parameters:
listener
A OnScreenCaptureListener to listen for the callback when screen capture is complete.
public abstract OffScreenRenderer setSize (int width, int height)
Set the size of the requested screen surface
Parameters:
width
The screen surface width, in number of pixels
HERE SDK for Android Developer's Guide
► API Reference
height
The screen surface height, in number of pixels
Returns:
This OffScreenRenderer
public abstract void start ()
Start the offscreen renderer. A new PBuffer based surface will be allocated. Before calling this
method, setSize(int, int) must have been called with valid values.
public abstract void start (SurfaceHolder renderTarget,
OffScreenRenderer.SurfaceUpdatedListener listener)
Start the offscreen renderer. The renderer will be attached to the supplied SurfaceHolder
argument.
Parameters:
renderTarget
Surface to attach to.
listener
Callback when the surface has been updated
public abstract void stop ()
Stop the offscreen renderer. All resource allocated will be released.
SurfaceUpdatedListener
The interface SurfaceUpdatedListener is a member of
com.here.android.mpa.common.OffScreenRenderer .
Interface Summary
public static abstract interface OffScreenRenderer.SurfaceUpdatedListener
Listener interface to be notified when the surface has been re-drawn and comitted.
[For complete information, see the section Interface Details]
169
HERE SDK for Android Developer's Guide
► API Reference
170
Method Summary
Table 33: Methods in SurfaceUpdatedListener
Methods
public abstract void
onSurfaceUpdated ()
Callback when the surface has been redrawn
Interface Details
Listener interface to be notified when the surface has been re-drawn and comitted.
Method Details
public abstract void onSurfaceUpdated ()
Callback when the surface has been redrawn
OnEngineInitListener
The interface OnEngineInitListener is a member of com.here.android.mpa.common .
Interface Summary
public abstract interface OnEngineInitListener
Represents a listener to provide notification of the engine status upon completion of initialization.
[For complete information, see the section Interface Details]
See also:
common.MapEngine.init (OnEngineInitListener)
Nested Class Summary
Table 34: Nested Classes in OnEngineInitListener
Nested Classes
public static final enumeration
OnEngineInitListener.Error
Represents values describing initialization errors.
HERE SDK for Android Developer's Guide
► API Reference
171
Method Summary
Table 35: Methods in OnEngineInitListener
Methods
public abstract void
onEngineInitializationCompleted (OnEngineInitListener.Error error)
A callback indicating that map engine initialization has completed.
Interface Details
Represents a listener to provide notification of the engine status upon completion of initialization.
See also:
common.MapEngine.init (OnEngineInitListener)
Method Details
public abstract void onEngineInitializationCompleted
(OnEngineInitListener.Error error)
A callback indicating that map engine initialization has completed.
Parameters:
error
If map engine initialized successfully, returns NONE. Otherwise, one of the
other OnEngineInitListener.Error enum values indicating the reason of factory initialization failure.
Error
The enumeration Error is a member of com.here.android.mpa.common.OnEngineInitListener .
Enumeration Summary
public static final enumeration OnEngineInitListener.Error
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing initialization errors.
[For complete information, see the section Enumeration Details]
HERE SDK for Android Developer's Guide
► API Reference
See also:
common.OnEngineInitListener.onEngineInitializationCompleted (Error)
Enum Constant Summary
Table 36: Enum Constants in Error
Fields
public static final OnEngineInitListener.Error
NONE
Initialization completed successfully
public static final OnEngineInitListener.Error
USAGE_EXPIRED
Initialization failed as the SDK is expired
public static final OnEngineInitListener.Error
MODEL_NOT_SUPPORTED
Initialization failed as the device's model is not supported by the SDK
public static final OnEngineInitListener.Error
DEVICE_NOT_SUPPORTED
Initialization failed as the device is not supported by the SDK
public static final OnEngineInitListener.Error
UNKNOWN
Initialization failed for unknown reasons
public static final OnEngineInitListener.Error
MISSING_APP_CREDENTIAL
Initialization failed due to missing App ID and Token.
public static final OnEngineInitListener.Error
BUSY
Initialization cannot be completed as the system is currently busy.
public static final OnEngineInitListener.Error
FILE_RW_ERROR
Unable to write to or read from disk cache.
public static final OnEngineInitListener.Error
INCORRECT_PASSPHRASE
Incorrect pass phrase to unlock the initialize the Engine
public static final OnEngineInitListener.Error
MISSING_PERMISSION
One of the permissions required to run the SDK is missing.
public static final OnEngineInitListener.Error
MISSING_SERVICE
MapService cannot not be found
public static final OnEngineInitListener.Error
MISSING_LIBRARIES
Missing native libraries or missing dependent java libraries which cause native libraries to not load.
172
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 37: Methods in Error
Methods
public static OnEngineInitListener.Error
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static OnEngineInitListener.Error[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing initialization errors.
See also:
common.OnEngineInitListener.onEngineInitializationCompleted (Error)
Enum Constant Details
public static final OnEngineInitListener.Error NONE
Initialization completed successfully
public static final OnEngineInitListener.Error USAGE_EXPIRED
Initialization failed as the SDK is expired
public static final OnEngineInitListener.Error MODEL_NOT_SUPPORTED
Initialization failed as the device's model is not supported by the SDK
public static final OnEngineInitListener.Error DEVICE_NOT_SUPPORTED
Initialization failed as the device is not supported by the SDK
public static final OnEngineInitListener.Error UNKNOWN
Initialization failed for unknown reasons
173
HERE SDK for Android Developer's Guide
► API Reference
174
public static final OnEngineInitListener.Error MISSING_APP_CREDENTIAL
Initialization failed due to missing App ID and Token. Please make sure the following lines
are added to AndroidManifest.xml (Replace with your own appid and token pair) <metadata android:name="com.here.android.maps.appid" android:value="APPID" /> <meta-data
android:name="com.here.android.maps.apptoken" android:value="TOKEN" />
public static final OnEngineInitListener.Error BUSY
Initialization cannot be completed as the system is currently busy. User should check again later.
public static final OnEngineInitListener.Error FILE_RW_ERROR
Unable to write to or read from disk cache.
public static final OnEngineInitListener.Error INCORRECT_PASSPHRASE
Incorrect pass phrase to unlock the initialize the Engine
public static final OnEngineInitListener.Error MISSING_PERMISSION
One of the permissions required to run the SDK is missing.
public static final OnEngineInitListener.Error MISSING_SERVICE
MapService cannot not be found
public static final OnEngineInitListener.Error MISSING_LIBRARIES
Missing native libraries or missing dependent java libraries which cause native libraries to not load.
Method Details
public static OnEngineInitListener.Error valueOf (String name)
HERE SDK for Android Developer's Guide
► API Reference
175
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static OnEngineInitListener.Error[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
OnScreenCaptureListener
The interface OnScreenCaptureListener is a member of com.here.android.mpa.common .
Interface Summary
public abstract interface OnScreenCaptureListener
Listener for Screen Capture asynchronous callback.
[For complete information, see the section Interface Details]
See also:
mapping.MapFragment.getScreenCapture (OnScreenCaptureListener)
mapping.MapCompatibilityFragment.getScreenCapture (OnScreenCaptureListener)
Method Summary
Table 38: Methods in OnScreenCaptureListener
Methods
public abstract void
onScreenCaptured (Bitmap bitmap)
A callback indicating the availability and validity of the created bitmap.
HERE SDK for Android Developer's Guide
► API Reference
176
Interface Details
Listener for Screen Capture asynchronous callback. The API is supported by MapFragment,
MapCompatibilityFragment
See also:
mapping.MapFragment.getScreenCapture (OnScreenCaptureListener)
mapping.MapCompatibilityFragment.getScreenCapture (OnScreenCaptureListener)
Method Details
public abstract void onScreenCaptured (Bitmap bitmap)
A callback indicating the availability and validity of the created bitmap.
Parameters:
bitmap
A Bitmap relative to the Map center. bitmap is null if failed to retrieve or
create the bitmap.
PositioningManager
The class PositioningManager is a member of com.here.android.mpa.common .
Class Summary
public final class PositioningManager
extends java.lang.Object
Represents a manager for information received from positioning devices, such as updates to the
current position and the average speed.
[For complete information, see the section Class Details]
Nested Class Summary
Table 39: Nested Classes in PositioningManager
Nested Classes
public static final enumeration
PositioningManager.LocationMethod
HERE SDK for Android Developer's Guide
► API Reference
Nested Classes
Represents values describing the location method.
public static final enumeration
PositioningManager.LocationStatus
Represents values describing the location status of a particular location method.
public static abstract interface
PositioningManager.OnPositionChangedListener
Represents an interface for position update listeners.
Method Summary
Table 40: Methods in PositioningManager
Methods
public void addListener (java.lang.ref.WeakReference
<com.here.android.mpa.common.PositioningManager.OnPositionChangedListener> listener)
Adds a PositioningManager.OnPositionChangedListener to the PositioningManager .
public double
getAverageSpeed ()
Gets the average speed of travel, in meters per second.
public static PositioningManager
getInstance ()
Get access to the PositioningManager Singleton
public PositioningManager.LocationMethod
getLocationMethod ()
Gets the method type used to determine positioning.
public PositioningManager.LocationStatus getLocationStatus
(PositioningManager.LocationMethod method)
Gets the status for a specified LocationMethod .
public GeoPosition
getPosition ()
Gets the current GeoPosition .
public boolean
hasValidPosition ()
Determines whether the current position for the current active PositioningManager.LocationMethod is valid.
public boolean
hasValidPosition (PositioningManager.LocationMethod method)
Determines whether the current position for the specified LocationMethod is valid.
public boolean
isActive ()
Determines whether the PositioningManager is active and whether position updates are being received.
public boolean
isExtrapolated ()
177
HERE SDK for Android Developer's Guide
► API Reference
178
Methods
Deprecated: As of SDK 2.1, use the GeoPosition instance returned through subscription to the listener
onPositionUpdated(LocationMethod, GeoPosition, boolean) and check if the GeoPosition is an instance of GeoPosition or
MatchedGeoPosition, if available.
Determines whether the current position is extrapolated.
public void
removeListener (PositioningManager.OnPositionChangedListener listener)
Removes a PositioningManager.OnPositionChangedListener from the PositioningManager .
public boolean
start (PositioningManager.LocationMethod method)
Starts receiving position updates from the positioning device.
public void
stop ()
Stops receiving position updates from the positioning device.
Class Details
Represents a manager for information received from positioning devices, such as updates to the
current position and the average speed.
Method Details
public void addListener (java.lang.ref.WeakReference
<com.here.android.mpa.common.PositioningManager.OnPositionChangedListener>
listener)
Adds a PositioningManager.OnPositionChangedListener to the PositioningManager .
Parameters:
listener
A OnPositionChangedListener to add
See also:
common.PositioningManager.removeListener (OnPositionChangedListener)
public double getAverageSpeed ()
Gets the average speed of travel, in meters per second.
Returns:
The average speed
HERE SDK for Android Developer's Guide
► API Reference
public static PositioningManager getInstance ()
Get access to the PositioningManager Singleton
Returns:
PositioningManager instance
public PositioningManager.LocationMethod getLocationMethod ()
Gets the method type used to determine positioning.
Returns:
The LocationMethod
public PositioningManager.LocationStatus getLocationStatus
(PositioningManager.LocationMethod method)
Gets the status for a specified LocationMethod .
Parameters:
method
A LocationMethod used to determine the location status
Returns:
The status of the specified LocationMethod
public GeoPosition getPosition ()
Gets the current GeoPosition .
Returns:
The current GeoPosition
public boolean hasValidPosition ()
179
HERE SDK for Android Developer's Guide
► API Reference
180
Determines whether the current position for the current active PositioningManager.LocationMethod is
valid.
Returns:
True if the position is valid, false otherwise
See also:
common.PositioningManager.hasValidPosition (LocationMethod)
public boolean hasValidPosition (PositioningManager.LocationMethod method)
Determines whether the current position for the specified LocationMethod is valid.
Parameters:
method
A LocationMethod to check for a valid position
Returns:
True if the position is valid, false otherwise
See also:
common.PositioningManager.hasValidPosition ()
public boolean isActive ()
Determines whether the PositioningManager is active and whether position updates are being
received.
Returns:
True if the PositioningManager is actively receiving position updates, false otherwise
public boolean isExtrapolated ()
Deprecated: As of SDK 2.1, use the GeoPosition instance returned through subscription to the listener
onPositionUpdated(LocationMethod, GeoPosition, boolean) and check if the GeoPosition is an instance of
GeoPosition or MatchedGeoPosition, if available.
Determines whether the current position is extrapolated. This method is deprecated and does not
work.
Returns:
HERE SDK for Android Developer's Guide
► API Reference
181
false.
public void removeListener (PositioningManager.OnPositionChangedListener
listener)
Removes a PositioningManager.OnPositionChangedListener from the PositioningManager .
Parameters:
listener
A OnPositionChangedListener to remove
See also:
public boolean start (PositioningManager.LocationMethod method)
Starts receiving position updates from the positioning device.
Parameters:
method
A LocationMethod used to provide position updates
Returns:
True if position updates have started being received from the positioning device, false otherwise
public void stop ()
Stops receiving position updates from the positioning device.
LocationMethod
The enumeration LocationMethod is a member of
com.here.android.mpa.common.PositioningManager .
Enumeration Summary
public static final enumeration PositioningManager.LocationMethod
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
HERE SDK for Android Developer's Guide
182
► API Reference
Represents values describing the location method.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 41: Enum Constants in LocationMethod
Fields
public static final PositioningManager.LocationMethod
NONE
Device positioning is not active.
public static final PositioningManager.LocationMethod
GPS
Positioning is provided using a GPS device.
public static final PositioningManager.LocationMethod
NETWORK
Positioning is provided using a wireless network.
public static final PositioningManager.LocationMethod
GPS_NETWORK
Positioning is provided using a wireless network, or a GPS device, or both.
Method Summary
Table 42: Methods in LocationMethod
Methods
public static PositioningManager.LocationMethod
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static PositioningManager.LocationMethod[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the location method.
Enum Constant Details
public static final PositioningManager.LocationMethod NONE
Device positioning is not active.
HERE SDK for Android Developer's Guide
► API Reference
183
public static final PositioningManager.LocationMethod GPS
Positioning is provided using a GPS device.
public static final PositioningManager.LocationMethod NETWORK
Positioning is provided using a wireless network.
public static final PositioningManager.LocationMethod GPS_NETWORK
Positioning is provided using a wireless network, or a GPS device, or both.
Method Details
public static PositioningManager.LocationMethod valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static PositioningManager.LocationMethod[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
LocationStatus
The enumeration LocationStatus is a member of com.here.android.mpa.common.PositioningManager
.
Enumeration Summary
public static final enumeration PositioningManager.LocationStatus
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
HERE SDK for Android Developer's Guide
184
► API Reference
Represents values describing the location status of a particular location method.
[For complete information, see the section Enumeration Details]
See also:
Enum Constant Summary
Table 43: Enum Constants in LocationStatus
Fields
public static final PositioningManager.LocationStatus
OUT_OF_SERVICE
The device is disabled.
public static final PositioningManager.LocationStatus
TEMPORARILY_UNAVAILABLE
The device is enabled, but without a location fix.
public static final PositioningManager.LocationStatus
AVAILABLE
The device is enabled with a GPS location fix.
Method Summary
Table 44: Methods in LocationStatus
Methods
public static PositioningManager.LocationStatus
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static PositioningManager.LocationStatus[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the location status of a particular location method.
See also:
Enum Constant Details
public static final PositioningManager.LocationStatus OUT_OF_SERVICE
HERE SDK for Android Developer's Guide
► API Reference
185
The device is disabled.
public static final PositioningManager.LocationStatus
TEMPORARILY_UNAVAILABLE
The device is enabled, but without a location fix.
public static final PositioningManager.LocationStatus AVAILABLE
The device is enabled with a GPS location fix.
Method Details
public static PositioningManager.LocationStatus valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static PositioningManager.LocationStatus[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
OnPositionChangedListener
The interface OnPositionChangedListener is a member of
com.here.android.mpa.common.PositioningManager .
Interface Summary
public static abstract interface PositioningManager.OnPositionChangedListener
Represents an interface for position update listeners.
HERE SDK for Android Developer's Guide
► API Reference
186
[For complete information, see the section Interface Details]
See also:
common.PositioningManager.addListener (WeakReference)
common.PositioningManager.removeListener (OnPositionChangedListener)
Method Summary
Table 45: Methods in OnPositionChangedListener
Methods
public abstract void onPositionFixChanged (PositioningManager.LocationMethod method,
PositioningManager.LocationStatus status)
A callback indicating that the position fix has changed.
public abstract void onPositionUpdated (PositioningManager.LocationMethod method,
GeoPosition position, boolean isMapMatched)
A callback indicating that the position has been updated.
Interface Details
Represents an interface for position update listeners.
See also:
common.PositioningManager.addListener (WeakReference)
common.PositioningManager.removeListener (OnPositionChangedListener)
Method Details
public abstract void onPositionFixChanged (PositioningManager.LocationMethod
method, PositioningManager.LocationStatus status)
A callback indicating that the position fix has changed.
Parameters:
method
A LocationMethod providing the status update (GPS or Network)
status
A LocationStatus representing the updated positioning status
HERE SDK for Android Developer's Guide
► API Reference
187
public abstract void onPositionUpdated (PositioningManager.LocationMethod
method, GeoPosition position, boolean isMapMatched)
A callback indicating that the position has been updated.
Parameters:
method
A LocationMethod providing the position update (GPS or Network)
position
A GeoPosition representing the updated position. The position can return
null if the MapsEngine has not been initialized.
isMapMatched
A boolean stating if the position is map matched or not. Map matching approximates user coordinates to the nearest road or navigation route If the
value is false then it means an unmatched(raw) position is received.
RoadElement
The class RoadElement is a member of com.here.android.mpa.common .
Class Summary
public final class RoadElement
extends java.lang.Object
Represents a single segment of a road.
[For complete information, see the section Class Details]
Nested Class Summary
Table 46: Nested Classes in RoadElement
Nested Classes
public static final enumeration
RoadElement.Attribute
Defined values for different road attributes
public static final enumeration
RoadElement.FormOfWay
Form of Way Types
public static final enumeration
RoadElement.PluralType
HERE SDK for Android Developer's Guide
188
► API Reference
Nested Classes
Plural type identifies when a Junction is made up of multiple Road Elements.
Method Summary
Table 47: Methods in RoadElement
Methods
public boolean
equals (Object other)
For documentation, see java.lang.Object
public java.util.EnumSet <com.here.android.mpa.common.RoadElement.Attribute>
()
getAttributes
Gets the road attributes.
public int
getAverageSpeed ()
Gets the average speed of the road element.
public RoadElement.FormOfWay
getFormOfWay ()
Gets the form of way.
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
getGeometry ()
Returns the geometry of the road element.
public double
getGeometryLength ()
Returns the length of the polyline associated with this RoadElement in meters.
public Identifier
getIdentifier ()
Get the Identifier for this particular RoadElement.
public int
getNumberOfLanes ()
Gets number of lanes in this road element.
public RoadElement.PluralType
getPluralType ()
Gets the plural type of the road element.
public static RoadElement
getRoadElement (GeoCoordinate coordinate, String marcCode)
Get the list of RoadElement of the current GeoBoundingBox .
public static java.util.List <com.here.android.mpa.common.RoadElement>
(GeoBoundingBox boundingBox, String marcCode)
Get the list of RoadElement of the current GeoBoundingBox .
public String
getRoadName ()
getRoadElements
HERE SDK for Android Developer's Guide
► API Reference
189
Methods
Gets the name of the road element.
public String
getRouteName ()
Gets the route name of the road element.
public float
getSpeedLimit ()
Gets the speed limit.
public Date
getStartTime ()
Gets the (estimated) time at which this road element starts.
public int
hashCode ()
For documentation, see java.lang.Object
public boolean
isPedestrian ()
Checks, if the road is allowed only for pedestrians.
public boolean
isPlural ()
Tests if the road element is plural.
Class Details
Represents a single segment of a road.
Method Details
public boolean equals (Object other)
For documentation, see java.lang.Object
Parameters:
other
public java.util.EnumSet <com.here.android.mpa.common.RoadElement.Attribute>
getAttributes ()
Gets the road attributes.
Returns:
Set of RoadElement.Attribute
HERE SDK for Android Developer's Guide
► API Reference
190
public int getAverageSpeed ()
Gets the average speed of the road element.
Returns:
the average speed in m/s or 0 if the information is not available.
public RoadElement.FormOfWay getFormOfWay ()
Gets the form of way.
Returns:
the form of way of the road.
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
getGeometry ()
Returns the geometry of the road element. The geometry is a returned as a list of GeoCoordinate
that can be used to create a polyline.
Returns:
a list of GeoCoordinate
public double getGeometryLength ()
Returns the length of the polyline associated with this RoadElement in meters.
Returns:
length of polyline for this RoadElement in meters.
public Identifier getIdentifier ()
Get the Identifier for this particular RoadElement.
Returns:
Identifier
public int getNumberOfLanes ()
HERE SDK for Android Developer's Guide
► API Reference
191
Gets number of lanes in this road element.
Returns:
the number of lanes in this road element.
public RoadElement.PluralType getPluralType ()
Gets the plural type of the road element.
Returns:
The plural type of the road element.
public static RoadElement getRoadElement (GeoCoordinate coordinate, String
marcCode)
Get the list of RoadElement of the current GeoBoundingBox .
Parameters:
coordinate
The GeoCoordinate that defines the coordinate to retrieve RoadElement
marcCode
The text for RoadElement corresponds to the language MARC code.
Returns:
the list of RoadElement of the current GeoBoundingBox.
public static java.util.List <com.here.android.mpa.common.RoadElement>
getRoadElements (GeoBoundingBox boundingBox, String marcCode)
Get the list of RoadElement of the current GeoBoundingBox .
Parameters:
boundingBox
The GeoBoundingBox that defines the area to retrieve RoadElement
marcCode
The text for RoadElement corresponds to the language MARC code.
Returns:
the list of RoadElement of the current GeoBoundingBox.
HERE SDK for Android Developer's Guide
► API Reference
192
public String getRoadName ()
Gets the name of the road element. The method returns an empty string if the name is unknown.
Returns:
the name of the road.
public String getRouteName ()
Gets the route name of the road element. The route name is a short label for the road, for example I5
for the Interstate 5 in the US. The method returns an empty string if the route name is unknown.
Returns:
the route name of the road element.
public float getSpeedLimit ()
Gets the speed limit.
Returns:
the speed limit in m/s or 0 if the information is not available.
public Date getStartTime ()
Gets the (estimated) time at which this road element starts. If no departure time was set for the
RouteOptions associated with this road element, than the time is relative to the system time when
the route calculation took place. Otherwise, the times are relative to the specified departure time.
Returns:
The start time, or null if not available
See also:
public int hashCode ()
For documentation, see java.lang.Object
HERE SDK for Android Developer's Guide
► API Reference
public boolean isPedestrian ()
Checks, if the road is allowed only for pedestrians.
Returns:
true, if road is allowed only for pedestrians, otherwise false.
public boolean isPlural ()
Tests if the road element is plural.
Returns:
true if the road element is plural.
Attribute
The enumeration Attribute is a member of com.here.android.mpa.common.RoadElement .
Enumeration Summary
public static final enumeration RoadElement.Attribute
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Defined values for different road attributes
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 48: Enum Constants in Attribute
Fields
public static final RoadElement.Attribute
DIR_NO_CARS
Road direction.
public static final RoadElement.Attribute
DIR_FORWARD
public static final RoadElement.Attribute
DIR_BACKWARD
193
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final RoadElement.Attribute
DIR_BOTH
public static final RoadElement.Attribute
DIRT_ROAD
Road type.
public static final RoadElement.Attribute
USAGE_FEE_REQUIRED
public static final RoadElement.Attribute
CARPOOL
public static final RoadElement.Attribute
URBAN
public static final RoadElement.Attribute
TOLLROAD
public static final RoadElement.Attribute
NO_THROUGH_TRAFFIC
public static final RoadElement.Attribute
TUNNEL
public static final RoadElement.Attribute
EXPLICATION
public static final RoadElement.Attribute
SLIPROAD
public static final RoadElement.Attribute
HIGHWAY
public static final RoadElement.Attribute
UNDER_CONSTRUCTION
public static final RoadElement.Attribute
HAS_LANE_DIR
public static final RoadElement.Attribute
HAS_LANE_EXIT
public static final RoadElement.Attribute
FERRY
public static final RoadElement.Attribute
CAR_SHUTTLE_TRAIN
Method Summary
Table 49: Methods in Attribute
Methods
public static RoadElement.Attribute
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RoadElement.Attribute[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
194
HERE SDK for Android Developer's Guide
► API Reference
Enumeration Details
Defined values for different road attributes
Enum Constant Details
public static final RoadElement.Attribute DIR_NO_CARS
Road direction.
public static final RoadElement.Attribute DIR_FORWARD
public static final RoadElement.Attribute DIR_BACKWARD
public static final RoadElement.Attribute DIR_BOTH
public static final RoadElement.Attribute DIRT_ROAD
Road type.
public static final RoadElement.Attribute USAGE_FEE_REQUIRED
public static final RoadElement.Attribute CARPOOL
public static final RoadElement.Attribute URBAN
public static final RoadElement.Attribute TOLLROAD
public static final RoadElement.Attribute NO_THROUGH_TRAFFIC
public static final RoadElement.Attribute TUNNEL
195
HERE SDK for Android Developer's Guide
► API Reference
196
public static final RoadElement.Attribute EXPLICATION
public static final RoadElement.Attribute SLIPROAD
public static final RoadElement.Attribute HIGHWAY
public static final RoadElement.Attribute UNDER_CONSTRUCTION
public static final RoadElement.Attribute HAS_LANE_DIR
public static final RoadElement.Attribute HAS_LANE_EXIT
public static final RoadElement.Attribute FERRY
public static final RoadElement.Attribute CAR_SHUTTLE_TRAIN
Method Details
public static RoadElement.Attribute valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RoadElement.Attribute[] values ()
HERE SDK for Android Developer's Guide
► API Reference
197
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
FormOfWay
The enumeration FormOfWay is a member of com.here.android.mpa.common.RoadElement .
Enumeration Summary
public static final enumeration RoadElement.FormOfWay
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Form of Way Types
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 50: Enum Constants in FormOfWay
Fields
public static final RoadElement.FormOfWay
UNDEFINED
public static final RoadElement.FormOfWay
MOTORWAY
public static final RoadElement.FormOfWay
MULTI_CARRIAGEWAY
public static final RoadElement.FormOfWay
SINGLE_CARRIAGEWAY
public static final RoadElement.FormOfWay
ROUNDABOUT
public static final RoadElement.FormOfWay
SPECIAL_TRAFFIC_FIGURE
public static final RoadElement.FormOfWay
SLIPROAD
public static final RoadElement.FormOfWay
PEDESTRIAN_ZONE
public static final RoadElement.FormOfWay
PEDESTRIAN_WALKWAY
public static final RoadElement.FormOfWay
SERVICE_ACCESS_PARKING
public static final RoadElement.FormOfWay
SERVICE_ACCESS_OTHER
public static final RoadElement.FormOfWay
SERVICE_ROAD
public static final RoadElement.FormOfWay
ETA_PARKING_PLACE
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final RoadElement.FormOfWay
ETA_PARKING_BUILDING
public static final RoadElement.FormOfWay
ETA_UNSTRUCTURED_TRAFFIC_SQUARE
public static final RoadElement.FormOfWay
ROAD_FOR_AUTHORITIES
Method Summary
Table 51: Methods in FormOfWay
Methods
public static RoadElement.FormOfWay
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RoadElement.FormOfWay[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Form of Way Types
Enum Constant Details
public static final RoadElement.FormOfWay UNDEFINED
public static final RoadElement.FormOfWay MOTORWAY
public static final RoadElement.FormOfWay MULTI_CARRIAGEWAY
public static final RoadElement.FormOfWay SINGLE_CARRIAGEWAY
public static final RoadElement.FormOfWay ROUNDABOUT
public static final RoadElement.FormOfWay SPECIAL_TRAFFIC_FIGURE
198
HERE SDK for Android Developer's Guide
► API Reference
199
public static final RoadElement.FormOfWay SLIPROAD
public static final RoadElement.FormOfWay PEDESTRIAN_ZONE
public static final RoadElement.FormOfWay PEDESTRIAN_WALKWAY
public static final RoadElement.FormOfWay SERVICE_ACCESS_PARKING
public static final RoadElement.FormOfWay SERVICE_ACCESS_OTHER
public static final RoadElement.FormOfWay SERVICE_ROAD
public static final RoadElement.FormOfWay ETA_PARKING_PLACE
public static final RoadElement.FormOfWay ETA_PARKING_BUILDING
public static final RoadElement.FormOfWay ETA_UNSTRUCTURED_TRAFFIC_SQUARE
public static final RoadElement.FormOfWay ROAD_FOR_AUTHORITIES
Method Details
public static RoadElement.FormOfWay valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
name
200
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RoadElement.FormOfWay[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
PluralType
The enumeration PluralType is a member of com.here.android.mpa.common.RoadElement .
Enumeration Summary
public static final enumeration RoadElement.PluralType
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Plural type identifies when a Junction is made up of multiple Road Elements.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 52: Enum Constants in PluralType
Fields
public static final RoadElement.PluralType
NONE
Junction is not plural
public static final RoadElement.PluralType
MANEUVER
Indicates that only one command should be given despite the fact that two Junctions occur; one at each end of the turn lane.
public static final RoadElement.PluralType
CONNECTOR
Indicates that a road segment should not be viewed as an individual piece of road but as part of the intersection.
public static final RoadElement.PluralType
INDETERMINATE
Indicates a maneuver that cannot be explained in one command or at all.
HERE SDK for Android Developer's Guide
► API Reference
201
Method Summary
Table 53: Methods in PluralType
Methods
public static RoadElement.PluralType
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RoadElement.PluralType[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Plural type identifies when a Junction is made up of multiple Road Elements. It also implies that a
maneuver may require different explanation than implied by the geometry.
Enum Constant Details
public static final RoadElement.PluralType NONE
Junction is not plural
public static final RoadElement.PluralType MANEUVER
Indicates that only one command should be given despite the fact that two Junctions occur; one
at each end of the turn lane. It is only necessary to state "turn right" near the beginning of the
maneuver because at the end the driver does not have a choice in direction.
public static final RoadElement.PluralType CONNECTOR
Indicates that a road segment should not be viewed as an individual piece of road but as part of the
intersection. A separate guidance maneuver should not exist for this segment. For example, if making
a u-turn in Example A in Figure 4B-113, the driver should receive the instruction to "make the u-turn"
and not "turn left, turn left".
public static final RoadElement.PluralType INDETERMINATE
Indicates a maneuver that cannot be explained in one command or at all. A graphic may be needed to
illustrate the turn. In these situations a driver may need to go right to make a left turn.
HERE SDK for Android Developer's Guide
► API Reference
202
Method Details
public static RoadElement.PluralType valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RoadElement.PluralType[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Size
The class Size is a member of com.here.android.mpa.common .
Class Summary
public final class Size
extends java.lang.Object
Represents size in pixels
[For complete information, see the section Class Details]
Constructor Summary
Table 54: Constructors in Size
Constructors
Size ()
Public constructor
Size (int width, int height)
HERE SDK for Android Developer's Guide
► API Reference
Constructors
Public constructor
Method Summary
Table 55: Methods in Size
Methods
public boolean
equals (Object other)
For documentation, see java.lang.Object
public int
hashCode ()
For documentation, see java.lang.Object
public boolean
isNull ()
Has no dimensions
Class Details
Represents size in pixels
Constructor Details
Size ()
Public constructor
Size (int width, int height)
Public constructor
Parameters:
width
Width of screen in pixels
height
Height of screen in pixels
Method Details
public boolean equals (Object other)
203
HERE SDK for Android Developer's Guide
► API Reference
For documentation, see java.lang.Object
Parameters:
other
public int hashCode ()
For documentation, see java.lang.Object
public boolean isNull ()
Has no dimensions
Returns:
Whether this object has no width and height
TimeInterval
The class TimeInterval is a member of com.here.android.mpa.common .
Class Summary
public final class TimeInterval
extends java.lang.Object
This is the definition of the TimeInterval class.
[For complete information, see the section Class Details]
Method Summary
Table 56: Methods in TimeInterval
Methods
public boolean
equals (Object other)
For documentation, see java.lang.Object
public Date
getEndTime ()
204
HERE SDK for Android Developer's Guide
► API Reference
205
Methods
gets the end time for the TimeInterval TimeInterval
public Date
getStartTime ()
gets the start time for the TimeInterval TimeInterval
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
This is the definition of the TimeInterval class. A TimeInterval describes the start time and end time
of any event
Method Details
public boolean equals (Object other)
For documentation, see java.lang.Object
Parameters:
other
public Date getEndTime ()
gets the end time for the TimeInterval TimeInterval
Returns:
start time
public Date getStartTime ()
gets the start time for the TimeInterval TimeInterval
Returns:
start time
public int hashCode ()
For documentation, see java.lang.Object
HERE SDK for Android Developer's Guide
► API Reference
TransitType
The enumeration TransitType is a member of com.here.android.mpa.common .
Enumeration Summary
public final enumeration TransitType
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing the types of transit that an application user might take.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 57: Enum Constants in TransitType
Fields
public static final TransitType
BUS_PUBLIC
A public bus.
public static final TransitType
BUS_TOURISTIC
A tourist bus.
public static final TransitType
BUS_INTERCITY
An intercity bus.
public static final TransitType
BUS_EXPRESS
An express bus.
public static final TransitType
RAIL_METRO
A metro railway.
public static final TransitType
RAIL_LIGHT
A light railway.
public static final TransitType
RAIL_REGIONAL
A regional railway.
public static final TransitType
A regional train.
TRAIN_REGIONAL
206
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final TransitType
TRAIN_INTERCITY
An intercity train.
public static final TransitType
TRAIN_HIGH_SPEED
A high-speed train.
public static final TransitType
MONORAIL
Monorail
public static final TransitType
AERIAL
Aerial transit.
public static final TransitType
INCLINED
Inclined transit.
public static final TransitType
WATER
A water taxi or ferry.
public static final TransitType
AIRLINE
An airline.
public static final TransitType
UNKNOWN
An unknown transit type.
Method Summary
Table 58: Methods in TransitType
Methods
public static TransitType
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static TransitType[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the types of transit that an application user might take.
207
HERE SDK for Android Developer's Guide
► API Reference
Enum Constant Details
public static final TransitType BUS_PUBLIC
A public bus.
public static final TransitType BUS_TOURISTIC
A tourist bus.
public static final TransitType BUS_INTERCITY
An intercity bus.
public static final TransitType BUS_EXPRESS
An express bus.
public static final TransitType RAIL_METRO
A metro railway.
public static final TransitType RAIL_LIGHT
A light railway.
public static final TransitType RAIL_REGIONAL
A regional railway.
public static final TransitType TRAIN_REGIONAL
A regional train.
public static final TransitType TRAIN_INTERCITY
An intercity train.
208
HERE SDK for Android Developer's Guide
► API Reference
public static final TransitType TRAIN_HIGH_SPEED
A high-speed train.
public static final TransitType MONORAIL
Monorail
public static final TransitType AERIAL
Aerial transit.
public static final TransitType INCLINED
Inclined transit.
public static final TransitType WATER
A water taxi or ferry.
public static final TransitType AIRLINE
An airline.
public static final TransitType UNKNOWN
An unknown transit type.
Method Details
public static TransitType valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
209
HERE SDK for Android Developer's Guide
► API Reference
210
A string containing the name of the enumeration member whose value is to
be retrieved.
name
public static TransitType[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Vector3f
The class Vector3f is a member of com.here.android.mpa.common .
Class Summary
public final class Vector3f
extends java.lang.Object
Vector3f represents a 3D-Vector, capable to store x-,y- and z-coordinates in float values.
[For complete information, see the section Class Details]
Constructor Summary
Table 59: Constructors in Vector3f
Constructors
Vector3f ()
Constructs and initializes a Vector3f to (0f,0f,0f).
Vector3f (float x, float y, float z)
Constructs and initializes a Vector3f from the specified xyz coordinates.
Field Summary
Table 60: Fields in Vector3f
Fields
public float
x
HERE SDK for Android Developer's Guide
► API Reference
Fields
public float
y
public float
z
Method Summary
Table 61: Methods in Vector3f
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public float
getX ()
Retrieves the x-component of the vector.
public float
getY ()
Retrieves the y-component of the vector.
public float
getZ ()
Retrieves the z-component of the vector.
public int
hashCode ()
For documentation, see java.lang.Object
public void
setX (float x)
Sets the x-component of the vector.
public void
setY (float y)
Sets the y-component of the vector.
public void
setZ (float z)
Sets the z-component of the vector.
public String
toString ()
For documentation, see java.lang.Object
Class Details
Vector3f represents a 3D-Vector, capable to store x-,y- and z-coordinates in float values.
211
HERE SDK for Android Developer's Guide
► API Reference
Constructor Details
Vector3f ()
Constructs and initializes a Vector3f to (0f,0f,0f).
Vector3f (float x, float y, float z)
Constructs and initializes a Vector3f from the specified xyz coordinates.
Parameters:
x
- the x coordinate
y
- the y coordinate
z
- the z coordinate
Field Details
public float x
public float y
public float z
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
212
HERE SDK for Android Developer's Guide
► API Reference
public float getX ()
Retrieves the x-component of the vector.
Returns:
float representing the x component of the vector.
public float getY ()
Retrieves the y-component of the vector.
Returns:
float representing the y component of the vector.
public float getZ ()
Retrieves the z-component of the vector.
Returns:
float representing the z component of the vector.
public int hashCode ()
For documentation, see java.lang.Object
public void setX (float x)
Sets the x-component of the vector.
Parameters:
x
A float value for the x component of the vector.
public void setY (float y)
Sets the y-component of the vector.
Parameters:
213
HERE SDK for Android Developer's Guide
► API Reference
y
A float value for the y component of the vector.
public void setZ (float z)
Sets the z-component of the vector.
Parameters:
z
A float value for the z component of the vector.
public String toString ()
For documentation, see java.lang.Object
Version
The class Version is a member of com.here.android.mpa.common .
Class Summary
public final class Version
extends java.lang.Object
Version of the SDK.
[For complete information, see the section Class Details]
Constructor Summary
Table 62: Constructors in Version
Constructors
Version ()
214
HERE SDK for Android Developer's Guide
► API Reference
Field Summary
Table 63: Fields in Version
Fields
public static final int
SDK_API_INT
The current version of the API spec.
Class Details
Version of the SDK. Newer revisions will increment SDK_API_INT for newer features.
Constructor Details
Version ()
Field Details
public static final int SDK_API_INT
The current version of the API spec.
ViewObject
The class ViewObject is a member of com.here.android.mpa.common .
Class Summary
public abstract class ViewObject
extends java.lang.Object
Represents the base class implementation for all objects that are selectable from a view.
[For complete information, see the section Class Details]
215
HERE SDK for Android Developer's Guide
► API Reference
Nested Class Summary
Table 64: Nested Classes in ViewObject
Nested Classes
public static final enumeration
ViewObject.Type
Represents values describing various types of selectable view objects.
Constructor Summary
Table 65: Constructors in ViewObject
Constructors
ViewObject (ViewObjectImpl impl)
Protected constructor
Method Summary
Table 66: Methods in ViewObject
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public ViewObject.Type
getBaseType ()
Returns the real implementation type of the ViewObject .
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents the base class implementation for all objects that are selectable from a view.
Selectable objects are featured on these views:
•
•
•
MapFragment
MapCompatibilityFragment
MapView
216
HERE SDK for Android Developer's Guide
► API Reference
Constructor Details
ViewObject (ViewObjectImpl impl)
Protected constructor
Parameters:
impl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public ViewObject.Type getBaseType ()
Returns the real implementation type of the ViewObject .
Returns:
The ViewObject.Type ViewObjectType, either a USER_OBJECT or a PROXY_OBJECT.
public int hashCode ()
For documentation, see java.lang.Object
Type
The enumeration Type is a member of com.here.android.mpa.common.ViewObject .
Enumeration Summary
public static final enumeration ViewObject.Type
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
217
HERE SDK for Android Developer's Guide
► API Reference
Represents values describing various types of selectable view objects.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 67: Enum Constants in Type
Fields
public static final ViewObject.Type
USER_OBJECT
Describes the type of view objects that are added by the application, such as MapMarker.
public static final ViewObject.Type
PROXY_OBJECT
Describes the type of view objects that are provided automatically, such as TransitLineObject, TransitStopObject or
TransitAccessObject .
public static final ViewObject.Type
UNKNOWN_OBJECT
Describes the type of view objects that are neither a USER_OBJECT nor a PROXY_OBJECT .
Method Summary
Table 68: Methods in Type
Methods
public static ViewObject.Type
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static ViewObject.Type[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing various types of selectable view objects.
Enum Constant Details
public static final ViewObject.Type USER_OBJECT
Describes the type of view objects that are added by the application, such as MapMarker.
public static final ViewObject.Type PROXY_OBJECT
218
HERE SDK for Android Developer's Guide
► API Reference
219
Describes the type of view objects that are provided automatically, such as TransitLineObject,
TransitStopObject or TransitAccessObject . A proxy object may contain special information about the
object, depending on the type (for example, TransitStopObject may provide transit stop-related
information), but it cannot be created or modified.
public static final ViewObject.Type UNKNOWN_OBJECT
Describes the type of view objects that are neither a USER_OBJECT nor a PROXY_OBJECT .
Method Details
public static ViewObject.Type valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static ViewObject.Type[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
ViewRect
The class ViewRect is a member of com.here.android.mpa.common .
Class Summary
public final class ViewRect
extends java.lang.Object
Represents a rectangle defined by the top-left corner's coordinate and the width and height of the
rectangle.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
220
Constructor Summary
Table 69: Constructors in ViewRect
Constructors
ViewRect (int x, int y, int width, int height)
Constructor that initializes specified X and Y coordinates of the top-left corner plus width and height values, in pixels, for the
new ViewRect object.
Method Summary
Table 70: Methods in ViewRect
Methods
public boolean
equals (Object other)
Determines whether the specified Object is equal to this ViewRect object.
public int
getHeight ()
Gets the current height, in pixels, of the ViewRect .
public int
getWidth ()
Gets the current width, in pixels, of the ViewRect .
public int
getX ()
Gets the current X-coordinate of the ViewRect .
public int
getY ()
Gets the current Y-coordinate of the ViewRect .
public int
hashCode ()
Calculates and returns a hash code value for the ViewRect .
public boolean
isValid ()
Determines whether the ViewRect object is valid.
public void
setHeight (int height)
Sets a height, in pixels, for the ViewRect .
public void
setWidth (int width)
Sets a width, in pixels, for the ViewRect .
public void
setX (int x)
Sets an X-coordinate for the ViewRect .
HERE SDK for Android Developer's Guide
► API Reference
221
Methods
public void
setY (int y)
Sets a Y-coordinate for the ViewRect .
Class Details
Represents a rectangle defined by the top-left corner's coordinate and the width and height of the
rectangle.
Constructor Details
ViewRect (int x, int y, int width, int height)
Constructor that initializes specified X and Y coordinates of the top-left corner plus width and height
values, in pixels, for the new ViewRect object.
Parameters:
x
An initial X-coordinate for the left side of the rectangle
y
An initial Y-coordinate for the top of the rectangle
width
An initial width for the rectangle
height
An initial height for the rectangle
Method Details
public boolean equals (Object other)
Determines whether the specified Object is equal to this ViewRect object.
Parameters:
other
An Object to compare with this ViewRect object for equality
Returns:
True if the compared objects are equal, false otherwise
HERE SDK for Android Developer's Guide
► API Reference
public int getHeight ()
Gets the current height, in pixels, of the ViewRect .
Returns:
The current height
public int getWidth ()
Gets the current width, in pixels, of the ViewRect .
Returns:
The current width
public int getX ()
Gets the current X-coordinate of the ViewRect .
Returns:
The current X-coordinate
public int getY ()
Gets the current Y-coordinate of the ViewRect .
Returns:
The current Y-coordinate
public int hashCode ()
Calculates and returns a hash code value for the ViewRect .
Returns:
The hash code
public boolean isValid ()
Determines whether the ViewRect object is valid.
222
HERE SDK for Android Developer's Guide
► API Reference
Returns:
True if the ViewRect is valid, false otherwise
public void setHeight (int height)
Sets a height, in pixels, for the ViewRect .
Parameters:
height
Desired height
public void setWidth (int width)
Sets a width, in pixels, for the ViewRect .
Parameters:
width
Desired width
public void setX (int x)
Sets an X-coordinate for the ViewRect .
Parameters:
x
Desired X-coordinate
public void setY (int y)
Sets a Y-coordinate for the ViewRect .
Parameters:
y
Desired Y-coordinate
223
HERE SDK for Android Developer's Guide
► API Reference
224
mapping
The package mapping is a member of com.here.android.mpa.
Package Summary
mapping
The mapping package provides classes, interfaces, and enumerations that display an interactive map,
and related functionality that allows your application to create and add map content.
Package Details
The mapping package provides classes, interfaces, and enumerations that display an interactive map,
and related functionality that allows your application to create and add map content.
Some key classes and interfaces in this package are:
•
•
•
•
•
Map
MapGesture
MapFragment
MapObject
MapTransitLayer
Map
The Map interface represents the interactive map itself.
Map schemes (e.g. Satellite, Terrain, etc.) can be changed as follows:
map.setMapScheme ( Map.Scheme.NORMAL_DAY );
Refer to the Map.Scheme class for a description of supported schemes.
A Map can contain visual objects, which are instantiated from the children of the MapObject class,
such as:
•
•
•
•
•
MapCircle
MapMarker
MapPolygon
MapPolyline
MapRoute
HERE SDK for Android Developer's Guide
► API Reference
225
A polygon, for example, can be drawn on the map as follows:
...
MapPolygon polygon = new MapPolygon();
map.addMapObject( polygon );
Notice that the parent map object class, MapContainer , does not itself represent a visual object. A
MapContainer determines the stacking order (z-index ordering) of objects on a map.
MapObjects and z-index ordering
The z-index of a MapObject specifies its stacking order within a Map. In general, an object with a
higher z-index appears closer to the viewer than an object with a lower z-index.
The stack order of a Map is defined hierarchically, according to the following specifications:
•
•
The MapObject with the highest z-index is drawn on top of any other instances of MapObject.
Within a MapContainer, the MapObject with highest z-index is drawn on top of any other
instances of MapObject.
Colors
Color values in this package are defined in terms of ARGB integer values, where the 24 least
significant bits define red, green, and blue components while the eight most significant bits define
the alpha value (0xAARRGGBB) of opacity, for which 0xFFRRGGBB is fully opaque and 0x00RRGGBB is
fully transparent.
Note: if the target platform does not support transparency, the alpha value is ignored and the color is
displayed as fully opaque.
GeoMesh
The class GeoMesh is a member of com.here.android.mpa.mapping .
Class Summary
public final class GeoMesh
extends com.here.android.mpa.mapping.Mesh, java.lang.Object
Represents the mesh data for a MapGeoModel.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
226
Constructor Summary
Table 71: Constructors in GeoMesh
Constructors
GeoMesh ()
Creates a GeoMesh .
Method Summary
Table 72: Methods in GeoMesh
Methods
public GeoMesh
vertices)
setVertices (java.util.List <com.here.android.mpa.common.GeoCoordinate>
Sets a List of GeoCoordinate objects representing the vertices associated with the GeoMesh .
public GeoMesh
setVertices (DoubleBuffer vertices)
Sets a DoubleBuffer representing a list of vertices associated with the GeoMesh .
Class Details
Represents the mesh data for a MapGeoModel.
The properties of a GeoMesh include vertices, specified as either GeoCoordinate objects or an array
of double values representing the latitude, longitude and altitude of each vertex sequentially.
Constructor Details
GeoMesh ()
Creates a GeoMesh .
Method Details
public GeoMesh setVertices (java.util.List
<com.here.android.mpa.common.GeoCoordinate> vertices)
Sets a List of GeoCoordinate objects representing the vertices associated with the GeoMesh .
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
vertices
227
A List of GeoCoordinate representing the vertices used to form the GeoMesh.
Returns:
The updated GeoMesh.
public GeoMesh setVertices (DoubleBuffer vertices)
Sets a DoubleBuffer representing a list of vertices associated with the GeoMesh .
Each vertex is specified as triplets of latitude, longitude and altitude. All triplets are then placed into a
DoubleBuffer sequentially to represent the list of vertices.
Parameters:
vertices
Desired DoubleBuffer list of GeoCoordinate, i.e. vertex, in multiples of
three.
Returns:
The updated GeoMesh.
See also:
java.nio.DoubleBuffer
LocalMesh
The class LocalMesh is a member of com.here.android.mpa.mapping .
Class Summary
public final class LocalMesh
extends com.here.android.mpa.mapping.Mesh, java.lang.Object
Represents the mesh data for a MapLocalModel.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
228
Constructor Summary
Table 73: Constructors in LocalMesh
Constructors
LocalMesh ()
Creates a LocalMesh .
Method Summary
Table 74: Methods in LocalMesh
Methods
public LocalMesh
setVertices (FloatBuffer vertices)
Sets a FloatBuffer representing a list of vertices associated with the LocalMesh .
Class Details
Represents the mesh data for a MapLocalModel.
The properties of a LocalMesh include vertices, specified as triplets. A unit of 1 represents 1 meter
in the real world.
Constructor Details
LocalMesh ()
Creates a LocalMesh .
Method Details
public LocalMesh setVertices (FloatBuffer vertices)
Sets a FloatBuffer representing a list of vertices associated with the LocalMesh .
Note: vertices for a LocalMesh are specified as triplets.
Parameters:
vertices
Returns:
Desired FloatBuffer list of vertices, in triplets
HERE SDK for Android Developer's Guide
► API Reference
The updated LocalMesh
See also:
java.nio.FloatBuffer
Location
The class Location is a member of com.here.android.mpa.mapping .
Class Summary
public final class Location
extends java.lang.Object
Class which provides ways to retrieve certain parameters of an icon or a marker.
[For complete information, see the section Class Details]
See also:
Method Summary
Table 75: Methods in Location
Methods
public GeoBoundingBox
getBoundingBox ()
Gets the GeoBoundingBox of this location object
public GeoCoordinate
getCoordinate ()
Gets the GeoCoordinate of this location object
public LocationInfo
getInfo ()
Gets the LocationInfo of this location object
Class Details
Class which provides ways to retrieve certain parameters of an icon or a marker.
See also:
229
HERE SDK for Android Developer's Guide
► API Reference
Method Details
public GeoBoundingBox getBoundingBox ()
Gets the GeoBoundingBox of this location object
Returns:
the GeoBoundingBox of this location object
public GeoCoordinate getCoordinate ()
Gets the GeoCoordinate of this location object
Returns:
the GeoCoordinate of this location object
public LocationInfo getInfo ()
Gets the LocationInfo of this location object
Returns:
the LocationInfo of this location object
LocationInfo
The class LocationInfo is a member of com.here.android.mpa.mapping .
Class Summary
public final class LocationInfo
extends java.lang.Object
Class which contains information about a particular icon/marker.
[For complete information, see the section Class Details]
See also:
230
HERE SDK for Android Developer's Guide
► API Reference
Nested Class Summary
Table 76: Nested Classes in LocationInfo
Nested Classes
public static final enumeration
LocationInfo.Field
Fields for a LocationInfo object which can be retrieved
Method Summary
Table 77: Methods in LocationInfo
Methods
public boolean
equals (Object other)
For documentation, see java.lang.Object
public String
getField (LocationInfo.Field field)
Retrieves the value of the specified LocationInfo.Field for the object
public boolean
hasField (LocationInfo.Field field)
Determines whether or not the object has a particular LocationInfo.Field
Class Details
Class which contains information about a particular icon/marker.
See also:
Method Details
public boolean equals (Object other)
For documentation, see java.lang.Object
Parameters:
other
public String getField (LocationInfo.Field field)
231
HERE SDK for Android Developer's Guide
► API Reference
Retrieves the value of the specified LocationInfo.Field for the object
Parameters:
field
Field to determine
Returns:
the string value of the specified Field
public boolean hasField (LocationInfo.Field field)
Determines whether or not the object has a particular LocationInfo.Field
Parameters:
field
Field to determine
Returns:
true if the object has the Field
Field
The enumeration Field is a member of com.here.android.mpa.mapping.LocationInfo .
Enumeration Summary
public static final enumeration LocationInfo.Field
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Fields for a LocationInfo object which can be retrieved
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 78: Enum Constants in Field
Fields
public static final LocationInfo.Field
ADDR_COUNTRY_CODE
Country code of address, named as in ISO 3166 alpha-3
232
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final LocationInfo.Field
ADDR_COUNTRY_NAME
Country Name
public static final LocationInfo.Field
ADDR_STATE_NAME
Name of federal state
public static final LocationInfo.Field
ADDR_STATE_CODE
Code of federal state
public static final LocationInfo.Field
ADDR_PROVINCE_NAME
Province Name
public static final LocationInfo.Field
ADDR_COUNTY_NAME
County Name
public static final LocationInfo.Field
ADDR_CITY_NAME
City Name
public static final LocationInfo.Field
ADDR_DISTRICT_NAME
District Name
public static final LocationInfo.Field
ADDR_POSTAL_CODE
Postal Code
public static final LocationInfo.Field
ADDR_TOWNSHIP_NAME
Township Name
public static final LocationInfo.Field
ADDR_NEIGHBORHOOD_NAME
Name of the neighborhood within the city
public static final LocationInfo.Field
ADDR_STREET_NAME
Street name
public static final LocationInfo.Field
ADDR_HOUSE_NUMBER
House number of address.
public static final LocationInfo.Field
ADDR_CONTINENT_NAME
Continent name
public static final LocationInfo.Field
ADDR_TYPE_NAME
Type of address (city, street, etc.)
public static final LocationInfo.Field
ADDR_POPULATION
233
HERE SDK for Android Developer's Guide
► API Reference
Fields
Population living at this address
public static final LocationInfo.Field
ADDR_BUILDING_NAME
Building Name
public static final LocationInfo.Field
ADDR_BUILDING_FLOOR
Building Floor
public static final LocationInfo.Field
ADDR_BUILDING_ROOM
Building Room
public static final LocationInfo.Field
ADDR_BUILDING_ZONE
Building Zone
public static final LocationInfo.Field
PLACE_NAME
Place Name
public static final LocationInfo.Field
PLACE_PRE_NAME
Place prefix.
public static final LocationInfo.Field
PLACE_POST_NAME
Place postfix.
public static final LocationInfo.Field
PLACE_TYPE
Type of the place (premium, adplace, recommendation, etc.)
public static final LocationInfo.Field
PLACE_CATEGORY
Name of the category of the place
public static final LocationInfo.Field
PLACE_CATEGORY_ID
The identifier (number as a string) of the category.
public static final LocationInfo.Field
PLACE_DESCRIPTION
Short description of the place.
public static final LocationInfo.Field
PLACE_PHONE_NUMBER
Phone number of the place.
public static final LocationInfo.Field
PLACE_URL
URL belonging to the place.
public static final LocationInfo.Field
PLACE_PREMIUM_URL_ID
Premium POI URL Id.
public static final LocationInfo.Field
PLACE_PREMIUM_NODE_ID
234
HERE SDK for Android Developer's Guide
► API Reference
Fields
Premium POI Node Id.
public static final LocationInfo.Field
PLACE_ADVERTISEMENT_STRING
Advertisement string
public static final LocationInfo.Field
TZ_OFFSET_MINUTES
Time zone offset in minutes
public static final LocationInfo.Field
OTHER_DATA
Can be used to return some other information for the location.
public static final LocationInfo.Field
PLACE_ICON_ID
The place's icon identifier.
public static final LocationInfo.Field
LOCATION_TYPE
ADDRESS, POI, STRING.
public static final LocationInfo.Field
LOCATION_META
Additional flags to mark results
public static final LocationInfo.Field
LOCATION_TEXT
Formatted text of the location
public static final LocationInfo.Field
ADDR_AREA_ID
Area Id
public static final LocationInfo.Field
FOREIGN_ID
Foreign ID
public static final LocationInfo.Field
FOREIGN_ID_SOURCE
Foreign ID source.
Method Summary
Table 79: Methods in Field
Methods
public static LocationInfo.Field
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static LocationInfo.Field[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
235
HERE SDK for Android Developer's Guide
► API Reference
Enumeration Details
Fields for a LocationInfo object which can be retrieved
Enum Constant Details
public static final LocationInfo.Field ADDR_COUNTRY_CODE
Country code of address, named as in ISO 3166 alpha-3
public static final LocationInfo.Field ADDR_COUNTRY_NAME
Country Name
public static final LocationInfo.Field ADDR_STATE_NAME
Name of federal state
public static final LocationInfo.Field ADDR_STATE_CODE
Code of federal state
public static final LocationInfo.Field ADDR_PROVINCE_NAME
Province Name
public static final LocationInfo.Field ADDR_COUNTY_NAME
County Name
public static final LocationInfo.Field ADDR_CITY_NAME
City Name
public static final LocationInfo.Field ADDR_DISTRICT_NAME
District Name
236
HERE SDK for Android Developer's Guide
► API Reference
public static final LocationInfo.Field ADDR_POSTAL_CODE
Postal Code
public static final LocationInfo.Field ADDR_TOWNSHIP_NAME
Township Name
public static final LocationInfo.Field ADDR_NEIGHBORHOOD_NAME
Name of the neighborhood within the city
public static final LocationInfo.Field ADDR_STREET_NAME
Street name
public static final LocationInfo.Field ADDR_HOUSE_NUMBER
House number of address. Can include characters.
public static final LocationInfo.Field ADDR_CONTINENT_NAME
Continent name
public static final LocationInfo.Field ADDR_TYPE_NAME
Type of address (city, street, etc.)
public static final LocationInfo.Field ADDR_POPULATION
Population living at this address
public static final LocationInfo.Field ADDR_BUILDING_NAME
Building Name
237
HERE SDK for Android Developer's Guide
► API Reference
public static final LocationInfo.Field ADDR_BUILDING_FLOOR
Building Floor
public static final LocationInfo.Field ADDR_BUILDING_ROOM
Building Room
public static final LocationInfo.Field ADDR_BUILDING_ZONE
Building Zone
public static final LocationInfo.Field PLACE_NAME
Place Name
public static final LocationInfo.Field PLACE_PRE_NAME
Place prefix.
public static final LocationInfo.Field PLACE_POST_NAME
Place postfix.
public static final LocationInfo.Field PLACE_TYPE
Type of the place (premium, adplace, recommendation, etc.)
public static final LocationInfo.Field PLACE_CATEGORY
Name of the category of the place
public static final LocationInfo.Field PLACE_CATEGORY_ID
The identifier (number as a string) of the category.
238
HERE SDK for Android Developer's Guide
► API Reference
public static final LocationInfo.Field PLACE_DESCRIPTION
Short description of the place. Also used as input for place search.
public static final LocationInfo.Field PLACE_PHONE_NUMBER
Phone number of the place.
public static final LocationInfo.Field PLACE_URL
URL belonging to the place.
public static final LocationInfo.Field PLACE_PREMIUM_URL_ID
Premium POI URL Id.
public static final LocationInfo.Field PLACE_PREMIUM_NODE_ID
Premium POI Node Id.
public static final LocationInfo.Field PLACE_ADVERTISEMENT_STRING
Advertisement string
public static final LocationInfo.Field TZ_OFFSET_MINUTES
Time zone offset in minutes
public static final LocationInfo.Field OTHER_DATA
Can be used to return some other information for the location.
public static final LocationInfo.Field PLACE_ICON_ID
239
HERE SDK for Android Developer's Guide
► API Reference
240
The place's icon identifier. This is for Plug-In usage only. S60 shall make use of
PlaceCategoryDataStore.
public static final LocationInfo.Field LOCATION_TYPE
ADDRESS, POI, STRING.
public static final LocationInfo.Field LOCATION_META
Additional flags to mark results
public static final LocationInfo.Field LOCATION_TEXT
Formatted text of the location
public static final LocationInfo.Field ADDR_AREA_ID
Area Id
public static final LocationInfo.Field FOREIGN_ID
Foreign ID
public static final LocationInfo.Field FOREIGN_ID_SOURCE
Foreign ID source. MapCartoMarker markers will have a source of "pvid"
Method Details
public static LocationInfo.Field valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
HERE SDK for Android Developer's Guide
► API Reference
241
public static LocationInfo.Field[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Map
The class Map is a member of com.here.android.mpa.mapping .
Class Summary
public final class Map
extends java.lang.Object
A Map object represents a virtual model of the world.
[For complete information, see the section Class Details]
Nested Class Summary
Table 80: Nested Classes in Map
Nested Classes
public static final enumeration
Map.Animation
Represents values that describe animation types for on-screen map movements.
public static abstract interface
Map.InfoBubbleAdapter
Interface for implementing custom info bubbles for MapMarker objects.
public static final enumeration
Map.Layer
Definition for layers within a map.
public static abstract interface
Map.OnSchemeChangedListener
Listener for Map scheme changed events.
public static abstract interface
Map.OnTransformListener
Listener for Map transform events.
public static final enumeration
Map.PedestrianFeature
Pedestrian features to be rendered on the map
HERE SDK for Android Developer's Guide
► API Reference
242
Nested Classes
public static class
Map.PixelResult
Result class for conversion of a GeoCoordinate to screen pixel coordinates.
public static final enumeration
Map.Projection
The projection scheme used to render the map.
public static final class
Map.Scheme
Represents a collection of schemes that the Map class supports.
Constructor Summary
Table 81: Constructors in Map
Constructors
Map ()
Default Constructor
Field Summary
Table 82: Fields in Map
Fields
public static final float
MOVE_PRESERVE_ORIENTATION
A valid orientation value that lies outside the minimum and maximum supported tilt range, used to indicate that the current
orientation should be preserved.
public static final float
MOVE_PRESERVE_TILT
A valid tilt value that lies outside the range of getMinTilt(void) and getMaxTilt(void), used to indicate that the current tilt
should be preserved.
public static final double
MOVE_PRESERVE_ZOOM_LEVEL
A valid zoom level value that lies outside the range of getMinZoomLevel() and getMaxZoomLevel(), used to indicate that the
current zoom level should be preserved.
Method Summary
Table 83: Methods in Map
Methods
public boolean
addMapObject (MapObject object)
HERE SDK for Android Developer's Guide
► API Reference
243
Methods
Adds a MapObject to this Map .
public boolean
objects)
addMapObjects (java.util.List <com.here.android.mpa.mapping.MapObject>
Adds a List of multiple MapObject objects to this Map .
public boolean
addRasterTileSource (MapRasterTileSource source)
Adds a user-defined MapRasterTileSource to this Map .
public void
addSchemeChangedListener (Map.OnSchemeChangedListener listener)
Adds a Map.OnSchemeChangedListener to listen for map scheme change events.
public void
addTransformListener (Map.OnTransformListener listener)
Adds a Map.OnTransformListener to this Map to listen for map transform events.
public boolean
areCartoMarkersVisible ()
Returns a boolean indicating whether all MapCartoMarkers of all IconCategory are visible.
public boolean
areCartoMarkersVisible (IconCategory category)
Get if MapCartoMarkers of a certain POI category is shown.
public boolean
areEmbeddedPoisVisible ()
Deprecated: As of release 2.0, replaced by areCartoMarkersVisible().
Returns a boolean indicating whether the map embedded POIs are shown.
public boolean
areExtrudedBuildingsVisible ()
Returns a boolean indicating whether the extruded buildings layer is shown on this map.
public boolean
areLandmarksVisible ()
Returns a boolean indicating whether 3D landmarks are currently visible.
public void
executeSynchronized (Runnable task)
Execute a batched set of commands to the Map .
public PointF
geoToPixel (GeoCoordinate coordinate)
Deprecated: As of release 2.0.
Converts and returns a PointF that represents screen pixel coordinates from a GeoCoordinate.
public List<android.graphics.PointF> geoToPixel (java.util.List
<com.here.android.mpa.common.GeoCoordinate> coordinates)
Deprecated: As of release 2.0.
Converts and returns a list of PointF elements that represents screen pixel coordinates from a List of GeoCoordinate
objects
HERE SDK for Android Developer's Guide
244
► API Reference
Methods
public GeoBoundingBox
getBoundingBox ()
Returns the current visible map area as a GeoBoundingBox.
public GeoCoordinate
getCenter ()
Returns the GeoCoordinate location at the current center of this Map .
public String
getCopyright ()
Returns the copyright notice text for this Map .
public java.util.EnumSet <com.here.android.mpa.mapping.Map.Layer>
getDisplayLayers ()
Get the set of Map layers visible.
public int
getHeight ()
Returns the current height of this Map , in number of pixels.
public MapBuildingLayer
getMapBuildingLayer ()
Returns the MapBuildingLayer for this Map .
public String
getMapDisplayLanguage ()
Get the language which the Map is set to render
public String
getMapScheme ()
Returns the current scheme for the Map .
public List<java.lang.String>
getMapSchemes ()
Returns a list containing all supported schemes for the Map .
public String
getMapSecondaryDisplayLanguage ()
Get the secondary language which the Map is set to render
public MapState
getMapState ()
Returns the current tilt, perspective, and zoom of the map as a MapState object.
public MapTransitLayer
getMapTransitLayer ()
Returns the MapTransitLayer associated with this Map .
public float
getMaxTilt ()
Returns the maximum degree allowed to be set as tilt angle for the Map .
public double
getMaxZoomLevel ()
Returns the highest valid zoom level for Map , representing the closest view near the street-level
public float
getMinTilt ()
HERE SDK for Android Developer's Guide
245
► API Reference
Methods
Returns the minimum degree allowed to be set as tilt angle for the Map .
public double
getMinZoomLevel ()
Returns the lowest valid zoom level for Map , representing the most distant view away from street-level.
public float
getOrientation ()
Returns the current orientation for this Map , in degrees relative to true-north, which has an orientation of 0 degrees.
public java.util.EnumSet <com.here.android.mpa.mapping.Map.PedestrianFeature>
getPedestrianFeaturesVisible ()
Get the set of pedestrian features visible.
public PositionIndicator
getPositionIndicator ()
Returns the PositionIndicator instance that renders the current position with a marker.
public Map.Projection
getProjectionMode ()
Gets the current map projection mode.
public double
getScaleFromZoomLevel (double level)
Returns a map scale value based on the specified zoom level.
public java.util.List <com.here.android.mpa.common.ViewObject>
getSelectedObjects (PointF p)
Returns the list of selectable ViewObject instances which are located at the specified screen pixel coordinates.
public java.util.List <com.here.android.mpa.common.ViewObject>
rect)
getSelectedObjects (ViewRect
Returns the list of selectable ViewObject objects which are within a specified ViewRect.
public java.util.List <com.here.android.mpa.common.ViewObject>
(PointF p)
getSelectedObjectsNearby
Returns the list of selectable ViewObject instances which are located at the specified screen pixel coordinates.
public List<java.lang.String>
getSupportedMapDisplayLanguages ()
Get the list of supported display languages.
public float
getTilt ()
Returns the current tilt angle for this Map , in degrees.
public PointF
getTransformCenter ()
Returns the current center coordinate for Map transformations such as zooming and rotation.
public int
getWidth ()
Returns the current width of this Map , in number of pixels.
public double
getZoomLevel ()
HERE SDK for Android Developer's Guide
246
► API Reference
Methods
Returns the current zoom level, which will be within a range between getMinZoomLevel() and getMaxZoomLevel().
public boolean
isPoiCategoryVisible (IconCategory category)
Deprecated: As of release 2.0.
Get if a POI category is shown.
public void
pan (PointF from, PointF to)
Moves the map from one specified screen pixel coordinates to another in a linear motion.
public GeoCoordinate
pixelToGeo (PointF point)
Converts and returns GeoCoordinate from screen pixel coordinates.
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
pixelToGeo (List points)
Converts and returns a list of GeoCoordinate objects from a List of screen pixel coordinates.
public Map.PixelResult
projectToPixel (GeoCoordinate coordinate)
Converts and returns a PixelResult that represents screen pixel coordinates from a GeoCoordinate.
public java.util.List <com.here.android.mpa.mapping.Map.PixelResult> projectToPixel
(java.util.List <com.here.android.mpa.common.GeoCoordinate> coordinates)
Converts and returns a list of Map.PixelResult elements that represent screen pixel coordinates from a List of
GeoCoordinate objects.
public boolean
removeMapObject (MapObject object)
Removes a MapObject from this Map .
public boolean
objects)
removeMapObjects (java.util.List <com.here.android.mpa.mapping.MapObject>
Removes a List of multiple MapObject objects from this Map .
public boolean
removeRasterTileSource (MapRasterTileSource source)
Removes a user-defined MapRasterTileSource from this Map .
public void
removeSchemeChangedListener (Map.OnSchemeChangedListener listener)
Removes an existing Map.OnSchemeChangedListener.
public void
removeTransformListener (Map.OnTransformListener listener)
Removes an existing Map.OnTransformListener from this Map .
public Map
setCartoMarkersVisible (boolean visible)
Show or hide all MapCartoMarkers on Map .
public Map
setCartoMarkersVisible (IconCategory category, boolean visible)
Toggles the visibility of a particular POI category's MapCartoMarkers.
HERE SDK for Android Developer's Guide
► API Reference
247
Methods
public void setCenter (GeoCoordinate point, Map.Animation animation, double level, float
orientation, float tilt)
Moves the center of this Map to a specific GeoCoordinate, while simultaneously setting a zoom level (a fraction within the
range of minimum and maximum levels), orientation (from 0 degrees to 360 degrees), and tilt (within the range of minimum
and maximum tilt angles).
public void
setCenter (GeoCoordinate point, Map.Animation animation)
Moves the center of this Map to the specified GeoCoordinate using the given Map.Animation.
public void setCenter (PointF newCenter, Map.Animation animation, double zoomLevel, float
orientation, float tilt)
Centers the map at the specified screen pixel coordinates.
public static void setCustomMapConfiguration (String pathToConfigFile, String
pathToResourceFile)
Set a custom map style configuration.
public Map
layers)
setDisplayLayers (java.util.EnumSet <com.here.android.mpa.mapping.Map.Layer>
Enable or disable specific sets of rendering layers.
public Map
setEmbeddedPoisVisible (boolean visible)
Deprecated: As of release 2.0.
Show or hide map embedded POIs
public boolean
setExtrudedBuildingsVisible (boolean visible)
Show or hide the extruded buildings layer on this map.
public Map
setFadingAnimations (boolean enabled)
Enable or disable animations for labels and icons shown on the map.
public void
setInfoBubbleAdapter (Map.InfoBubbleAdapter adapter)
Sets the custom info bubble adapter for this map.
public Map
setLandmarksVisible (boolean visible)
Sets 3D landmarks to be either visible or invisible for this Map .
public boolean
setMapDisplayLanguage (Locale language)
Set the map display language using a locale.
public Map
setMapScheme (String scheme)
Sets a scheme for the Map to the specified String value.
public boolean
setMapSecondaryDisplayLanguage (Locale language)
HERE SDK for Android Developer's Guide
► API Reference
248
Methods
Set the map secondary display language using a locale.
public Map
setOrientation (float angle)
Sets an absolute orientation for this Map to the specified angle, in degrees, where true-north is 0 degrees.
public void
setOrientation (float angle, Map.Animation animation)
Sets an absolute orientation for this Map to the specified angle, in degrees, where true-north is 0 degrees.
public Map setPedestrianFeaturesVisible (java.util.EnumSet
<com.here.android.mpa.mapping.Map.PedestrianFeature> features)
Set a set of pedestrian features to be visible.
public Map
setPoiCategoryVisible (IconCategory category, boolean visible)
Deprecated: As of release 2.0.
Toggles the visibility of a particular POI category.
public Map
setProjectionMode (Map.Projection projection)
Change the projection mode used to render the map.
public Map
setTilt (float angle)
Sets a tilt angle for this Map , in degrees.
public void
setTilt (float angle, Map.Animation animation)
Sets a tilt angle for the Map , in degrees.
public Map
setTransformCenter (PointF center)
Sets a center coordinate for Map transformations such as zooming and rotation.
public boolean
setUseSystemLanguage ()
Set the map display language using the system default locale.
public Map
setZoomLevel (double level)
Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom levels.
public void
setZoomLevel (double level, Map.Animation animation)
Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom levels.
public void
setZoomLevel (double level, PointF focus, Map.Animation animation)
Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom levels while keeping the
specified screen coordinate at the same Geographical Location.
public void
zoomTo (GeoBoundingBox geoRect, Map.Animation animation, float orientation)
Moves this Map instance's map center and changes the zoom level to show the specified GeoBoundingBox at the given
orientation.
HERE SDK for Android Developer's Guide
► API Reference
249
Methods
public void
float tilt)
zoomTo (GeoBoundingBox geoRect, Map.Animation animation, float orientation,
Moves this Map instance's map center and changes the zoom level to show the specified GeoBoundingBox at the given
orientation.
public void zoomTo (GeoBoundingBox geoRect, ViewRect viewPort, Map.Animation animation,
float orientation)
Moves this Map instance and changes its zoom level to show the specified GeoBoundingBox within the provided ViewRect.
public void zoomTo (GeoBoundingBox geoRect, int width, int height, Map.Animation animation,
float orientation)
Moves this Map instance and changes its zoom level to show the specified GeoBoundingBox within the specified pixel
dimensions around the transform center.
Class Details
A Map object represents a virtual model of the world. When embedded in a MapFragment,
MapCompatibilityFragment, or MapView, Map objects can be used to show maps, add/remove map
objects, and enable user interactions.
Constructor Details
Map ()
Default Constructor
Field Details
public static final float MOVE_PRESERVE_ORIENTATION
A valid orientation value that lies outside the minimum and maximum supported tilt range, used to
indicate that the current orientation should be preserved. Pass this value to preserve the orientation
when calling compound Map transform operations.
public static final float MOVE_PRESERVE_TILT
A valid tilt value that lies outside the range of getMinTilt(void) and getMaxTilt(void), used to indicate
that the current tilt should be preserved. Pass this value to preserve the tilt when calling compound
Map transform operations.
HERE SDK for Android Developer's Guide
► API Reference
250
public static final double MOVE_PRESERVE_ZOOM_LEVEL
A valid zoom level value that lies outside the range of getMinZoomLevel() and getMaxZoomLevel(),
used to indicate that the current zoom level should be preserved. Pass this value to preserve the
zoom level when calling compound Map transform operations.
Method Details
public boolean addMapObject (MapObject object)
Adds a MapObject to this Map .
Parameters:
object
A MapObject to add
Returns:
True if the MapObject was added successfully, false otherwise
See also:
mapping.Map.addMapObjects (List)
mapping.Map.removeMapObject (MapObject)
public boolean addMapObjects (java.util.List
<com.here.android.mpa.mapping.MapObject> objects)
Adds a List of multiple MapObject objects to this Map .
Parameters:
objects
A List of MapObject objects to add
Returns:
True if all the MapObjects in the List were added successfully, false otherwise
See also:
mapping.Map.addMapObject (MapObject)
mapping.Map.removeMapObjects (List)
HERE SDK for Android Developer's Guide
► API Reference
251
public boolean addRasterTileSource (MapRasterTileSource source)
Adds a user-defined MapRasterTileSource to this Map .
Parameters:
source
A MapRasterTileSource representing a user-defined raster tile source
Returns:
True if the raster tile source was added successfully, false otherwise
See also:
mapping.Map.removeRasterTileSource (MapRasterTileSource)
public void addSchemeChangedListener (Map.OnSchemeChangedListener listener)
Adds a Map.OnSchemeChangedListener to listen for map scheme change events.
Parameters:
listener
A Map.OnSchemeChangedListener to add to the Map
See also:
mapping.Map.removeTransformListener (OnTransformListener)
public void addTransformListener (Map.OnTransformListener listener)
Adds a Map.OnTransformListener to this Map to listen for map transform events.
Parameters:
listener
A Map.OnTransformListener to add to the Map
See also:
mapping.Map.removeTransformListener (OnTransformListener)
public boolean areCartoMarkersVisible ()
Returns a boolean indicating whether all MapCartoMarkers of all IconCategory are visible.
HERE SDK for Android Developer's Guide
► API Reference
252
This is equivalent to calling areCartoMarkersVisible(IconCategory) with IconCategory.ALL .
Returns:
true if MapCartoMarkers of all IconCategory are visible, false otherwise.
public boolean areCartoMarkersVisible (IconCategory category)
Get if MapCartoMarkers of a certain POI category is shown.
Parameters:
category
See IconCategory for category list.
Returns:
true if the MapCartoMarkers of the specified category is visible, false otherwise.
public boolean areEmbeddedPoisVisible ()
Deprecated: As of release 2.0, replaced by areCartoMarkersVisible().
Returns a boolean indicating whether the map embedded POIs are shown.
Returns:
True if map embedded POIs are visible. False otherwise.
public boolean areExtrudedBuildingsVisible ()
Returns a boolean indicating whether the extruded buildings layer is shown on this map.
Returns:
true if shown, false otherwise.
public boolean areLandmarksVisible ()
Returns a boolean indicating whether 3D landmarks are currently visible. The default value is false.
Returns:
True if landmarks are visible, false otherwise
HERE SDK for Android Developer's Guide
► API Reference
public void executeSynchronized (Runnable task)
Execute a batched set of commands to the Map . This is useful to improve performance when
multiple operations require re-rendering of the display.
Parameters:
task
Task block to execute synchronously.
public PointF geoToPixel (GeoCoordinate coordinate)
Deprecated: As of release 2.0.
Replaced by projectToPixel(GeoCoordinate).
Converts and returns a PointF that represents screen pixel coordinates from a GeoCoordinate.
This method returns null if the conversion fails.
Parameters:
coordinate
A GeoCoordinate to convert
Returns:
A PointF representing screen pixel coordinates. null if the conversion fails.
See also:
mapping.Map.projectToPixel (List)
public List<android.graphics.PointF> geoToPixel (java.util.List
<com.here.android.mpa.common.GeoCoordinate> coordinates)
Deprecated: As of release 2.0.
Converts and returns a list of PointF elements that represents screen pixel coordinates from a
List of GeoCoordinate objects
This method returns one or more list elements as null if the conversion of the corresponding
GeoCoordinate instances fails.
Parameters:
253
HERE SDK for Android Developer's Guide
► API Reference
coordinates
254
A List of GeoCoordinate objects to convert
Returns:
The list of PointF or null elements
See also:
mapping.Map.projectToPixel (GeoCoordinate)
public GeoBoundingBox getBoundingBox ()
Returns the current visible map area as a GeoBoundingBox.
Note that a bounding box is always rectangular, and its sides are always parallel to latitude and
longitude. If the map is rotated when this method is called (for example, if the orientation is 10
degrees east of true-north), the returned bounding box will be a circumscribed rectangle that is
larger than the visible map area. Similarly, when the map is tilted (for example, if the map is tilted by
45 degrees), the visible map area represents a trapezoidal area in the world. Calling getBoundingBox()
will then return a larger circumscribed rectangle that contains this trapezoid area.
The bounding box may be invalid when this method is called at low zoom levels, as the map area does
not fill the screen.
Returns:
The GeoBoundingBox containing the visible map area.
public GeoCoordinate getCenter ()
Returns the GeoCoordinate location at the current center of this Map .
Returns:
The current map center
public String getCopyright ()
Returns the copyright notice text for this Map . This text is only available after Map completes
rendering for the first time.
Returns:
The copyright notice
HERE SDK for Android Developer's Guide
► API Reference
public java.util.EnumSet <com.here.android.mpa.mapping.Map.Layer>
getDisplayLayers ()
Get the set of Map layers visible.
Returns:
The EnumSet of Map Layers enabled
public int getHeight ()
Returns the current height of this Map , in number of pixels.
Returns:
The current height
public MapBuildingLayer getMapBuildingLayer ()
Returns the MapBuildingLayer for this Map . This layer enables user interactions with extruded
buildings on the map.
Returns:
A MapBuildingLayer instance for this Map.
public String getMapDisplayLanguage ()
Get the language which the Map is set to render
Returns:
String MARC code of the displayed language.
public String getMapScheme ()
Returns the current scheme for the Map .
Returns:
The current scheme
See also:
255
HERE SDK for Android Developer's Guide
► API Reference
mapping.Map.getMapSchemes ()
public List<java.lang.String> getMapSchemes ()
Returns a list containing all supported schemes for the Map .
Returns:
The supported schemes
See also:
mapping.Map.getMapScheme ()
mapping.Map.setMapScheme (String)
public String getMapSecondaryDisplayLanguage ()
Get the secondary language which the Map is set to render
Returns:
String MARC code of the displayed language.
public MapState getMapState ()
Returns the current tilt, perspective, and zoom of the map as a MapState object.
Returns:
MapState object representing current state of the map.
public MapTransitLayer getMapTransitLayer ()
Returns the MapTransitLayer associated with this Map .
Returns:
The MapTransitLayer
256
HERE SDK for Android Developer's Guide
► API Reference
257
public float getMaxTilt ()
Returns the maximum degree allowed to be set as tilt angle for the Map .
Returns:
float maximum tilt angle in degrees.
public double getMaxZoomLevel ()
Returns the highest valid zoom level for Map , representing the closest view near the street-level
Returns:
The maximum zoom level
public float getMinTilt ()
Returns the minimum degree allowed to be set as tilt angle for the Map .
Returns:
float minimum tilt angle in degrees.
public double getMinZoomLevel ()
Returns the lowest valid zoom level for Map , representing the most distant view away from streetlevel.
Returns:
The minimum zoom level
public float getOrientation ()
Returns the current orientation for this Map , in degrees relative to true-north, which has an
orientation of 0 degrees.
Returns:
The current orientation angle
HERE SDK for Android Developer's Guide
► API Reference
258
public java.util.EnumSet
<com.here.android.mpa.mapping.Map.PedestrianFeature>
getPedestrianFeaturesVisible ()
Get the set of pedestrian features visible.
Returns:
The EnumSet of Pedestrian features enabled
public PositionIndicator getPositionIndicator ()
Returns the PositionIndicator instance that renders the current position with a marker. The position
indicator should be used with PositioningManager.
Returns:
The PositionIndicator
public Map.Projection getProjectionMode ()
Gets the current map projection mode.
Returns:
Projection current projection mode.
public double getScaleFromZoomLevel (double level)
Returns a map scale value based on the specified zoom level. Scale units are in physical geo
centimeters per screen inch.
Parameters:
level
The zoom level to be translated to a map scale.
Returns:
Scale value for the passed level. Units are in geo centimeters per screen inch
public java.util.List <com.here.android.mpa.common.ViewObject>
getSelectedObjects (PointF p)
HERE SDK for Android Developer's Guide
► API Reference
259
Returns the list of selectable ViewObject instances which are located at the specified screen pixel
coordinates.
Parameters:
p
Screen pixel coordinate to check for ViewObject.
Returns:
The list of ViewObject objects at the pixel coordinate. If no object exists at p, returns an empty list.
public java.util.List <com.here.android.mpa.common.ViewObject>
getSelectedObjects (ViewRect rect)
Returns the list of selectable ViewObject objects which are within a specified ViewRect.
Parameters:
rect
A ViewRect with selected ViewObject objects
Returns:
The list of ViewObjects within the ViewRect. If no object exists within rect, returns an empty list.
public java.util.List <com.here.android.mpa.common.ViewObject>
getSelectedObjectsNearby (PointF p)
Returns the list of selectable ViewObject instances which are located at the specified screen pixel
coordinates.
Parameters:
p
Screen pixel coordinate to check for ViewObject.
Returns:
The list of ViewObject objects at the pixel coordinate. If no object exists at p, returns an empty list.
public List<java.lang.String> getSupportedMapDisplayLanguages ()
Get the list of supported display languages.
Returns:
HERE SDK for Android Developer's Guide
► API Reference
260
a list of supported map display languages
public float getTilt ()
Returns the current tilt angle for this Map , in degrees.
Returns:
The current tilt angle
public PointF getTransformCenter ()
Returns the current center coordinate for Map transformations such as zooming and rotation. The
transform center may be different than the Map center.
Returns:
The PointF representing the current center used for transformations
public int getWidth ()
Returns the current width of this Map , in number of pixels.
Returns:
The current width
public double getZoomLevel ()
Returns the current zoom level, which will be within a range between getMinZoomLevel() and
getMaxZoomLevel(). The zoom level is only precise to three decimal places due to numerical
operations performed internally when rendering the map.
Returns:
The zoom level within the fractional range
public boolean isPoiCategoryVisible (IconCategory category)
Deprecated: As of release 2.0.
Replaced by areCartoMarkersVisible(IconCategory).
HERE SDK for Android Developer's Guide
► API Reference
261
Get if a POI category is shown.
Parameters:
category
See IconCategory for category list.
Returns:
true if category is visible, else false
public void pan (PointF from, PointF to)
Moves the map from one specified screen pixel coordinates to another in a linear motion.
Parameters:
from
A PointF representing the screen pixel coordinates to pan the map from.
to
A PointF representing the screen pixel coordinates to pan the map to.
public GeoCoordinate pixelToGeo (PointF point)
Converts and returns GeoCoordinate from screen pixel coordinates.
This method returns null if the conversion fails. (For example, if the coordinate is not a valid value.)
Parameters:
point
The screen pixel coordinates to convert
Returns:
A GeoCoordinate representing the map location. null if the conversion fails.
See also:
mapping.Map.pixelToGeo (List)
public java.util.List <com.here.android.mpa.common.GeoCoordinate> pixelToGeo
(List points)
HERE SDK for Android Developer's Guide
► API Reference
262
Converts and returns a list of GeoCoordinate objects from a List of screen pixel coordinates.
This method returns one or more list elements as null if the conversion of the corresponding pixel
coordinates fails.
Parameters:
points
A List of screen pixel coordinates to convert
Returns:
A list of GeoCoordinate or null elements.
See also:
mapping.Map.pixelToGeo (PointF)
public Map.PixelResult projectToPixel (GeoCoordinate coordinate)
Converts and returns a PixelResult that represents screen pixel coordinates from a
GeoCoordinate. This method is converts a GeoCoordinate from world space to screen space.
Parameters:
coordinate
A GeoCoordinate to convert
Returns:
A PixelResult representing screen pixel coordinates and operation success code. Check
PixelResult#getError() to check the success of the conversion.
See also:
mapping.Map.projectToPixel (List)
public java.util.List <com.here.android.mpa.mapping.Map.PixelResult>
projectToPixel (java.util.List <com.here.android.mpa.common.GeoCoordinate>
coordinates)
Converts and returns a list of Map.PixelResult elements that represent screen pixel coordinates from
a List of GeoCoordinate objects.
This method returns one or more list elements as null if the conversion of the corresponding
GeoCoordinate instances fails.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
coordinates
263
A List of GeoCoordinate objects to convert
Returns:
The list of PixelResult results. Check PixelResult#getError() to check the success of each
conversion.
See also:
mapping.Map.projectToPixel (GeoCoordinate)
public boolean removeMapObject (MapObject object)
Removes a MapObject from this Map .
Parameters:
object
A MapObject to remove
Returns:
True if the MapObject was removed successfully, false otherwise
See also:
mapping.Map.removeMapObjects (List)
public boolean removeMapObjects (java.util.List
<com.here.android.mpa.mapping.MapObject> objects)
Removes a List of multiple MapObject objects from this Map .
Parameters:
objects
A List of MapObject objects to remove
Returns:
True if all the MapObjects in the List were removed successfully, false otherwise
See also:
mapping.Map.removeMapObject (MapObject)
public boolean removeRasterTileSource (MapRasterTileSource source)
HERE SDK for Android Developer's Guide
► API Reference
264
Removes a user-defined MapRasterTileSource from this Map .
Parameters:
source
A MapRasterTileSource representing a user-defined raster tile source
Returns:
True if the raster tile source was removed successfully, false otherwise
public void removeSchemeChangedListener (Map.OnSchemeChangedListener
listener)
Removes an existing Map.OnSchemeChangedListener.
Parameters:
listener
A Map.OnSchemeChangedListener to remove from the Map
public void removeTransformListener (Map.OnTransformListener listener)
Removes an existing Map.OnTransformListener from this Map .
Parameters:
listener
A Map.OnTransformListener to remove from the Map
public Map setCartoMarkersVisible (boolean visible)
Show or hide all MapCartoMarkers on Map .
Parameters:
visible
Whether the MapCartoMarkers should be visible.
Returns:
The updated Map.
public Map setCartoMarkersVisible (IconCategory category, boolean visible)
HERE SDK for Android Developer's Guide
► API Reference
265
Toggles the visibility of a particular POI category's MapCartoMarkers. To toggle visibility for
IconCategory.ALL categories, setCartoMarkersVisible(boolean) can also be used.
Parameters:
category
See IconCategory for category list.
visible
Intended visibility for the specific POI category's MapCartoMarkers.
Returns:
The updated Map itself.
public void setCenter (GeoCoordinate point, Map.Animation animation, double
level, float orientation, float tilt)
Moves the center of this Map to a specific GeoCoordinate, while simultaneously setting a zoom level
(a fraction within the range of minimum and maximum levels), orientation (from 0 degrees to 360
degrees), and tilt (within the range of minimum and maximum tilt angles). If you wish to keep the
current zoom level, orientation, or tilt after setting a new center, pass one or more of the following
values as the relevant parameter:
•
•
•
MOVE_PRESERVE_ZOOM_LEVEL to keep the current zoom level
MOVE_PRESERVE_ORIENTATION to keep the current orientation
MOVE_PRESERVE_TILT to keep the current tile
Note: it is unlikely that you would pass all three of the special MOVE_PRESERVE_ZOOM_LEVEL,
MOVE_PRESERVE_ORIENTATION and MOVE_PRESERVE_TILT parameters when calling this
method (it would make more sense to call setCenter(GeoCoordinate, Animation)). More likely, you
would use one or two of the special parameters (for example, change the orientation and tilt along
with the center coordinate while keeping the current zoom level).
Parameters:
point
A GeoCoordinate representing the new center
animation
A Map.Animation to illustrate the transformation
level
Desired zoom level of the newly-centered Map (pass
MOVE_PRESERVE_ZOOM_LEVEL to keep the current level)
orientation
Desired orientation of the newly-centered Map (pass
MOVE_PRESERVE_ORIENTATION to keep the current orientation)
HERE SDK for Android Developer's Guide
► API Reference
tilt
266
Desired tilt angle of the newly-centered Map (pass MOVE_PRESERVE_TILT
to keep the current tilt)
See also:
mapping.Map.setCenter (GeoCoordinate, Animation)
mapping.Map.getMaxZoomLevel ()
mapping.Map.getMinZoomLevel ()
public void setCenter (GeoCoordinate point, Map.Animation animation)
Moves the center of this Map to the specified GeoCoordinate using the given Map.Animation.
Parameters:
point
A GeoCoordinate representing the new center
animation
An Animation to illustrate the transformation
See also:
mapping.Map.setCenter (GeoCoordinate, Animation, double, float, float)
public void setCenter (PointF newCenter, Map.Animation animation, double
zoomLevel, float orientation, float tilt)
Centers the map at the specified screen pixel coordinates. The zoom level, orientation and tilt angle
be adjusted at the same time.
Parameters:
newCenter
A PointF representing the screen pixel coordinates to set as map center.
animation
An Animation to illustrate the transformation
zoomLevel
Desired zoom level of the newly-centered Map. Use
MOVE_PRESERVE_ZOOM_LEVEL to keep the current zoom level.
HERE SDK for Android Developer's Guide
► API Reference
267
orientation
Desired orientation of the newly-centered Map. Use
MOVE_PRESERVE_ORIENTATION to keep the current orientation angle.
tilt
Desired tilt angle of the newly-centered Map. Use MOVE_PRESERVE_TILT
to keep the current tilt angle.
See also:
mapping.Map.setCenter (GeoCoordinate, Animation, double, float, float)
public static void setCustomMapConfiguration (String pathToConfigFile,
String pathToResourceFile)
Set a custom map style configuration. The custom map style setting should be made before the first
Map is created. Note: This API should only be used in consultation with HERE technical support.
Throws:
FileNotFoundException
Parameters:
pathToConfigFile
Map Style Configuration File.
pathToResourceFile Map Style Resource File. Can be null where default file will be used.
public Map setDisplayLayers (java.util.EnumSet
<com.here.android.mpa.mapping.Map.Layer> layers)
Enable or disable specific sets of rendering layers. Use EnumSet.allOf to show all. Use
EnumSet.noneOf to show nothing.
Parameters:
layers
Returns:
EnumSet of Map.Layers. Set enums are displayed.
HERE SDK for Android Developer's Guide
► API Reference
The updated Map itself.
public Map setEmbeddedPoisVisible (boolean visible)
Deprecated: As of release 2.0.
Replaced by setCartoMarkersVisible(boolean).
Show or hide map embedded POIs
Parameters:
visible
Whether the map embedded POIs is visible.
Returns:
The updated Map.
public boolean setExtrudedBuildingsVisible (boolean visible)
Show or hide the extruded buildings layer on this map.
Parameters:
visible
true to show extruded building, false otherwise
Returns:
boolean True if extruded build visibility has been changed successfully. False, otherwise.
public Map setFadingAnimations (boolean enabled)
Enable or disable animations for labels and icons shown on the map. Note: the fading animations
property will take effect when the map is redrawn.
Parameters:
enabled
true to enable animations (default), false to disable animations
Returns:
The updated Map.
public void setInfoBubbleAdapter (Map.InfoBubbleAdapter adapter)
268
HERE SDK for Android Developer's Guide
► API Reference
Sets the custom info bubble adapter for this map.
Parameters:
adapter
A custom implementation for the info bubble.
See also:
mapping.MapMarker.showInfoBubble ()
public Map setLandmarksVisible (boolean visible)
Sets 3D landmarks to be either visible or invisible for this Map .
If the map scheme is set to any Hybrid or Satellite map schemes (such as SATELLITE_DAY or
HYBRID_DAY), this method will have no visible effect.
Parameters:
visible
A boolean specifying whether 3D landmarks should be visible
Returns:
The updated Map.
public boolean setMapDisplayLanguage (Locale language)
Set the map display language using a locale. Causes a map redraw when language is set.
When this method is called, it will override the device's current locale until the device's locale is
changed. This language change does not affect other features like search.
Parameters:
language
The language locale as described in http://developer.android.com/reference/java/util/Locale.htm..
Returns:
true if the language is accepted by the Map, false otherwise.
public Map setMapScheme (String scheme)
Sets a scheme for the Map to the specified String value.
269
HERE SDK for Android Developer's Guide
► API Reference
270
Parameters:
scheme
The desired scheme from getMapSchemes().
Returns:
The updated Map.
See also:
mapping.Map.getMapSchemes ()
public boolean setMapSecondaryDisplayLanguage (Locale language)
Set the map secondary display language using a locale. Causes a map redraw when language is set.
Passing null will cause the display of secondary language to be disabled.
Setting a secondary display language will cause the language to be displayed below the primary
language for some map labels (e.g. countries).
Parameters:
language
The language locale as described in http://developer.android.com/reference/java/util/Locale.htm.. or null to disable display of secondary language.
Returns:
true if the language is accepted by the Map, false otherwise.
See also:
mapping.Map.setMapDisplayLanguage (Locale)
public Map setOrientation (float angle)
Sets an absolute orientation for this Map to the specified angle, in degrees, where true-north is 0
degrees. No animation will be used to illustrate the transformation.
Parameters:
angle
Returns:
Desired orientation angle
HERE SDK for Android Developer's Guide
► API Reference
271
The updated Map.
See also:
mapping.Map.setOrientation (float, Animation)
public void setOrientation (float angle, Map.Animation animation)
Sets an absolute orientation for this Map to the specified angle, in degrees, where true-north is 0
degrees.
Parameters:
angle
Desired orientation angle
animation
An Animation to illustrate the transformation
See also:
mapping.Map.setOrientation (float)
public Map setPedestrianFeaturesVisible (java.util.EnumSet
<com.here.android.mpa.mapping.Map.PedestrianFeature> features)
Set a set of pedestrian features to be visible. Features not in the set will be set invisible. An empty set
means no features are visible
Parameters:
features
A set of visible pedestrian features
Returns:
The updated Map itself.
public Map setPoiCategoryVisible (IconCategory category, boolean visible)
Deprecated: As of release 2.0.
Replaced by setCartoMarkersVisible(IconCategory, boolean)
Toggles the visibility of a particular POI category. To toggle visibility for IconCategory.ALL icon
categories, setEmbeddedPoisVisible(boolean) can also be used.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
category
See IconCategory for category list.
visible
Intended visibility for the specific POI category.
272
Returns:
The updated Map itself.
public Map setProjectionMode (Map.Projection projection)
Change the projection mode used to render the map.
Parameters:
projection
The new projection mode.
Returns:
Map builder pattern
public Map setTilt (float angle)
Sets a tilt angle for this Map , in degrees.
Parameters:
angle
Desired tilt angle. Acceptable values are the range between getMinTilt() and
getMaxTilt() inclusive.
Returns:
The updated Map.
See also:
mapping.Map.setTilt (float, Animation)
HERE SDK for Android Developer's Guide
► API Reference
273
public void setTilt (float angle, Map.Animation animation)
Sets a tilt angle for the Map , in degrees.
Note: The tilt animation is not cancelled when other map operations (for example,
setCenter(GeoCoordinate, Animation)) are performed. Therefore, the tilt animation can occur
concurrently with other animations.
Parameters:
angle
Desired tilt angle. Acceptable values are the range between getMinTilt(void)
and getMaxTilt(void) inclusive.
animation
An Animation to illustrate the transformation
See also:
mapping.Map.setTilt (float)
public Map setTransformCenter (PointF center)
Sets a center coordinate for Map transformations such as zooming and rotation. Transformations
performed after calling this method will be based on this new center coordinate. The transform
center may be different than the Map center.
Parameters:
center
A PointF representing the center used for transformations
Returns:
The updated Map
public boolean setUseSystemLanguage ()
Set the map display language using the system default locale. Causes a map redraw when language is
set.
Returns:
HERE SDK for Android Developer's Guide
► API Reference
274
true if the language update is accepted by the Map, false otherwise.
public Map setZoomLevel (double level)
Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom
levels. No animation will be used to illustrate the transformation.
Legal values are the range between getMinZoomLevel() and getMaxZoomLevel(), inclusive.
If this method is called before map animation has finished (for example, if you had called
setCenter(GeoCoordinate, Animation)), the existing animation may be stopped and the
map will proceed directly to change the zoom level. Consider using other methods that
combine multiple actions to avoid unintentionally canceling map animations. For example, use
setCenter(GeoCoordinate, Animation, double, float, float).
Note: The zoom level is only precise to three decimal places due to numerical operations performed
internally when rendering the map.
Parameters:
level
Desired fractional zoom level
Returns:
The updated Map.
See also:
mapping.Map.setZoomLevel (double, Animation)
mapping.Map.setZoomLevel (double, PointF, Animation)
mapping.Map.getMinZoomLevel ()
mapping.Map.getMaxZoomLevel ()
public void setZoomLevel (double level, Map.Animation animation)
Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom
levels.
HERE SDK for Android Developer's Guide
► API Reference
275
Legal values are the range between getMinZoomLevel() and getMaxZoomLevel() inclusive.
If this method is called before map animation is finished (for example, if you had called
setCenter(GeoCoordinate, Animation)), the existing animation may be stopped and the
map will proceed directly to change the zoom level. Consider using other methods that
combine multiple actions to avoid unintentionally canceling map animations. For example, use
setCenter(GeoCoordinate, Animation, double, float, float).
Note: The zoom level is only precise to three decimal places due to numerical operations performed
internally when rendering the map.
Parameters:
level
Desired fractional zoom level
animation
An Animation to illustrate the transformation
See also:
mapping.Map.setZoomLevel (double)
mapping.Map.setZoomLevel (double, PointF, Animation)
mapping.Map.getMinZoomLevel ()
mapping.Map.getMaxZoomLevel ()
public void setZoomLevel (double level, PointF focus, Map.Animation
animation)
Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom
levels while keeping the specified screen coordinate at the same Geographical Location. Concretely,
the GeoCoordinate of the specified PointF is the same before and after the transformation.
Legal values are the range between getMinZoomLevel() and getMaxZoomLevel() inclusive.
For the purposes of calculating the focus GeoCoordinate , the tilt of the map is considered to be 0.
The actual map tilt will not change.
Note: do not call this method before setting the map is initialized. If you call this method while either
getWidth() or getHeight() returns 0 it will throw a RuntimeException .
Note: The zoom level is only precise to three decimal places due to numerical operations performed
internally when rendering the map.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
level
Desired fractional zoom level
focus
A PointF to keep fixed, in pixel coordinates.
animation
An Animation to illustrate the transformation
276
See also:
mapping.Map.setZoomLevel (double)
mapping.Map.setZoomLevel (double, Animation)
mapping.Map.getMinZoomLevel ()
mapping.Map.getMaxZoomLevel ()
public void zoomTo (GeoBoundingBox geoRect, Map.Animation animation, float
orientation)
Moves this Map instance's map center and changes the zoom level to show the specified
GeoBoundingBox at the given orientation.
Do not call this method before this map instance is initialized. If you call this method while this map
is uninitialized (either getWidth() or getHeight() returns 0), it will throw a RuntimeException . Please
note the effects of this method will apply on Map slightly after the method invocation.
Parameters:
geoRect
A GeoBoundingBox to show after the transformation
animation
An Animation to illustrate the transformation
orientation
Desired orientation of the Map (Use MOVE_PRESERVE_ORIENTATION to
keep the current orientation)
See also:
mapping.Map.zoomTo (GeoBoundingBox, ViewRect, Animation, float)
mapping.Map.zoomTo (GeoBoundingBox, int, int, Animation, float)
public void zoomTo (GeoBoundingBox geoRect, Map.Animation animation, float
orientation, float tilt)
HERE SDK for Android Developer's Guide
► API Reference
277
Moves this Map instance's map center and changes the zoom level to show the specified
GeoBoundingBox at the given orientation.
Do not call this method before this map instance is initialized. If you call this method while this map
is uninitialized (either getWidth() or getHeight() returns 0), it will throw a RuntimeException . Please
note the effects of this method will apply on Map slightly after the method invocation.
Parameters:
geoRect
A GeoBoundingBox to show after the transformation
animation
An Animation to illustrate the transformation
orientation
Desired orientation of the Map (Use MOVE_PRESERVE_ORIENTATION to
keep the current orientation)
tilt
See also:
mapping.Map.zoomTo (GeoBoundingBox, ViewRect, Animation, float)
mapping.Map.zoomTo (GeoBoundingBox, int, int, Animation, float)
public void zoomTo (GeoBoundingBox geoRect, ViewRect viewPort, Map.Animation
animation, float orientation)
Moves this Map instance and changes its zoom level to show the specified GeoBoundingBox within
the provided ViewRect.
Do not call this method before this map instance is initialized. If you call this method while this map
is uninitialized (either getWidth() or getHeight() returns 0), it will throw a RuntimeException . Please
note the effects of this method will apply on Map slightly after the method invocation.
Parameters:
geoRect
A GeoBoundingBox to show after the transformation
viewPort
A ViewRect representing the view port into which the GeoBoundingBox
fits. The ViewRect is interpreted as being in the same MapFragment as this
Map instance.
animation
An Animation to illustrate the transformation
HERE SDK for Android Developer's Guide
► API Reference
orientation
278
Desired orientation of the Map (pass MOVE_PRESERVE_ORIENTATION to
keep the current orientation)
See also:
mapping.Map.zoomTo (GeoBoundingBox, Animation, float)
mapping.Map.zoomTo (GeoBoundingBox, int, int, Animation, float)
public void zoomTo (GeoBoundingBox geoRect, int width, int height,
Map.Animation animation, float orientation)
Moves this Map instance and changes its zoom level to show the specified GeoBoundingBox within
the specified pixel dimensions around the transform center.
Do not call this method before this map instance is initialized. If you call this method while this map
is uninitialized (either getWidth() or getHeight() returns 0), it will throw a RuntimeException . Please
note the effects of this method will apply on Map slightly after the method invocation.
Parameters:
geoRect
A GeoBoundingBox to show after the transformation
width
The width, in number of pixels, of the bounding area around the transform
center, which the geoRect will fit into.
height
The height, in number of pixels, of the bounding area around the transform
center, which the geoRect will fit into.
animation
An Animation to illustrate the transformation
orientation
Desired orientation of the Map (pass MOVE_PRESERVE_ORIENTATION to
keep the current orientation)
See also:
mapping.Map.setTransformCenter (PointF)
mapping.Map.zoomTo (GeoBoundingBox, Animation, float)
mapping.Map.zoomTo (GeoBoundingBox, ViewRect, Animation, float)
HERE SDK for Android Developer's Guide
► API Reference
Animation
The enumeration Animation is a member of com.here.android.mpa.mapping.Map .
Enumeration Summary
public static final enumeration Map.Animation
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values that describe animation types for on-screen map movements.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 84: Enum Constants in Animation
Fields
public static final Map.Animation
BOW
Zooms out and then in again in a bow-like manner as the map resets to a new position.
public static final Map.Animation
LINEAR
Moves in a linear manner as the map resets to a new position.
public static final Map.Animation
NONE
No animation is performed as the map resets to a new position.
Method Summary
Table 85: Methods in Animation
Methods
public static Map.Animation
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Map.Animation[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values that describe animation types for on-screen map movements.
279
HERE SDK for Android Developer's Guide
► API Reference
280
If the map changes size or the application comes to the foreground while Animation.LINEAR or
Animation.BOW is being used in a Map attribute setter method, then the animation will abort, and
the transition will appear as failed. To avoid this behavior, use the Animation.NONE animation type
or wait until the map is stable before performing the transition operation.
Enum Constant Details
public static final Map.Animation BOW
Zooms out and then in again in a bow-like manner as the map resets to a new position.
public static final Map.Animation LINEAR
Moves in a linear manner as the map resets to a new position.
public static final Map.Animation NONE
No animation is performed as the map resets to a new position.
Method Details
public static Map.Animation valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Map.Animation[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
HERE SDK for Android Developer's Guide
► API Reference
InfoBubbleAdapter
The interface InfoBubbleAdapter is a member of com.here.android.mpa.mapping.Map .
Interface Summary
public static abstract interface Map.InfoBubbleAdapter
Interface for implementing custom info bubbles for MapMarker objects.
[For complete information, see the section Interface Details]
Method Summary
Table 86: Methods in InfoBubbleAdapter
Methods
public abstract View
getInfoBubble (MapMarker marker)
Provide a custom info bubble for the marker.
public abstract View
getInfoBubbleContents (MapMarker marker)
Provide custom contents for the info bubble.
Interface Details
Interface for implementing custom info bubbles for MapMarker objects.
Method Details
public abstract View getInfoBubble (MapMarker marker)
Provide a custom info bubble for the marker.
Parameters:
marker
The MapMarker that this bubble is associated with.
Returns:
The view for this bubble (including frame) or null if the implementer wishes to use
getInfoBubbleContents().
281
HERE SDK for Android Developer's Guide
► API Reference
public abstract View getInfoBubbleContents (MapMarker marker)
Provide custom contents for the info bubble.
Parameters:
marker
The MapMarker that this info bubble is associated with.
Returns:
The view for the contents of this bubble or null if the implementer wishes to use the default info
bubble.
Layer
The enumeration Layer is a member of com.here.android.mpa.mapping.Map .
Enumeration Summary
public static final enumeration Map.Layer
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Definition for layers within a map.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 87: Enum Constants in Layer
Fields
public static final Map.Layer
LABELS
Labels for all things, From parks to lakes, countries etc.
public static final Map.Layer
STREET_LABELS
Streets
public static final Map.Layer
TRAFFIC
Traffic lines
public static final Map.Layer
Borders, streets
LINES
282
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final Map.Layer
STREET_LEVEL_COVERAGE
Street level coverage
public static final Map.Layer
AREAS
Parks, bodies of water
public static final Map.Layer
BACKGROUND
Background areas like satellite tiles
public static final Map.Layer
TRUCK_ATTRIBUTES
Truck attributes, currently not supported.
public static final Map.Layer
TERRAIN
Terrain Layer
Method Summary
Table 88: Methods in Layer
Methods
public static Map.Layer
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Map.Layer[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Definition for layers within a map. These layers can be enabled or disabled dynamically via
setDisplayLayers(EnumSet).
Enum Constant Details
public static final Map.Layer LABELS
Labels for all things, From parks to lakes, countries etc.
public static final Map.Layer STREET_LABELS
Streets
283
HERE SDK for Android Developer's Guide
► API Reference
public static final Map.Layer TRAFFIC
Traffic lines
public static final Map.Layer LINES
Borders, streets
public static final Map.Layer STREET_LEVEL_COVERAGE
Street level coverage
public static final Map.Layer AREAS
Parks, bodies of water
public static final Map.Layer BACKGROUND
Background areas like satellite tiles
public static final Map.Layer TRUCK_ATTRIBUTES
Truck attributes, currently not supported. Reserved for future usage.
public static final Map.Layer TERRAIN
Terrain Layer
Method Details
public static Map.Layer valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
284
HERE SDK for Android Developer's Guide
► API Reference
name
285
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Map.Layer[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
OnSchemeChangedListener
The interface OnSchemeChangedListener is a member of com.here.android.mpa.mapping.Map .
Interface Summary
public static abstract interface Map.OnSchemeChangedListener
Listener for Map scheme changed events.
[For complete information, see the section Interface Details]
Method Summary
Table 89: Methods in OnSchemeChangedListener
Methods
public abstract void
onMapSchemeChanged (String schemeName)
A callback indicating that the map scheme has changed.
Interface Details
Listener for Map scheme changed events.
Method Details
public abstract void onMapSchemeChanged (String schemeName)
A callback indicating that the map scheme has changed.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
schemeName
286
Updated scheme name.
See also:
mapping.Map.setMapScheme (String)
OnTransformListener
The interface OnTransformListener is a member of com.here.android.mpa.mapping.Map .
Interface Summary
public static abstract interface Map.OnTransformListener
Listener for Map transform events.
[For complete information, see the section Interface Details]
Method Summary
Table 90: Methods in OnTransformListener
Methods
public abstract void
onMapTransformEnd (MapState mapState)
Called after onMapTransformStart() once the MapState returns to a steady value (such as when it has stopped moving).
public abstract void
onMapTransformStart ()
Called just before the MapState begins to change.
Interface Details
Listener for Map transform events. Map transform events are triggered by any operation which
causes the MapState to change. This includes user interaction (such as map gestures) as well as
programmatic calls to the map.
onMapTransformStart() is called just before the map state begins to change, while
onMapTransformEnd(MapState) is called after the map state returns to a steady value. Therefore,
there can be a significant amount of time between when the two callbacks are made in cases such as
animated map movement events and continuous user interaction.
HERE SDK for Android Developer's Guide
► API Reference
287
If you need to update UI widgets as the map state changes, the recommended approach is to trigger
a Runnable object when onMapTransformStart() is called. This method periodically checks the
current map state (at no more than 30fps) and updates the UI widgets. The Runnable object can
then be cancelled upon a call to onMapTransformEnd(MapState). An android.os.Handler object
can be used to implement this elegantly.
Do not update UI widgets in onPostDraw(boolean, long) as this method is too frequently called.
Method Details
public abstract void onMapTransformEnd (MapState mapState)
Called after onMapTransformStart() once the MapState returns to a steady value (such as when it has
stopped moving).
Parameters:
mapState
The current state of the map at the time of this callback
public abstract void onMapTransformStart ()
Called just before the MapState begins to change. This can be triggered by user interaction (such as
map gestures) as well as programmatic calls to the map. This method will not be called again until an
onMapTransformEnd(MapState) call has been made.
PedestrianFeature
The enumeration PedestrianFeature is a member of com.here.android.mpa.mapping.Map .
Enumeration Summary
public static final enumeration Map.PedestrianFeature
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Pedestrian features to be rendered on the map
[For complete information, see the section Enumeration Details]
HERE SDK for Android Developer's Guide
► API Reference
Enum Constant Summary
Table 91: Enum Constants in PedestrianFeature
Fields
public static final Map.PedestrianFeature
CROSSWALK
Crosswalk
public static final Map.PedestrianFeature
STAIRS
Stairs
public static final Map.PedestrianFeature
ESCALATOR
Escalator
public static final Map.PedestrianFeature
ELEVATOR
Elevator
public static final Map.PedestrianFeature
TUNNEL
Tunnel
public static final Map.PedestrianFeature
BRIDGE
Bridge
Method Summary
Table 92: Methods in PedestrianFeature
Methods
public static Map.PedestrianFeature
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Map.PedestrianFeature[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Pedestrian features to be rendered on the map
Enum Constant Details
public static final Map.PedestrianFeature CROSSWALK
Crosswalk
288
HERE SDK for Android Developer's Guide
► API Reference
289
public static final Map.PedestrianFeature STAIRS
Stairs
public static final Map.PedestrianFeature ESCALATOR
Escalator
public static final Map.PedestrianFeature ELEVATOR
Elevator
public static final Map.PedestrianFeature TUNNEL
Tunnel
public static final Map.PedestrianFeature BRIDGE
Bridge
Method Details
public static Map.PedestrianFeature valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Map.PedestrianFeature[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
HERE SDK for Android Developer's Guide
► API Reference
PixelResult
The class PixelResult is a member of com.here.android.mpa.mapping.Map .
Class Summary
public static class Map.PixelResult
extends java.lang.Object
Result class for conversion of a GeoCoordinate to screen pixel coordinates.
[For complete information, see the section Class Details]
See also:
mapping.Map.projectToPixel (GeoCoordinate)
Nested Class Summary
Table 93: Nested Classes in PixelResult
Nested Classes
public static final enumeration
Map.PixelResult.Error
Error code for the computation of GeoCoordinate to screen pixel coordinate projection
Method Summary
Table 94: Methods in PixelResult
Methods
public Map.PixelResult.Error
getError ()
Get the Error of the GeoCoordinate to screen Pixel conversion.
public PointF
getResult ()
Get the result of the GeoCoordinate to screen Pixel conversion.
Class Details
Result class for conversion of a GeoCoordinate to screen pixel coordinates.
See also:
290
HERE SDK for Android Developer's Guide
► API Reference
mapping.Map.projectToPixel (GeoCoordinate)
Method Details
public Map.PixelResult.Error getError ()
Get the Error of the GeoCoordinate to screen Pixel conversion.
Returns:
Error screen space in pixels.
public PointF getResult ()
Get the result of the GeoCoordinate to screen Pixel conversion.
Returns:
PointF screen space in pixels.
Error
The enumeration Error is a member of com.here.android.mpa.mapping.Map.PixelResult .
Enumeration Summary
public static final enumeration Map.PixelResult.Error
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Error code for the computation of GeoCoordinate to screen pixel coordinate projection
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 95: Enum Constants in Error
Fields
public static final Map.PixelResult.Error
NONE
public static final Map.PixelResult.Error
NOT_IN_VIEW
public static final Map.PixelResult.Error
OVERFLOW
291
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final Map.PixelResult.Error
UNKNOWN
Method Summary
Table 96: Methods in Error
Methods
public static Map.PixelResult.Error
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Map.PixelResult.Error[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Error code for the computation of GeoCoordinate to screen pixel coordinate projection
Enum Constant Details
public static final Map.PixelResult.Error NONE
public static final Map.PixelResult.Error NOT_IN_VIEW
public static final Map.PixelResult.Error OVERFLOW
public static final Map.PixelResult.Error UNKNOWN
Method Details
public static Map.PixelResult.Error valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
292
HERE SDK for Android Developer's Guide
► API Reference
name
293
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Map.PixelResult.Error[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Projection
The enumeration Projection is a member of com.here.android.mpa.mapping.Map .
Enumeration Summary
public static final enumeration Map.Projection
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
The projection scheme used to render the map.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 97: Enum Constants in Projection
Fields
public static final Map.Projection
MERCATOR
A mercator projection.
public static final Map.Projection
EQUIRECTANGULAR
An equirectangular projection.
public static final Map.Projection
GLOBE
A globe.
public static final Map.Projection
GLOBE_MERCATOR_AUTO
Deprecated: As of release 2.0.1.
A globe when zoom level is less than or equal to 3.0, mercator otherwise.
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 98: Methods in Projection
Methods
public static Map.Projection
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Map.Projection[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
The projection scheme used to render the map.
Enum Constant Details
public static final Map.Projection MERCATOR
A mercator projection.
public static final Map.Projection EQUIRECTANGULAR
An equirectangular projection.
public static final Map.Projection GLOBE
A globe.
public static final Map.Projection GLOBE_MERCATOR_AUTO
Deprecated: As of release 2.0.1.
Use GLOBE instead. This mode will exhibit the same behaviour as { GLOBE mode starting from release 2.0.1.
A globe when zoom level is less than or equal to 3.0, mercator otherwise.
Method Details
public static Map.Projection valueOf (String name)
294
HERE SDK for Android Developer's Guide
► API Reference
295
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Map.Projection[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Scheme
The class Scheme is a member of com.here.android.mpa.mapping.Map .
Class Summary
public static final class Map.Scheme
extends java.lang.Object
Represents a collection of schemes that the Map class supports.
[For complete information, see the section Class Details]
Field Summary
Table 99: Fields in Scheme
Fields
public static final String
HYBRID_DAY
Satellite tile scheme presented in "day" colors, with visible roads.
public static final String
HYBRID_DAY_TRANSIT
Satellite tile scheme presented in "night" colors, with visible roads and highlighted transit lines.
public static final String
HYBRID_GREY_DAY
Satellite tile scheme presented in "day" colors, with visible roads, that is suitable for use cases in which map still has a high
relevance but is used as background for overlays (like venue maps).
public static final String
HYBRID_GREY_NIGHT
HERE SDK for Android Developer's Guide
► API Reference
296
Fields
Satellite tile scheme presented in "night" colors, with visible roads, that is suitable for use cases in which map still has a high
relevance but is used as background for overlays (like venue maps).
public static final String
HYBRID_NIGHT
Satellite tile scheme presented in "night" colors, with visible roads.
public static final String
HYBRID_NIGHT_TRANSIT
Satellite tile scheme presented in "night" colors, with visible roads and highlighted transit lines.In all hybrid night schemes
the only difference to the hybrid day schemes is the sky.
public static final String
HYBRID_REDUCED_DAY
Satellite tile scheme presented in "day" colors, with visible roads, that is suitable for use cases in which map has a low
relevance and it is used as background for overlays.
public static final String
HYBRID_REDUCED_NIGHT
Satellite tile scheme presented in "night" colors, with visible roads, that is suitable for use cases in which map has a low
relevance and it is used as used as background for overlays.
public static final String
MANEUVER_DAY
Normal scheme suitable for single maneuver overview.
public static final String
NORMAL_DAY
Normal scheme presented in "day" colors.
public static final String
NORMAL_DAY_GREY
Normal scheme presented in "day" colors that is suitable for use cases in which map still has a high relevance but is used as
background for overlays (like venue maps).
public static final String
NORMAL_DAY_TRANSIT
Normal scheme presented in "day" colors that is suitable for transit.
public static final String
NORMAL_NIGHT
Normal scheme presented in "night" colors.
public static final String
NORMAL_NIGHT_GREY
Normal scheme presented in "night" colors that is suitable for use cases in which map still has a high relevance but is used as
background for overlays (like venue maps).
public static final String
NORMAL_NIGHT_TRANSIT
Normal scheme presented in "night" colors that is suitable for transit.
public static final String
PEDESTRIAN_DAY
Normal scheme presented in "day" colors that is suitable for pedestrian use cases.
public static final String
PEDESTRIAN_DAY_HYBRID
HERE SDK for Android Developer's Guide
► API Reference
297
Fields
Satellite tile scheme presented in "day" colors, with visible roads, that is suitable for pedestrian use cases.
public static final String
PEDESTRIAN_NIGHT
Normal scheme presented in "night" colors that is suitable for pedestrian use cases.
public static final String
PEDESTRIAN_NIGHT_HYBRID
Satellite tile scheme presented in "night" colors, with visible roads, that is suitable for pedestrian use cases.To show/hide
pedestrian features see setPedestrianFeaturesVisible(EnumSet)
public static final String
REDUCED_DAY
Normal scheme presented in "day" colors that is suitable for use cases in which map has a low relevance and it is used as
background for overlays.
public static final String
REDUCED_NIGHT
Normal scheme presented in "night" colors that is suitable for use cases in which map has a low relevance and it is used as
background for overlays.
public static final String
SATELLITE_DAY
Satellite tile scheme presented in "day" colors.
public static final String
SATELLITE_NIGHT
Satellite tile scheme presented in "night" colors.
public static final String
TERRAIN_DAY
Terrain bitmap scheme presented in "day" colors.
Class Details
Represents a collection of schemes that the Map class supports. Each of the schemes in this class can
be set by way of the setMapScheme(String) method.
Field Details
HERE SDK for Android Developer's Guide
► API Reference
298
public static final String HYBRID_DAY
Satellite tile scheme presented in "day" colors, with visible roads.
public static final String HYBRID_DAY_TRANSIT
Satellite tile scheme presented in "night" colors, with visible roads and highlighted transit lines. To
show/hide transit lines see setMode(Mode).
public static final String HYBRID_GREY_DAY
Satellite tile scheme presented in "day" colors, with visible roads, that is suitable for use cases in
which map still has a high relevance but is used as background for overlays (like venue maps).
public static final String HYBRID_GREY_NIGHT
Satellite tile scheme presented in "night" colors, with visible roads, that is suitable for use cases in
which map still has a high relevance but is used as background for overlays (like venue maps). In all
hybrid night schemes the only difference to the hybrid day schemes is the sky. A night sky is being
used instead of a day sky. This is only visible in 3D.
public static final String HYBRID_NIGHT
Satellite tile scheme presented in "night" colors, with visible roads. In all hybrid night schemes the
only difference to the hybrid day schemes is the sky. A night sky is being used instead of a day sky.
This is only visible in 3D.
public static final String HYBRID_NIGHT_TRANSIT
Satellite tile scheme presented in "night" colors, with visible roads and highlighted transit lines.In all
hybrid night schemes the only difference to the hybrid day schemes is the sky. A night sky is being
used instead of a day sky. This is only visible in 3D. To show/hide transit lines see setMode(Mode).
HERE SDK for Android Developer's Guide
► API Reference
299
public static final String HYBRID_REDUCED_DAY
Satellite tile scheme presented in "day" colors, with visible roads, that is suitable for use cases in
which map has a low relevance and it is used as background for overlays.
public static final String HYBRID_REDUCED_NIGHT
Satellite tile scheme presented in "night" colors, with visible roads, that is suitable for use cases in
which map has a low relevance and it is used as used as background for overlays. In all hybrid night
schemes the only difference to the hybrid day schemes is the sky. A night sky is being used instead of
a day sky. This is only visible in 3D.
public static final String MANEUVER_DAY
Normal scheme suitable for single maneuver overview. This scheme is useful for guidance and
routing use cases. This scheme can be used for day and night since it has a strong contrast.
public static final String NORMAL_DAY
Normal scheme presented in "day" colors.
public static final String NORMAL_DAY_GREY
Normal scheme presented in "day" colors that is suitable for use cases in which map still has a high
relevance but is used as background for overlays (like venue maps).
public static final String NORMAL_DAY_TRANSIT
Normal scheme presented in "day" colors that is suitable for transit. To show/hide transit lines see
setMode(Mode).
public static final String NORMAL_NIGHT
Normal scheme presented in "night" colors.
HERE SDK for Android Developer's Guide
► API Reference
300
public static final String NORMAL_NIGHT_GREY
Normal scheme presented in "night" colors that is suitable for use cases in which map still has a high
relevance but is used as background for overlays (like venue maps).
public static final String NORMAL_NIGHT_TRANSIT
Normal scheme presented in "night" colors that is suitable for transit. To show/hide transit lines see
setMode(Mode).
public static final String PEDESTRIAN_DAY
Normal scheme presented in "day" colors that is suitable for pedestrian use cases. To show/hide
pedestrian features see setPedestrianFeaturesVisible(EnumSet)
public static final String PEDESTRIAN_DAY_HYBRID
Satellite tile scheme presented in "day" colors, with visible roads, that is suitable for pedestrian use
cases. To show/hide pedestrian features see setPedestrianFeaturesVisible(EnumSet)
public static final String PEDESTRIAN_NIGHT
Normal scheme presented in "night" colors that is suitable for pedestrian use cases. To show/hide
pedestrian features see setPedestrianFeaturesVisible(EnumSet)
public static final String PEDESTRIAN_NIGHT_HYBRID
Satellite tile scheme presented in "night" colors, with visible roads, that is suitable for pedestrian use
cases.To show/hide pedestrian features see setPedestrianFeaturesVisible(EnumSet)
public static final String REDUCED_DAY
HERE SDK for Android Developer's Guide
► API Reference
Normal scheme presented in "day" colors that is suitable for use cases in which map has a low
relevance and it is used as background for overlays.
public static final String REDUCED_NIGHT
Normal scheme presented in "night" colors that is suitable for use cases in which map has a low
relevance and it is used as background for overlays.
public static final String SATELLITE_DAY
Satellite tile scheme presented in "day" colors. No roads are shown in this scheme.
public static final String SATELLITE_NIGHT
Satellite tile scheme presented in "night" colors. No roads are shown in this scheme.
public static final String TERRAIN_DAY
Terrain bitmap scheme presented in "day" colors.
MapBuildingGroup
The class MapBuildingGroup is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapBuildingGroup
extends java.lang.Object
Represents a group of extruded buildings.
[For complete information, see the section Class Details]
See also:
301
HERE SDK for Android Developer's Guide
► API Reference
Nested Class Summary
Table 100: Nested Classes in MapBuildingGroup
Nested Classes
public static final enumeration
MapBuildingGroup.BuildingFace
Addressable building faces for the MapBuildingObject instances in this building group.
Method Summary
Table 101: Methods in MapBuildingGroup
Methods
public boolean
addBuilding (Identifier identifier)
Adds a building to this MapBuildingGroup.
public boolean
identifiers)
addBuildings (java.util.List <com.here.android.mpa.common.Identifier>
Adds a List of buildings to this MapBuildingGroup
public Identifier
convertStringToIdentifier (String id)
Convert a String building identifier to a concrete building Identifier.
public int
getBuildingCount ()
Gets the number of buildings in this MapBuildingGroup
public int
getColor (MapBuildingGroup.BuildingFace face)
Gets the color for this MapBuildingGroup's specified building face.
public float
getVerticalScale ()
Gets the MapBuildingGroup's height scaling factor.
public boolean
removeAllBuildings ()
Removes all MapBuildingObject from this MapBuildingGroup
public boolean
removeBuilding (Identifier identifier)
Removes a building from this MapBuildingGroup
public boolean
identifiers)
removeBuildings (java.util.List <com.here.android.mpa.common.Identifier>
Removes a List of buildings from this MapBuildingGroup
public void setColor (int color, java.util.EnumSet
<com.here.android.mpa.mapping.MapBuildingGroup.BuildingFace> faces)
302
HERE SDK for Android Developer's Guide
► API Reference
Methods
Sets the color for the specified building faces.
public void
setVerticalScale (float scale)
Sets the MapBuildingGroup's height scaling factor.
Class Details
Represents a group of extruded buildings.
See also:
Method Details
public boolean addBuilding (Identifier identifier)
Adds a building to this MapBuildingGroup.
Parameters:
identifier
Identifier of the building to be added. The Identifier can be retrieved
from PlaceLink.
Returns:
true if added, false otherwise.
public boolean addBuildings (java.util.List
<com.here.android.mpa.common.Identifier> identifiers)
Adds a List of buildings to this MapBuildingGroup
Parameters:
identifiers
List of building Identifiers of buildings to be added.
Returns:
true if added, false otherwise.
303
HERE SDK for Android Developer's Guide
► API Reference
public Identifier convertStringToIdentifier (String id)
Convert a String building identifier to a concrete building Identifier.
Parameters:
id
String building id retrieved from BUILDING_ID_REFERENCE_NAME
Returns:
An Identifier that can be used to highlight or query buildings.
public int getBuildingCount ()
Gets the number of buildings in this MapBuildingGroup
Returns:
number of buildings in the MapBuildingGroup
public int getColor (MapBuildingGroup.BuildingFace face)
Gets the color for this MapBuildingGroup's specified building face.
Parameters:
face
MapBuildingGroup.BuildingFace
Returns:
An integer representing android.graphics.Color
public float getVerticalScale ()
Gets the MapBuildingGroup's height scaling factor.
Returns:
float scaling factor [0,1]
public boolean removeAllBuildings ()
Removes all MapBuildingObject from this MapBuildingGroup
304
HERE SDK for Android Developer's Guide
► API Reference
305
Returns:
true if removed, false otherwise
public boolean removeBuilding (Identifier identifier)
Removes a building from this MapBuildingGroup
Parameters:
identifier
Building Identifier
Returns:
true if removed, false otherwise.
public boolean removeBuildings (java.util.List
<com.here.android.mpa.common.Identifier> identifiers)
Removes a List of buildings from this MapBuildingGroup
Parameters:
identifiers
List of building Identifiers
Returns:
true if removed, false otherwise.
public void setColor (int color, java.util.EnumSet
<com.here.android.mpa.mapping.MapBuildingGroup.BuildingFace> faces)
Sets the color for the specified building faces. All MapBuildingObject in this building group will be
affected.
Parameters:
color
An integer representing android.graphics.Color. The format is #AARRGGBB.
faces
EnumSet of MapBuildingGroup.BuildingFaces.
HERE SDK for Android Developer's Guide
306
► API Reference
public void setVerticalScale (float scale)
Sets the MapBuildingGroup's height scaling factor. All MapBuildingObject in this building group will be
affected.
Parameters:
scale
Scale factor
BuildingFace
The enumeration BuildingFace is a member of com.here.android.mpa.mapping.MapBuildingGroup .
Enumeration Summary
public static final enumeration MapBuildingGroup.BuildingFace
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Addressable building faces for the MapBuildingObject instances in this building group.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 102: Enum Constants in BuildingFace
Fields
public static final MapBuildingGroup.BuildingFace
ROOF
The top of a building
public static final MapBuildingGroup.BuildingFace
WALLTOP
The upper portion of a building's side walls
public static final MapBuildingGroup.BuildingFace
WALLBOTTOM
The bottom portion of a building's side walls
public static final MapBuildingGroup.BuildingFace
OUTLINE
The seams between each face of the building
public static final MapBuildingGroup.BuildingFace
Only applicable for landmarks.
LANDMARKS
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 103: Methods in BuildingFace
Methods
public int
mask ()
Retrieve the declared enumeration value
public static MapBuildingGroup.BuildingFace
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapBuildingGroup.BuildingFace[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Addressable building faces for the MapBuildingObject instances in this building group.
Enum Constant Details
public static final MapBuildingGroup.BuildingFace ROOF
The top of a building
public static final MapBuildingGroup.BuildingFace WALLTOP
The upper portion of a building's side walls
public static final MapBuildingGroup.BuildingFace WALLBOTTOM
The bottom portion of a building's side walls
public static final MapBuildingGroup.BuildingFace OUTLINE
The seams between each face of the building
public static final MapBuildingGroup.BuildingFace LANDMARKS
Only applicable for landmarks. When this value is used, the entire landmark is shaded.
307
HERE SDK for Android Developer's Guide
► API Reference
308
Method Details
public int mask ()
Retrieve the declared enumeration value
Returns:
the declared enumeration value
public static MapBuildingGroup.BuildingFace valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapBuildingGroup.BuildingFace[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
MapBuildingLayer
The class MapBuildingLayer is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapBuildingLayer
extends java.lang.Object
Represents a map layer that enables interactions with extruded buildings.
[For complete information, see the section Class Details]
See also:
mapping.Map.getMapBuildingLayer ()
HERE SDK for Android Developer's Guide
► API Reference
309
Nested Class Summary
Table 104: Nested Classes in MapBuildingLayer
Nested Classes
public static final class
MapBuildingLayer.BuildingSearchResult
Represents search results information for a building search
public static final enumeration
MapBuildingLayer.DefaultBuildingColor
A set of pre-defined colors to change a MapBuildingGroup's color property
public static final enumeration
MapBuildingLayer.DefaultBuildingGroups
Default groups of buildings on the Map.
Method Summary
Table 105: Methods in MapBuildingLayer
Methods
public MapBuildingGroup
createNewBuildingGroup ()
Create a new MapBuildingGroup for custom building selection.
public MapBuildingGroup
createNewBuildingGroup (MapBuildingLayer.DefaultBuildingColor color)
Create a new MapBuildingGroup with the given color for custom building selection.
public MapBuildingObject
getBuilding (Identifier buildingId, GeoCoordinate positionHint)
Find a particular building on the Map around the given position.
public MapBuildingObject
getBuilding (Identifier buildingId)
Find a particular building on the Map
public MapBuildingLayer.BuildingSearchResult
getBuildingsInside (GeoBoundingBox boundingBox)
Find all buildings located inside a GeoBoundingBox.
public MapBuildingGroup
group)
getDefaultBuildingGroup (MapBuildingLayer.DefaultBuildingGroups
Get a building group of a MapBuildingLayer.DefaultBuildingGroups type.
public java.util.HashMap <com.here.android.mpa.common.Identifier, java.lang.Float>
getTransparency (java.util.List <com.here.android.mpa.common.Identifier> buildingIds)
Retrieve the transparency (alpha) [0,1] factor of a list of buildings.
public java.util.HashMap <com.here.android.mpa.common.Identifier, java.lang.Float>
getVerticalScale (java.util.List <com.here.android.mpa.common.Identifier> buildingIds)
HERE SDK for Android Developer's Guide
► API Reference
310
Methods
Retrieve the vertical scale [0,1] factor of a list of buildings.
public void
releaseBuildingGroup (MapBuildingGroup group)
Release the MapBuildingGroup created for custom building selection.
Class Details
Represents a map layer that enables interactions with extruded buildings.
This class can be used to find MapBuildingObject and create MapBuildingGroup instances.
See also:
mapping.Map.getMapBuildingLayer ()
Method Details
public MapBuildingGroup createNewBuildingGroup ()
Create a new MapBuildingGroup for custom building selection.
Returns:
MapBuildingGroup. By default, a new MapBuildingGroup has the MapBuildingGroup with color
SELECTED.
At run time, there can only be a maximum number of MapBuildingGroups, when the limit is
reached, no new MapBuildingGroup can be created unless some are being freed up by calling
releaseBuildingGroup(MapBuildingGroup).
See also:
mapping.MapBuildingLayer.releaseBuildingGroup (MapBuildingGroup)
public MapBuildingGroup createNewBuildingGroup
(MapBuildingLayer.DefaultBuildingColor color)
Create a new MapBuildingGroup with the given color for custom building selection.
Parameters:
color
Returns:
Color of buildings in the new MapBuildingGroup
HERE SDK for Android Developer's Guide
► API Reference
311
MapBuildingGroup. Returns null if no more new MapBuildingGroup can be created.
At run time, there is a maximum number of MapBuildingGroups created. When the limit is
reached, no new MapBuildingGroup can be created unless some are being freed up by calling
releaseBuildingGroup(MapBuildingGroup).
See also:
mapping.MapBuildingLayer.releaseBuildingGroup (MapBuildingGroup)
public MapBuildingObject getBuilding (Identifier buildingId, GeoCoordinate
positionHint)
Find a particular building on the Map around the given position.
Parameters:
buildingId
Identifier of the building. Obtainable from PlaceLink. This parameter can be
null, if it is null it will try to find the building located at positionHint.
positionHint
A GeoCoordinate of the approximate location of the building.
Returns:
MapBuildingObject
public MapBuildingObject getBuilding (Identifier buildingId)
Find a particular building on the Map
Parameters:
buildingId
Identifier of the building. Obtainable from PlaceLink
Returns:
MapBuildingObject
public MapBuildingLayer.BuildingSearchResult getBuildingsInside
(GeoBoundingBox boundingBox)
Find all buildings located inside a GeoBoundingBox. This API will return all buildings located inside
a bounding box area. Map data for this area must be downloaded. If the search result returns
HERE SDK for Android Developer's Guide
► API Reference
312
java.lang.Error#NEEDS_DATA, retry the request after some delay. Map data download request
will be triggered.
Parameters:
boundingBox
A GeoBoundingBox representing the bounding box area.
Returns:
MapBuildingLayer.BuildingSearchResult. Use the method getResultCode() to determine success of
the operation. Building results can be retrieved via getResults()
public MapBuildingGroup getDefaultBuildingGroup
(MapBuildingLayer.DefaultBuildingGroups group)
Get a building group of a MapBuildingLayer.DefaultBuildingGroups type. The default building group is
a generic group that represents all possible buildings of that type in the entire world.
Parameters:
group
One of the values in the enum DefaultBuildingGroups
Returns:
MapBuildingGroup
public java.util.HashMap <com.here.android.mpa.common.Identifier,
java.lang.Float> getTransparency (java.util.List
<com.here.android.mpa.common.Identifier> buildingIds)
Retrieve the transparency (alpha) [0,1] factor of a list of buildings. This is useful to animate any
markers that are anchored to specific buildings.
This API can be used in conjunction with getVerticalScale(List) to perform custom animations of
MapMarker. This API should be called from onPostDraw(boolean, long) to synchronize with rendering.
Parameters:
buildingIds
A List of identifiers for the buildings of which the current transparency are
to be retrieved
Returns:
A HashMap of Identifier-to-transparency mappings.
HERE SDK for Android Developer's Guide
► API Reference
313
public java.util.HashMap <com.here.android.mpa.common.Identifier,
java.lang.Float> getVerticalScale (java.util.List
<com.here.android.mpa.common.Identifier> buildingIds)
Retrieve the vertical scale [0,1] factor of a list of buildings. This is useful to animate any markers that
are anchored to specific buildings.
This API can be used in conjunction with getTransparency(List) to perform custom animations of
MapMarker. This API should be called from onPostDraw(boolean, long) to synchronize with rendering.
Parameters:
buildingIds
A List of identifiers identifiers for the buildings of which the current vertical
scale are to be retrieved.
Returns:
A HashMap of the Identifier-to-scaling factor mappings.
public void releaseBuildingGroup (MapBuildingGroup group)
Release the MapBuildingGroup created for custom building selection.
Parameters:
group
The MapBuildingGroup to be released. The MapBuildingGroup instance
becomes invalid and unusable again.
See also:
mapping.MapBuildingLayer.createNewBuildingGroup ()
BuildingSearchResult
The class BuildingSearchResult is a member of com.here.android.mpa.mapping.MapBuildingLayer .
Class Summary
public static final class MapBuildingLayer.BuildingSearchResult
extends java.lang.Object
HERE SDK for Android Developer's Guide
314
► API Reference
Represents search results information for a building search
[For complete information, see the section Class Details]
Nested Class Summary
Table 106: Nested Classes in BuildingSearchResult
Nested Classes
public static final enumeration
MapBuildingLayer.BuildingSearchResult.ErrorCode
Error codes for building search result
Method Summary
Table 107: Methods in BuildingSearchResult
Methods
public MapBuildingLayer.BuildingSearchResult.ErrorCode
getResultCode ()
Get the error code.
public java.util.List <com.here.android.mpa.mapping.MapBuildingObject>
getResults ()
Get the list of buildings
Class Details
Represents search results information for a building search
Method Details
public MapBuildingLayer.BuildingSearchResult.ErrorCode getResultCode ()
Get the error code.
Returns:
MapBuildingLayer.BuildingSearchResult.ErrorCode The completion code for the building search.
public java.util.List <com.here.android.mpa.mapping.MapBuildingObject>
getResults ()
Get the list of buildings
HERE SDK for Android Developer's Guide
315
► API Reference
Returns:
A list of buildings
ErrorCode
The enumeration ErrorCode is a member of
com.here.android.mpa.mapping.MapBuildingLayer.BuildingSearchResult .
Enumeration Summary
public static final enumeration MapBuildingLayer.BuildingSearchResult.ErrorCode
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Error codes for building search result
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 108: Enum Constants in ErrorCode
Fields
public static final MapBuildingLayer.BuildingSearchResult.ErrorCode
NONE
No error.
public static final MapBuildingLayer.BuildingSearchResult.ErrorCode
NEEDS_DATA
Map Data is not available at the requested area.
public static final MapBuildingLayer.BuildingSearchResult.ErrorCode
AREA_TOO_LARGE
Search area is too large.
public static final MapBuildingLayer.BuildingSearchResult.ErrorCode
UNKNOWN
Unknown error.
Method Summary
Table 109: Methods in ErrorCode
Methods
public static MapBuildingLayer.BuildingSearchResult.ErrorCode
valueOf (String name)
HERE SDK for Android Developer's Guide
316
► API Reference
Methods
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapBuildingLayer.BuildingSearchResult.ErrorCode[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Error codes for building search result
Enum Constant Details
public static final MapBuildingLayer.BuildingSearchResult.ErrorCode NONE
No error.
public static final MapBuildingLayer.BuildingSearchResult.ErrorCode
NEEDS_DATA
Map Data is not available at the requested area. Requires download.
public static final MapBuildingLayer.BuildingSearchResult.ErrorCode
AREA_TOO_LARGE
Search area is too large. Search with a smaller boundingbox.
public static final MapBuildingLayer.BuildingSearchResult.ErrorCode UNKNOWN
Unknown error.
Method Details
public static MapBuildingLayer.BuildingSearchResult.ErrorCode valueOf
(String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
HERE SDK for Android Developer's Guide
317
► API Reference
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapBuildingLayer.BuildingSearchResult.ErrorCode[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
DefaultBuildingColor
The enumeration DefaultBuildingColor is a member of
com.here.android.mpa.mapping.MapBuildingLayer .
Enumeration Summary
public static final enumeration MapBuildingLayer.DefaultBuildingColor
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
A set of pre-defined colors to change a MapBuildingGroup's color property
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 110: Enum Constants in DefaultBuildingColor
Fields
public static final MapBuildingLayer.DefaultBuildingColor
SELECTED
public static final MapBuildingLayer.DefaultBuildingColor
HIGHLIGHT
public static final MapBuildingLayer.DefaultBuildingColor
HIGHLIGHT2
public static final MapBuildingLayer.DefaultBuildingColor
HIGHLIGHT3
public static final MapBuildingLayer.DefaultBuildingColor
HIGHLIGHT4
public static final MapBuildingLayer.DefaultBuildingColor
HIGHLIGHT5
HERE SDK for Android Developer's Guide
318
► API Reference
Method Summary
Table 111: Methods in DefaultBuildingColor
Methods
public static MapBuildingLayer.DefaultBuildingColor
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapBuildingLayer.DefaultBuildingColor[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
A set of pre-defined colors to change a MapBuildingGroup's color property
Enum Constant Details
public static final MapBuildingLayer.DefaultBuildingColor SELECTED
public static final MapBuildingLayer.DefaultBuildingColor HIGHLIGHT
public static final MapBuildingLayer.DefaultBuildingColor HIGHLIGHT2
public static final MapBuildingLayer.DefaultBuildingColor HIGHLIGHT3
public static final MapBuildingLayer.DefaultBuildingColor HIGHLIGHT4
public static final MapBuildingLayer.DefaultBuildingColor HIGHLIGHT5
Method Details
public static MapBuildingLayer.DefaultBuildingColor valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
HERE SDK for Android Developer's Guide
319
► API Reference
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapBuildingLayer.DefaultBuildingColor[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
DefaultBuildingGroups
The enumeration DefaultBuildingGroups is a member of
com.here.android.mpa.mapping.MapBuildingLayer .
Enumeration Summary
public static final enumeration MapBuildingLayer.DefaultBuildingGroups
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Default groups of buildings on the Map.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 112: Enum Constants in DefaultBuildingGroups
Fields
public static final MapBuildingLayer.DefaultBuildingGroups
NORMAL_BUILDINGS
Basic buildings.
public static final MapBuildingLayer.DefaultBuildingGroups
Special buildings, such as landmarks.
IMPORTANT_BUILDINGS
HERE SDK for Android Developer's Guide
320
► API Reference
Method Summary
Table 113: Methods in DefaultBuildingGroups
Methods
public static MapBuildingLayer.DefaultBuildingGroups
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapBuildingLayer.DefaultBuildingGroups[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Default groups of buildings on the Map.
Enum Constant Details
public static final MapBuildingLayer.DefaultBuildingGroups NORMAL_BUILDINGS
Basic buildings.
public static final MapBuildingLayer.DefaultBuildingGroups
IMPORTANT_BUILDINGS
Special buildings, such as landmarks.
Method Details
public static MapBuildingLayer.DefaultBuildingGroups valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapBuildingLayer.DefaultBuildingGroups[] values ()
HERE SDK for Android Developer's Guide
► API Reference
321
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
MapBuildingObject
The class MapBuildingObject is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapBuildingObject
extends com.here.android.mpa.mapping.MapProxyObject,
com.here.android.mpa.common.ViewObject, java.lang.Object
This class represents a specific building on the map.
[For complete information, see the section Class Details]
Method Summary
Table 114: Methods in MapBuildingObject
Methods
public float
getHeight ()
Gets the height of the MapBuildingObject
public Identifier
getIdentifier ()
Gets the Identifier of the building.
public String
getPlaceName ()
Gets the name of the MapBuildingObject.
public GeoCoordinate
getPosition ()
Gets the position of the MapBuildingObject
Class Details
This class represents a specific building on the map. Using the Identifier, the MapBuildingObject can
be attached to MapBuildingGroup groups to manipulate color and height properties.
HERE SDK for Android Developer's Guide
► API Reference
Method Details
public float getHeight ()
Gets the height of the MapBuildingObject
Returns:
height in meters relative to ground level.
public Identifier getIdentifier ()
Gets the Identifier of the building. The identifier can be matched against results in PlaceLink
Returns:
Identifier id of the building
public String getPlaceName ()
Gets the name of the MapBuildingObject. This information is only available in 3D Landmarks.
Returns:
Name of the landmark
public GeoCoordinate getPosition ()
Gets the position of the MapBuildingObject
Returns:
GeoCoordinate position of the building
MapCartoMarker
The class MapCartoMarker is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapCartoMarker
322
HERE SDK for Android Developer's Guide
► API Reference
323
extends com.here.android.mpa.mapping.MapProxyObject,
com.here.android.mpa.common.ViewObject, java.lang.Object
Represents a selectable cartography icon displayed at a geographical position on a map.
[For complete information, see the section Class Details]
Method Summary
Table 115: Methods in MapCartoMarker
Methods
public Location
getLocation ()
Returns the Location object for the MapCartoMarker
Class Details
Represents a selectable cartography icon displayed at a geographical position on a map. It cannot be
added, removed or modified by users.
Method Details
public Location getLocation ()
Returns the Location object for the MapCartoMarker
Returns:
The Location object for the MapCartoMarker.
MapCircle
The class MapCircle is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapCircle
extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
Represents a MapObject in the shape of a circle.
HERE SDK for Android Developer's Guide
► API Reference
[For complete information, see the section Class Details]
Constructor Summary
Table 116: Constructors in MapCircle
Constructors
MapCircle ()
Constructs a MapCircle , which is a MapObject in the shape of a circle.
MapCircle (double radius, GeoCoordinate center)
Constructs a MapCircle , which is a MapObject in the shape of a circle.
Method Summary
Table 117: Methods in MapCircle
Methods
public GeoCoordinate
getCenter ()
Returns the GeoCoordinate representing the current center of the MapCircle .
public int
getFillColor ()
Returns the current fill color for this MapCircle , returning an ARGB (Alpha/Red/Green/Blue) integer color value.
public int
getLineColor ()
Returns the current border line color for this MapCircle , as an ARGB (Alpha/Red/Green/Blue) integer color value.
public int
getLineWidth ()
Returns the current border line width for this MapCircle , in pixels.
public double
getRadius ()
Returns the current radius of the MapCircle , in meters.
public MapCircle
setCenter (GeoCoordinate center)
Sets the center for this MapCircle to a specified GeoCoordinate.
public MapCircle
setFillColor (int argbColor)
Sets a fill color for this MapCircle using an ARGB (Alpha/Red/Green/Blue) integer color value.
public MapCircle
setLineColor (int argbColor)
Sets a border line color for this MapCircle , using an ARGB (Alpha/Red/Green/Blue) integer color value.
public MapCircle
setLineWidth (int width)
324
HERE SDK for Android Developer's Guide
► API Reference
325
Methods
Sets a border line width, in pixels, for this MapCircle , an int value within the [1..100] range.
public MapCircle
setRadius (double radius)
Sets a radius for this MapCircle , in meters.
Class Details
Represents a MapObject in the shape of a circle.
Constructor Details
MapCircle ()
Constructs a MapCircle , which is a MapObject in the shape of a circle.
MapCircle (double radius, GeoCoordinate center)
Constructs a MapCircle , which is a MapObject in the shape of a circle.
Parameters:
radius
Desired radius of the MapCircle, in meters
center
A GeoCoordinate representing the center of the MapCircle.
Method Details
public GeoCoordinate getCenter ()
Returns the GeoCoordinate representing the current center of the MapCircle .
Returns:
The current MapCircle center
public int getFillColor ()
Returns the current fill color for this MapCircle , returning an ARGB (Alpha/Red/Green/Blue) integer
color value. Default fill color is solid blue or in ARGB color, 0xFF0000FF.
HERE SDK for Android Developer's Guide
► API Reference
326
Returns:
The current ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green,
blue. Each color component has a value range from [0..255] with 0 meaning no contribution for that
component, and 255 meaning 100% contribution
See also:
android.graphics.Color
public int getLineColor ()
Returns the current border line color for this MapCircle , as an ARGB (Alpha/Red/Green/Blue)
integer color value. Default line color is solid blue, or in ARGB color, 0xFF0000FF.
Returns:
The current ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green,
blue. Each color component has a value range from [0..255] with 0 meaning no contribution for that
component, and 255 meaning 100% contribution
See also:
android.graphics.Color
public int getLineWidth ()
Returns the current border line width for this MapCircle , in pixels. The default width is 0 pixels.
Returns:
The current width of the line defining the border of the MapCircle.
public double getRadius ()
Returns the current radius of the MapCircle , in meters. The default radius of a MapCircle
instance is 1.
Returns:
The current radius of this MapCircle.
public MapCircle setCenter (GeoCoordinate center)
HERE SDK for Android Developer's Guide
► API Reference
327
Sets the center for this MapCircle to a specified GeoCoordinate.
Parameters:
center
Desired GeoCoordinate for this MapCircle center.
Returns:
The updated MapCircle itself.
public MapCircle setFillColor (int argbColor)
Sets a fill color for this MapCircle using an ARGB (Alpha/Red/Green/Blue) integer color value.
Parameters:
argbColor
Desired ARGB integer color value. The packed integer is made up of 4
bytes: alpha, red, green, blue. Each color component has a value range from
[0..255] with 0 meaning no contribution for that component, and 255 meaning 100% contribution
Returns:
The updated MapCircle itself.
See also:
android.graphics.Color
public MapCircle setLineColor (int argbColor)
Sets a border line color for this MapCircle , using an ARGB (Alpha/Red/Green/Blue) integer color
value.
Parameters:
argbColor
Desired ARGB integer color value. The packed integer is made up of 4
bytes: alpha, red, green, blue. Each color component has a value range from
[0..255] with 0 meaning no contribution for that component, and 255 meaning 100% contribution
Returns:
The updated MapCircle itself.
HERE SDK for Android Developer's Guide
► API Reference
See also:
android.graphics.Color
public MapCircle setLineWidth (int width)
Sets a border line width, in pixels, for this MapCircle , an int value within the [1..100] range.
Parameters:
width
Desired width of the line defining the border of the MapCircle
Returns:
The updated MapCircle itself.
public MapCircle setRadius (double radius)
Sets a radius for this MapCircle , in meters.
Parameters:
radius
Desired radius of the MapCircle.
Returns:
The updated MapCircle itself.
MapCompatibilityFragment
The class MapCompatibilityFragment is a member of com.here.android.mpa.mapping .
Class Summary
public class MapCompatibilityFragment
extends java.lang.Object
Represents a map fragment for API Level 10 support or above support, providing the same
functionalities as MapFragment.
Deprecated: As of release 2.1.
[For complete information, see the section Class Details]
328
HERE SDK for Android Developer's Guide
► API Reference
329
See also:
android.support.v4.app.Fragment
android.support.v4.app.FragmentActivity
Constructor Summary
Table 118: Constructors in MapCompatibilityFragment
Constructors
MapCompatibilityFragment ()
Constructor
Method Summary
Table 119: Methods in MapCompatibilityFragment
Methods
public void
addOnMapRenderListener (OnMapRenderListener listener)
Adds a OnMapRenderListener to listen for map render events.
public void
addRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Adds a MapRenderListener to listen for map render events.
public ViewRect
getClipRect ()
Gets the ViewRect representing the clip rectangle for the MapCompatibilityFragment .
public Rect
getCopyrightBoundaryRect ()
Gets the current rectangle relative to the MapCompatibilityFragment's boundary as a container for the HERE copyright logo.
public int
getCopyrightLogoHeight ()
Gets the height of the copyright logo.
public CopyrightLogoPosition
getCopyrightLogoPosition ()
Gets the position for the HERE copyright logo.
public int
getCopyrightLogoWidth ()
Gets the width of the copyright logo.
public int
getCopyrightMargin ()
HERE SDK for Android Developer's Guide
► API Reference
330
Methods
Gets the current margin, in pixels, for the HERE copyright logo, as an offset from the edge of the visible map area to the
edge of the logo.
public Map
getMap ()
Returns the instance of Map associated with this Map Fragment
public MapGesture
getMapGesture ()
Gets the MapGesture object representing the current gesture handler for the MapCompatibilityFragment .
public void
getScreenCapture (OnScreenCaptureListener listener)
Gets the full screen bitmap for the MapCompatibilityFragment .
public void
init (OnEngineInitListener listener)
This method asynchronously initializes the Map Engine and displays a map that occupies the entire
MapCompatibilityFragment's view rectangle.
public void
init (Context context, OnEngineInitListener listener)
This method asynchronously initializes the Map Engine and displays a map that occupies the entire
MapCompatibilityFragment's view rectangle.
public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle
savedInstanceState)
Called when a fragment is first attached to its activity.
public void
onDestroyView ()
Called when the view previously created by onCreateView(LayoutInflater, ViewGroup, Bundle) has been detached from the
fragment.
public void
onInflate (Activity activity, AttributeSet attrs, Bundle savedInstanceState)
Called when a fragment is being created as part of a view layout inflation, typically from setting the content view of an
activity.
public void
onPause ()
Called when the Fragment is no longer resumed.
public void
onResume ()
Called when the fragment is visible to the user and actively running.
public void
onSaveInstanceState (Bundle outState)
Called when the fragment has been asked to save its current dynamic state, so it can later be reconstructed in a new
instance.
public void
removeOnMapRenderListener (OnMapRenderListener listener)
Removes an existing OnMapRenderListener.
HERE SDK for Android Developer's Guide
► API Reference
331
Methods
public void
removeRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Removes an existing MapRenderListener.
public void
setClipRect (ViewRect rect, PointF transformCenter)
Sets a clipping rectangle to the MapCompatibilityFragment .
public void
setClipRect (ViewRect rect)
Sets a clipping rectangle to the MapCompatibilityFragment .
public void
setCopyrightBoundaryRect (Rect rect)
Sets a rectangle, in pixels, relative to the top left corner of the MapCompatabilityFragment 's boundary, for the
placement of the HERE copyright logo.
public void
setCopyrightLogoPosition (CopyrightLogoPosition position)
Sets a position for the HERE copyright logo.
public void
setCopyrightMargin (int margin)
Sets a margin, in pixels, for the HERE copyright logo, as an offset from the edge of the visible map area to the edge of the
logo (depending on the placement).
public void
setMapMarkerDragListener (MapMarker.OnDragListener listener)
Sets a MapMarker.OnDragListener to be invoked whenever any MapMarker on a Map that is attached to this fragment is
dragged.
public void
setOnTouchListener (View.OnTouchListener listener)
Sets an android.view.OnTouchListener to be invoked whenever a touch event is sent to the
MapCompatibilityFragment .
Class Details
Deprecated: As of release 2.1.
The minimal Android API Level supported by this SDK is 14. Use MapFragment instead.
Represents a map fragment for API Level 10 support or above support, providing the same
functionalities as MapFragment. This fragment class is designed to be used as a sub-component of
an activity that automatically handles Map UI interactions such as panning and zooming.
Each MapCompatibilityFragment is bound to a Map created automatically upon the
initialization of the fragment, and map-related objects are persisted during application
runtime. MapCompatibilityFragment objects have their own life cycle, state, and back
stack. Thus, it is unsafe to assume objects returned by MapCompatibilityFragment will be
available throughout the life time of its attached activity. Since this fragment internally sets
HERE SDK for Android Developer's Guide
► API Reference
332
Fragment.setRetainInstance(true), therefore the Map will retain any properties applied to it during an
application's lifetime.
Map Fragments are automatically notified of onResume() and onPause(), so blocking is unnecessary.
A MapCompatibilityFragment is defined in an Android layout XML file. For example:
<fragment
class="com.here.android.mapping.MapCompatibilityFragment"
android:id="@+id/map_fragment"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
MapCompatibilityFragment automatically handles MapEngine's pause and resume during activity
state changes, thus it is not necessary for the activity that owns map fragment(s) to manually call
MapEngine.onPause() or MapEngine.onResume() during the activity's onPause() and onResume().
However, considerations should be made on how much processing is done in the onResume() method
of an activity. Performing significant amounts of processing may delay the view rendering in cases
such as device orientation change. It is recommended to use a specifically designated handler for
organizing the amount of processing to be done in such cases.
Note: The hosting activity of MapCompatibilityFragment must inherit from FragmentActivity
class instead of the traditional Activity class. See http://developer.android.com/reference/android/
support/v4/app/FragmentActivity.html.
Note: In order to use MapCompatibilityFragment , the Android Support Library must be included
in the application. See http://developer.android.com/training/basics/fragments/support-lib.html. As
MapCompatibilityFragment is inherited from android.support.v4.app.Fragment , it
may not offer the same fragment functionality support as MapFragment, which is inherited from
android.app.Fragment.
See also:
android.support.v4.app.Fragment
android.support.v4.app.FragmentActivity
Constructor Details
MapCompatibilityFragment ()
Constructor
HERE SDK for Android Developer's Guide
► API Reference
333
Method Details
public void addOnMapRenderListener (OnMapRenderListener listener)
Adds a OnMapRenderListener to listen for map render events.
Parameters:
listener
See also:
public void addRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Instead use addOnMapRenderListener(OnMapRenderListener).
Adds a MapRenderListener to listen for map render events.
Parameters:
listener
A MapRenderListener to add to the MapCompatibilityFragment
See also:
mapping.MapCompatibilityFragment.removeRenderListener (MapRenderListener)
public ViewRect getClipRect ()
Gets the ViewRect representing the clip rectangle for the MapCompatibilityFragment .
Returns:
The clip rectangle for rendering MapObject objects and similar map-related screen elements
null maybe returned if the view's layout process has yet to be completed. Users can either retry
later or subscribe as a MapRenderListener and call this method upon the callback onSizeChanged(int,
int).
public Rect getCopyrightBoundaryRect ()
Gets the current rectangle relative to the MapCompatibilityFragment's boundary as a container for
the HERE copyright logo. null is returned unless a boundary rect has been set previously.
HERE SDK for Android Developer's Guide
► API Reference
334
Returns:
The boundary rect (can be null).
See also:
mapping.MapCompatibilityFragment.setCopyrightBoundaryRect (Rect)
public int getCopyrightLogoHeight ()
Gets the height of the copyright logo.
This method only returns a valid value once fragment initialization has taken place.
Returns:
The height of the copyright logo in pixels
public CopyrightLogoPosition getCopyrightLogoPosition ()
Gets the position for the HERE copyright logo.
Returns:
The position of the logo.
public int getCopyrightLogoWidth ()
Gets the width of the copyright logo.
This method only returns a valid value once fragment initialization has taken place.
Returns:
The width of the copyright logo in pixels
public int getCopyrightMargin ()
Gets the current margin, in pixels, for the HERE copyright logo, as an offset from the edge of the
visible map area to the edge of the logo.
This method only returns a valid value once fragment initialization has taken place.
Returns:
The current offset from the edge of the MapCompatibilityFragment
HERE SDK for Android Developer's Guide
► API Reference
335
public Map getMap ()
Returns the instance of Map associated with this Map Fragment
Returns:
The Map object currently displayed in this fragment.
public MapGesture getMapGesture ()
Gets the MapGesture object representing the current gesture handler for the
MapCompatibilityFragment . Applications can intercept this object and override the default
events.
Returns:
The MapGesture
public void getScreenCapture (OnScreenCaptureListener listener)
Gets the full screen bitmap for the MapCompatibilityFragment . This API can be used to
capture a screen shot of the MapCompatibilityFragment The API is asynchronous and
will callback once the operation is completed through OnScreenCaptureListener. Note the
MapCompatibilityFragment must be visible to create the screen capture.
Parameters:
listener
A OnScreenCaptureListener to receive screen capture completion callback
public void init (OnEngineInitListener listener)
This method asynchronously initializes the Map Engine and displays a map that occupies the entire
MapCompatibilityFragment's view rectangle. User of MapCompatibilityFragment must call this
function after the fragment is first attached to its activity. This method can be used for fragments
embedded in a layout XML. This method should not be used when programmatically creating a
MapCompatibilityFragment.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
listener
336
A OnEngineInitListener object that will be called when MapEngine initialization is finished. A null object can be supplied if the caller does not expect any
notification when initialization completes.
See also:
common.MapEngine.init (OnEngineInitListener)
public void init (Context context, OnEngineInitListener listener)
This method asynchronously initializes the Map Engine and displays a map that occupies the entire
MapCompatibilityFragment's view rectangle. User of MapCompatibilityFragment must call
this function after the fragment is first attached to its activity. This method can be used when
programmatically creating a MapCompatibilityFragment.
Parameters:
context
Context of the application.
listener
A OnEngineInitListener object that will be called when MapEngine initialization is finished. A null object can be supplied if the caller does not expect any
notification when initialization completes.
See also:
common.MapEngine.init (OnEngineInitListener)
public View onCreateView (LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
Called when a fragment is first attached to its activity. Automatically starts to initialize the Map
Engine for later use.
Parameters:
inflater
container
savedInstanceState HERE SDK for Android Developer's Guide
► API Reference
337
See also:
android.support.v4.app.Fragment#onAttach(android.app.Activity)
public void onDestroyView ()
Called when the view previously created by onCreateView(LayoutInflater, ViewGroup, Bundle) has
been detached from the fragment. The Map View created earlier will detach itself of its associated
Map instance.
See also:
android.support.v4.app.Fragment#onDestroyView()
public void onInflate (Activity activity, AttributeSet attrs, Bundle
savedInstanceState)
Called when a fragment is being created as part of a view layout inflation, typically from setting the
content view of an activity. This may be called immediately after the fragment is created from a tag in
a layout file.
Parameters:
activity
attrs
savedInstanceState See also:
android.support.v4.app.Fragment#onInflate(android.app.Activity, android.util.AttributeSet,
android.os.Bundle)
public void onPause ()
Called when the Fragment is no longer resumed. All Map Engine activities will be paused
automatically.
See also:
android.support.v4.app.Fragment#onPause()
HERE SDK for Android Developer's Guide
► API Reference
338
public void onResume ()
Called when the fragment is visible to the user and actively running. All Map Engine activities will be
resumed automatically.
See also:
android.support.v4.app.Fragment#onResume()
public void onSaveInstanceState (Bundle outState)
Called when the fragment has been asked to save its current dynamic state, so it can later be
reconstructed in a new instance.
Parameters:
outState
See also:
android.support.v4.app.Fragment#onSaveInstanceState(android.os.Bundle)
public void removeOnMapRenderListener (OnMapRenderListener listener)
Removes an existing OnMapRenderListener.
Parameters:
listener
public void removeRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Instead use removeOnMapRenderListener(OnMapRenderListener).
Removes an existing MapRenderListener.
Parameters:
listener
A MapRenderListener to remove from the MapCompatibilityFragment
HERE SDK for Android Developer's Guide
► API Reference
339
public void setClipRect (ViewRect rect, PointF transformCenter)
Sets a clipping rectangle to the MapCompatibilityFragment . Only the area specified by the
ViewRect will be used for rendering, while the rest of the view will be masked in black. This rectangle
will be reset to the full size of the MapCompatibilityFragment upon screen rotation or upon
recreating the screen.
Note that setting a clipping rectangle will also reset the MapView's viewing rectangle to its full
default size.
If the ViewRect is not valid, this method does nothing.
Parameters:
rect
A ViewRect for rendering MapObject objects and similar map-related screen
elements
transformCenter
A android.graphics.PointF representing the center coordinate for
map transformations such as zooming and rotation
See also:
mapping.MapCompatibilityFragment.setClipRect (ViewRect)
public void setClipRect (ViewRect rect)
Sets a clipping rectangle to the MapCompatibilityFragment . Only the area specified by the
ViewRect will be used for rendering, while the rest of the view will be masked in black. This rectangle
will be reset to the full size of the MapCompatibilityFragment upon screen rotation or upon
recreating the screen.
Note that setting a clipping rectangle will also reset the MapView's viewing rectangle to its full
default size.
If the ViewRect is not valid, this method does nothing.
Parameters:
rect
A ViewRect for rendering MapObject objects and similar map-related screen
elements
See also:
mapping.MapCompatibilityFragment.setClipRect (ViewRect, PointF)
HERE SDK for Android Developer's Guide
► API Reference
340
public void setCopyrightBoundaryRect (Rect rect)
Sets a rectangle, in pixels, relative to the top left corner of the MapCompatabilityFragment 's
boundary, for the placement of the HERE copyright logo.
If the specified rectangle is not contained completely within the current visible map area, their
area of intersection will be used instead of the specified rectangle's area. The copyright logo and
copyright margin must fit into the rectangle, otherwise specified rectangle will be ignored.
The rectangle is reset upon screen rotation or upon recreating the screen, or it can be done by
setting a null - Rect .
Parameters:
rect
A Rect representing the desired rectangular container to be used for positioning the copyright logo. Use null Rect to reset the boundary container.
public void setCopyrightLogoPosition (CopyrightLogoPosition position)
Sets a position for the HERE copyright logo. The current default is to place the logo at the centerbottom of the visible map view area.
Note: after the logo's position is set, it stays effective even when the screen is rotated or re-created.
Parameters:
position
A CopyrightLogoPosition value representing the desired placement of the
Here copyright logo with respect to the visible map view area
public void setCopyrightMargin (int margin)
Sets a margin, in pixels, for the HERE copyright logo, as an offset from the edge of the visible map
area to the edge of the logo (depending on the placement).
Parameters:
margin
Desired offset from the edge of the MapCompatibilityFragment
public void setMapMarkerDragListener (MapMarker.OnDragListener listener)
HERE SDK for Android Developer's Guide
► API Reference
341
Sets a MapMarker.OnDragListener to be invoked whenever any MapMarker on a Map that is attached
to this fragment is dragged.
Parameters:
listener
An MapMarker.OnDragListener to set for this fragment.
public void setOnTouchListener (View.OnTouchListener listener)
Sets an android.view.OnTouchListener to be invoked whenever a touch event is sent to the
MapCompatibilityFragment .
Parameters:
listener
An OnTouchListener to set for the MapCompatibilityFragment
See also:
android.view.View.OnTouchListener
MapContainer
The class MapContainer is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapContainer
extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
Represents a container that determines the stacking order of objects on a Map.
[For complete information, see the section Class Details]
Constructor Summary
Table 120: Constructors in MapContainer
Constructors
MapContainer ()
HERE SDK for Android Developer's Guide
342
► API Reference
Constructors
Creates an empty MapContainer .
Method Summary
Table 121: Methods in MapContainer
Methods
public boolean
addMapObject (MapObject object)
Adds a MapObject to this MapContainer .
public java.util.List <com.here.android.mpa.mapping.MapObject>
getAllMapObjects ()
Returns the list of all MapObject objects within this MapContainer.
public boolean
removeAllMapObjects ()
Removes all MapObject objects currently within this MapContainer.
public boolean
removeMapObject (MapObject object)
Removes the specified MapObject from this MapContainer.
Class Details
Represents a container that determines the stacking order of objects on a Map. Applications
can add certain types of MapObject objects into a MapContainer. For more details, refer to
addMapObject(MapObject).
Constructor Details
MapContainer ()
Creates an empty MapContainer .
Method Details
public boolean addMapObject (MapObject object)
Adds a MapObject to this MapContainer . Types of MapObject objects that can be added include:
•
•
•
MapMarker objects
MapLabeledMarker objects
MapScreenMarker objects
HERE SDK for Android Developer's Guide
► API Reference
•
•
MapCircle objects
MapPolyline objects
•
•
MapPolygon objects
MapContainer objects (Note: not supported as of Release 2.0)
343
For a complete enumeration of available MapObject types, refer to MapObject.Type.
Parameters:
object
A MapObject to add to this MapContainer
Returns:
True if the MapObject was added successfully to this MapContainer, false otherwise
See also:
mapping.MapContainer.removeMapObject (MapObject)
public java.util.List <com.here.android.mpa.mapping.MapObject>
getAllMapObjects ()
Returns the list of all MapObject objects within this MapContainer. Modifications to objects
returned from the array are not guaranteed to be reflected properly in the MapContainer. Use
addMapObject(MapObject) and removeMapObject(MapObject) to modify individual array elements.
Returns:
A list containing all MapObject objects within the MapContainer. If the MapContainer contains no map
object, an empty array will be returned.
public boolean removeAllMapObjects ()
Removes all MapObject objects currently within this MapContainer.
Returns:
True if all MapObject objects were removed successfully from this MapContainer, false otherwise
See also:
mapping.MapContainer.removeMapObject (MapObject)
public boolean removeMapObject (MapObject object)
HERE SDK for Android Developer's Guide
► API Reference
344
Removes the specified MapObject from this MapContainer. If the specified MapObject is not
contained within the MapContainer, the container will be unchanged.
Parameters:
object
A MapObject to remove from this MapContainer
Returns:
True if the MapObject was removed successfully from this MapContainer, false otherwise
See also:
mapping.MapContainer.removeAllMapObjects ()
MapFragment
The class MapFragment is a member of com.here.android.mpa.mapping .
Class Summary
public class MapFragment
extends java.lang.Object
A fragment class that automatically creates a Map and handles map UI interactions such as panning
and zooming.
[For complete information, see the section Class Details]
See also:
android.app.Fragment
Constructor Summary
Table 122: Constructors in MapFragment
Constructors
MapFragment ()
Constructor
HERE SDK for Android Developer's Guide
► API Reference
345
Method Summary
Table 123: Methods in MapFragment
Methods
public void
addOnMapRenderListener (OnMapRenderListener listener)
Adds a OnMapRenderListener to listen for map render events.
public void
addRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Adds a MapRenderListener to listen for map render events.
public ViewRect
getClipRect ()
Returns the ViewRect representing the clip rectangle for this MapFragment.
public Rect
getCopyrightBoundaryRect ()
Gets the current HERE copyright logo's boundary rectangle.
public int
getCopyrightLogoHeight ()
Returns the height of the copyright logo.
public CopyrightLogoPosition
getCopyrightLogoPosition ()
Returns the on-screen position of the HERE copyright logo as a CopyrightLogoPosition value.
public int
getCopyrightLogoWidth ()
Returns the width of the copyright logo.
public int
getCopyrightMargin ()
Returns the current margin for the HERE copyright logo, in number of pixels, as an offset from the edge of the visible map
area to the edge of the logo.
public Map
getMap ()
Returns the instance of Map associated with this map fragment
public MapGesture
getMapGesture ()
Returns the MapGesture object representing the current gesture handler for the MapFragment.
public void
getScreenCapture (OnScreenCaptureListener listener)
Returns the full screen bitmap for the MapFragment.
public void
init (OnEngineInitListener listener)
Initializes the MapEngine and displays a map that occupies the entire MapFragment's view rectangle.
public void
init (Context context, OnEngineInitListener listener)
HERE SDK for Android Developer's Guide
► API Reference
346
Methods
Initializes the MapEngine and displays a map that occupies the entire MapFragment's view rectangle.
public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle
savedInstanceState)
Called when this fragment is first attached to its Activity .
public void
onDestroyView ()
Called when the view previously created by onCreateView(LayoutInflater, ViewGroup, Bundle) has been detached from this
fragment.
public void
onInflate (Activity activity, AttributeSet attrs, Bundle savedInstanceState)
Called when this fragment is being created as part of a view layout inflation, typically from setting the content view of an
activity.
public void
onInflate (AttributeSet attrs, Bundle savedInstanceState)
Deprecated: As of API level 12, replaced by onInflate(Activity, AttributeSet, Bundle)
public void
onPause ()
Called when this fragment is no longer resumed.
public void
onResume ()
Called when this fragment is visible to the user and actively running.
public void
onSaveInstanceState (Bundle outState)
Called when this fragment has been asked to save its current dynamic state.
public void
removeOnMapRenderListener (OnMapRenderListener listener)
Removes an existing OnMapRenderListener.
public void
removeRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Removes an existing MapRenderListener.
public void
setClipRect (ViewRect rect, PointF transformCenter)
Sets a clipping rectangle to the MapFragment.
public void
setClipRect (ViewRect rect)
Sets a clipping rectangle to this MapFragment.
public void
setCopyrightBoundaryRect (Rect rect)
Sets a rectangle, in pixels, relative to the top left corner of the MapFragment's boundary, for the placement of the HERE
copyright logo.
public void
setCopyrightLogoPosition (CopyrightLogoPosition position)
HERE SDK for Android Developer's Guide
► API Reference
347
Methods
Sets a position for the HERE copyright logo.
public void
setCopyrightMargin (int margin)
Sets a margin for the HERE copyright logo, in number of pixels, as an offset from the edge of the visible map area to the
edge of the logo (depending on the placement).
public void
setMapMarkerDragListener (MapMarker.OnDragListener listener)
Sets a MapMarker.OnDragListener to be invoked whenever any MapMarker on a Map that is attached to this fragment is
dragged.
public void
setOnTouchListener (View.OnTouchListener listener)
Sets an android.view.OnTouchListener to be invoked whenever a touch event is sent to the MapFragment.
Class Details
A fragment class that automatically creates a Map and handles map UI interactions such as panning
and zooming. MapFragment extends the Android Fragment class and retains its lifecycle behaviors.
Upon the initialization of MapFragment , a Map object is automatically created and bound to
the fragment. This Map object is then persisted throughout the MapFragment 's lifetime. Since
MapFragment internally calls Fragment.setRetainInstance(true) , the Map will retain any
properties applied to it during an application's lifetime.
MapFragment objects have their own lifecycle, state, and back stack, thus it is unsafe to assume
objects returned by a MapFragment instance (with the exception of Map ) will be available throughout
the lifetime of its attached activity.
A MapFragment is defined in an Android layout XML file. For example:
<fragment
class="com.here.android.mapping.MapFragment"
android:id="@+id/map_fragment"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
Note: MapFragment automatically handles MapEngine pausing and resuming during activity state
changes, thus it is not necessary for the activity that owns MapFragment instances to manually call
onPause() or onResume() during the activity's onPause() and onResume(). However, considerations
should be made in how much processing is done during the onResume() method. Performing
significant amounts of processing may delay view rendering in cases such as device orientation
changes. In these cases, it is recommended to use a specifically designated handler to organize the
amount of processing to be done.
HERE SDK for Android Developer's Guide
► API Reference
For map fragment support on API level 10 and above, please use MapCompatibilityFragment.
See also:
android.app.Fragment
Constructor Details
MapFragment ()
Constructor
Method Details
public void addOnMapRenderListener (OnMapRenderListener listener)
Adds a OnMapRenderListener to listen for map render events.
Parameters:
listener
See also:
public void addRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Instead use addOnMapRenderListener(OnMapRenderListener).
Adds a MapRenderListener to listen for map render events.
Parameters:
listener
A MapRenderListener to add to the MapFragment
See also:
mapping.MapFragment.removeRenderListener (MapRenderListener)
public ViewRect getClipRect ()
348
HERE SDK for Android Developer's Guide
► API Reference
349
Returns the ViewRect representing the clip rectangle for this MapFragment.
Returns:
The clip rectangle for rendering MapObject objects and similar map-related screen elements. Null if
the view's layout process has yet to be completed.
If the process is not yet complete, users can either retry later or subscribe as a MapRenderListener
and call this method upon the callback onSizeChanged(int, int).
public Rect getCopyrightBoundaryRect ()
Gets the current HERE copyright logo's boundary rectangle. Returns null if a boundary rect has not
been set previously.
Returns:
The copyright logo's boundary rect. null if a boundary rect has not been set previously.
See also:
mapping.MapFragment.setCopyrightBoundaryRect (Rect)
public int getCopyrightLogoHeight ()
Returns the height of the copyright logo.
This method only returns a valid value once fragment initialization has taken completed.
Returns:
The height of the copyright logo, in number of pixels
public CopyrightLogoPosition getCopyrightLogoPosition ()
Returns the on-screen position of the HERE copyright logo as a CopyrightLogoPosition value.
Returns:
The position of the logo.
public int getCopyrightLogoWidth ()
Returns the width of the copyright logo.
HERE SDK for Android Developer's Guide
► API Reference
350
This method only returns a valid value once fragment initialization has completed.
Returns:
The width of the copyright logo, in number of pixels
public int getCopyrightMargin ()
Returns the current margin for the HERE copyright logo, in number of pixels, as an offset from the
edge of the visible map area to the edge of the logo.
This method only returns a valid value once fragment initialization has taken place.
Returns:
The current offset from the edge of the MapFragment, in number of pixels
public Map getMap ()
Returns the instance of Map associated with this map fragment
Returns:
The Map object currently displayed in this fragment.
public MapGesture getMapGesture ()
Returns the MapGesture object representing the current gesture handler for the MapFragment.
Applications can intercept this object and override the default event behaviors.
Returns:
The MapGesture
public void getScreenCapture (OnScreenCaptureListener listener)
Returns the full screen bitmap for the MapFragment. This method is asynchronous and will invoke a
callback once the operation is completed through the OnScreenCaptureListener. The MapFragment
must be visible to create the screen capture.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
listener
351
A OnScreenCaptureListener to listen for the callback when screen capture is complete.
public void init (OnEngineInitListener listener)
Initializes the MapEngine and displays a map that occupies the entire MapFragment's view rectangle.
Users of MapFragment should call this method or init(Context, OnEngineInitListener) after the
fragment is first attached to its activity. This method should only be used for fragments declared in a
layout XML. Do not use this method when MapFragment is created programmatically.
Parameters:
listener
A OnEngineInitListener object that will be called when MapFragment initialization is finished. A null object can be supplied if the caller does not expect
any notification when initialization completes.
See also:
common.MapEngine.init (OnEngineInitListener)
mapping.MapFragment.init (Context, OnEngineInitListener)
public void init (Context context, OnEngineInitListener listener)
Initializes the MapEngine and displays a map that occupies the entire MapFragment's view rectangle.
Users of MapFragment should call this method after the fragment is first attached to its activity.
This method can be used for MapFragment objects that are created programatically or declared in a
layout XML file.
Parameters:
context
The application context of this fragment.
listener
A OnEngineInitListener object that will be called when MapFragment initialization is finished. A null object can be supplied if the caller does not require
any notification when initialization completes.
See also:
HERE SDK for Android Developer's Guide
► API Reference
352
common.MapEngine.init (OnEngineInitListener)
mapping.MapFragment.init (OnEngineInitListener)
public View onCreateView (LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
Called when this fragment is first attached to its Activity . Automatically starts to initialize the
MapEngine for later use.
Parameters:
inflater
container
savedInstanceState Returns:
The created MapView object.
See also:
android.app.Fragment#onAttach(android.app.Activity)
public void onDestroyView ()
Called when the view previously created by onCreateView(LayoutInflater, ViewGroup, Bundle) has
been detached from this fragment. The MapView object created earlier will detach itself of its
associated Map instance.
See also:
android.app.Fragment#onDestroyView()
public void onInflate (Activity activity, AttributeSet attrs, Bundle
savedInstanceState)
Called when this fragment is being created as part of a view layout inflation, typically from setting
the content view of an activity. This method may be called immediately after the fragment is created
from a tag in a layout file.
HERE SDK for Android Developer's Guide
► API Reference
353
Parameters:
activity
attrs
savedInstanceState See also:
android.app.Fragment#onInflate(android.app.Activity, android.util.AttributeSet, android.os.Bundle)
public void onInflate (AttributeSet attrs, Bundle savedInstanceState)
Deprecated: As of API level 12, replaced by onInflate(Activity, AttributeSet, Bundle)
Parameters:
attrs
savedInstanceState public void onPause ()
Called when this fragment is no longer resumed. All MapEngine activities will be paused
automatically.
See also:
android.app.Fragment#onPause()
public void onResume ()
Called when this fragment is visible to the user and actively running. All MapEngine activities will be
resumed automatically.
See also:
android.app.Fragment#onResume()
HERE SDK for Android Developer's Guide
► API Reference
354
public void onSaveInstanceState (Bundle outState)
Called when this fragment has been asked to save its current dynamic state. Saving its current state
allows for it to be later reconstructed in a new instance.
Parameters:
outState
See also:
android.app.Fragment#onSaveInstanceState(android.os.Bundle)
public void removeOnMapRenderListener (OnMapRenderListener listener)
Removes an existing OnMapRenderListener.
Parameters:
listener
public void removeRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Instead use removeOnMapRenderListener(OnMapRenderListener).
Removes an existing MapRenderListener.
Parameters:
listener
A MapRenderListener to remove from the MapFragment
public void setClipRect (ViewRect rect, PointF transformCenter)
Sets a clipping rectangle to the MapFragment. Only the area specified by the ViewRect will be used
for rendering, while the rest of the view will be masked in black. This rectangle will be reset to the full
size of the MapFragment upon screen rotation or upon recreating the screen.
Note that setting a clipping rectangle will also reset the MapFragment 's viewing rectangle to its full
default size.
If the ViewRect is not valid, this method does nothing.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
rect
A ViewRect for rendering MapObject objects and similar map-related
screen elements
transformCenter
A android.graphics.PointF representing the center coordinate for
map transformations such as zooming and rotation
355
See also:
mapping.MapFragment.setClipRect (ViewRect)
public void setClipRect (ViewRect rect)
Sets a clipping rectangle to this MapFragment. Only the area specified by the ViewRect will be used
for rendering, while the rest of the view will be masked in black. This rectangle will be reset to the full
size of the MapFragment upon screen rotation or upon recreating the screen.
If the ViewRect is not valid, this method does nothing.
Parameters:
rect
A ViewRect for rendering MapObject objects and similar map-related
screen elements
See also:
mapping.MapFragment.setClipRect (ViewRect, PointF)
public void setCopyrightBoundaryRect (Rect rect)
Sets a rectangle, in pixels, relative to the top left corner of the MapFragment's boundary, for the
placement of the HERE copyright logo.
If the specified rectangle is not contained completely within the current visible map area, their
area of intersection will be used instead of the specified rectangle's area. The copyright logo and
copyright margin must fit into the rectangle, otherwise specified rectangle will be ignored.
The rectangle is reset upon screen rotation or upon screen re-creation, or it can be done by setting a
null - Rect .
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
rect
356
A Rect representing the desired rectangular container to be used for positioning the copyright logo. Use null Rect to reset the boundary container.
public void setCopyrightLogoPosition (CopyrightLogoPosition position)
Sets a position for the HERE copyright logo. The current default is to place the logo at the centerbottom of the visible map view area.
After the logo's position is set, the position stays effective even when the screen is rotated or recreated.
Parameters:
position
A CopyrightLogoPosition value representing the desired placement of the
HERE copyright logo with respect to the visible map view area
public void setCopyrightMargin (int margin)
Sets a margin for the HERE copyright logo, in number of pixels, as an offset from the edge of the
visible map area to the edge of the logo (depending on the placement).
Parameters:
margin
Desired offset from the edge of the MapFragment
public void setMapMarkerDragListener (MapMarker.OnDragListener listener)
Sets a MapMarker.OnDragListener to be invoked whenever any MapMarker on a Map that is attached
to this fragment is dragged.
Parameters:
listener
An MapMarker.OnDragListener to set for this MapFragment
public void setOnTouchListener (View.OnTouchListener listener)
Sets an android.view.OnTouchListener to be invoked whenever a touch event is sent to the
MapFragment.
HERE SDK for Android Developer's Guide
► API Reference
Parameters:
An android.view.OnTouchListener to set for the MapFragment
listener
See also:
android.view.View.OnTouchListener
MapGeoModel
The class MapGeoModel is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapGeoModel
extends com.here.android.mpa.mapping.MapModelObject,
com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
A MapGeoModel is a GeoCoordinate mesh displayed on a map.
[For complete information, see the section Class Details]
Constructor Summary
Table 124: Constructors in MapGeoModel
Constructors
MapGeoModel ()
Creates a MapGeoModel .
Method Summary
Table 125: Methods in MapGeoModel
Methods
public GeoMesh
getMesh ()
Gets the GeoMesh currently associated with the MapGeoModel .
public Image
getTexture ()
357
HERE SDK for Android Developer's Guide
► API Reference
358
Methods
Gets the current texture Image of the MapGeoModel .
public MapGeoModel
setMesh (GeoMesh model)
Sets a GeoMesh for the MapGeoModel .
public MapGeoModel
setTexture (Image texture)
Sets a texture Image for the MapGeoModel .
Class Details
A MapGeoModel is a GeoCoordinate mesh displayed on a map. The mesh is represented by a
GeoMesh object, which internally holds an array of GeoCoordinate .
Properties of a MapGeoModel mesh include its texture, which is an Image applied to the mesh. 2D
plane objects will respect the texture's transparency, while the alpha transparency for a texture being
applied to a 3D object is undefined.
Constructor Details
MapGeoModel ()
Creates a MapGeoModel .
Method Details
public GeoMesh getMesh ()
Gets the GeoMesh currently associated with the MapGeoModel .
Returns:
The GeoMesh
public Image getTexture ()
Gets the current texture Image of the MapGeoModel .
Returns:
The texture Image
HERE SDK for Android Developer's Guide
► API Reference
public MapGeoModel setMesh (GeoMesh model)
Sets a GeoMesh for the MapGeoModel .
Parameters:
model
Desired GeoMesh
Returns:
The updated MapGeoMesh itself.
public MapGeoModel setTexture (Image texture)
Sets a texture Image for the MapGeoModel .
Parameters:
texture
Desired texture Image
Returns:
The updated MapGeoMesh itself.
MapGesture
The interface MapGesture is a member of com.here.android.mpa.mapping .
Interface Summary
public abstract interface MapGesture
Encapsulates all user interactions and touch gestures.
[For complete information, see the section Interface Details]
Nested Class Summary
Table 126: Nested Classes in MapGesture
Nested Classes
public static abstract interface
MapGesture.OnGestureListener
359
HERE SDK for Android Developer's Guide
► API Reference
Nested Classes
Event Listener interface for gesture events.
Method Summary
Table 127: Methods in MapGesture
Methods
public abstract void
addOnGestureListener (MapGesture.OnGestureListener listener)
Adds a MapGesture.OnGestureListener to listen for map gesture events.
public abstract void
cancelKineticPanning ()
Cancels all currently active motions caused by kinetic panning.
public abstract boolean
isDoubleTapEnabled ()
Returns a boolean value indicating whether double-tap is enabled for the MapGesture .
public abstract boolean
isFixedMapCenterOnMapRotateZoom ()
Returns a boolean value indicating whether the transform center is applied on rotate and zoom interactions.
public abstract boolean
isKineticFlickEnabled ()
Returns a boolean value indicating whether flick-to-scroll (with kinetic momentum) is enabled for the MapGesture .
public abstract boolean
isKineticPinchEnabled ()
Deprecated: As of release 2.0.
Returns a boolean value indicating whether pinch (with kinetic momentum) is enabled for this MapGesture .
public abstract boolean
isKineticRotationEnabled ()
Deprecated: As of release 2.0.
Returns a boolean value indicating whether rotation (with kinetic momentum) is enabled for this MapGesture .
public abstract boolean
isLongPressEnabled ()
Returns a boolean value indicating whether long-press is enabled for this MapGesture .
public abstract boolean
isPanningEnabled ()
Returns a boolean value indicating whether panning is enabled for this MapGesture .
public abstract boolean
isPinchEnabled ()
Returns a boolean value indicating whether pinch is enabled for this MapGesture .
public abstract boolean
isRotateEnabled ()
Returns a boolean value indicating whether two-finger rotation is enabled for this MapGesture .
public abstract boolean
isSingleTapEnabled ()
360
HERE SDK for Android Developer's Guide
► API Reference
361
Methods
Returns a boolean value indicating whether single-tap is enabled for this MapGesture .
public abstract boolean
isTiltEnabled ()
Returns a boolean value indicating whether tilt is enabled for this MapGesture .
public abstract boolean
isTwoFingerPanningEnabled ()
Returns a boolean value indicating whether two-finger panning interactions are enabled for this MapGesture .
public abstract boolean
isTwoFingerPinchRotateEnabled ()
Deprecated: As of release 2.0.
Returns a boolean value indicating whether the two-finger pinch-and-rotate interaction is enabled for this MapGesture .
public abstract boolean
isTwoFingerTapEnabled ()
Returns a boolean value indicating whether two-finger tap is enabled for this MapGesture .
public abstract void
removeOnGestureListener (MapGesture.OnGestureListener listener)
Removes an existing MapGesture.OnGestureListener.
public abstract MapGesture
setAllGesturesEnabled (boolean enabled)
Sets all possible kinds of gesture interaction to be either enabled or disabled for the MapGesture .
public abstract MapGesture
setDoubleTapEnabled (boolean enabled)
Sets whether double-tap interactions are enabled or disabled for this MapGesture .
public abstract MapGesture
setFixedMapCenterOnMapRotateZoom (boolean lock)
Sets whether the transform center is applied during multitouch gestures.
public abstract MapGesture
setKineticFlickEnabled (boolean enabled)
Sets whether flick-to-scroll (with kinetic momentum) interactions are enabled for this MapGesture .
public abstract MapGesture
setKineticPinchEnabled (boolean isEnabled)
Deprecated: As of release 2.0.
Sets whether the pinch (with kinetic momentum) interaction is enabled or disabled for this MapGesture .
public abstract MapGesture
setKineticRotationEnabled (boolean enabled)
Deprecated: As of release 2.0.
Sets whether the rotation (with kinetic momentum) interaction is enabled or disabled for this MapGesture .
public abstract MapGesture
setLongPressEnabled (boolean enabled)
Sets whether long-press interactions are enabled or disabled for this MapGesture .
public abstract MapGesture
setPanningEnabled (boolean enabled)
Sets panning interactions to be either enabled or disabled for this MapGesture .
HERE SDK for Android Developer's Guide
► API Reference
362
Methods
public abstract MapGesture
setPinchEnabled (boolean enabled)
Sets whether pinch interactions are enabled or disabled for this MapGesture .
public abstract MapGesture
setRotateEnabled (boolean enabled)
Sets whether two-finger rotate interactions are enabled for this MapGesture .
public abstract MapGesture
setSingleTapEnabled (boolean enabled)
Sets whether single-tap interactions are enabled or disabled for this MapGesture .
public abstract MapGesture
setTiltEnabled (boolean enabled)
Sets whether tilt interactions are enabled or disabled for this MapGesture .
public abstract MapGesture
setTwoFingerPanningEnabled (boolean enable)
Sets whether the two-finger panning interaction is enabled for this MapGesture .
public abstract MapGesture
setTwoFingerPinchRotateEnabled (boolean enable)
Deprecated: As of release 2.0.
Sets whether the two-finger pinch-and-rotate interaction is enabled for this MapGesture .
public abstract MapGesture
setTwoFingerTapEnabled (boolean enabled)
Sets whether two-finger tap gestures are enabled or disabled for this MapGesture .
Interface Details
Encapsulates all user interactions and touch gestures.
Default gestures made available through this interface include:
•
•
•
•
•
•
•
•
•
Panning - allows a user to pan around a map by holding one finger on the screen and dragging to
a new geographical location
Kinetic Flick - allows a user to pan around a map by "flicking" the screen with one finger (faster
than panning but less precise)
Pinch To Zoom - allows a user to zoom out or zoom in by, respectively, pinching or spreading two
fingers being held to the screen
Double Tap - allows a user to zoom in to view closer geographical details
Two-Finger Tap - allows a user to zoom out to view a wider geographical area
Two-Finger Vertical Drag - allows a user to tilt a map to an angle between "straight down from
above" and "looking toward the horizon"
Two-Finger Rotate - allows a user to rotate a map to a desired compass orientation
Single Tap - does not encapsulate any default behavior. Developers can add application-specific
functionality to this gesture.
Long Press - does not encapsulate any default behavior. Developers can add application-specific
functionality to this gesture.
HERE SDK for Android Developer's Guide
► API Reference
363
Various setter methods of this interface allow an application developer to set specific gestures
as either enabled or disabled. There is also a setAllGesturesEnabled(boolean) method which
simultaneously enables or disables all gestures.
Note: the default functionality of one or more gestures can be customized by implementing the
MapGesture.OnGestureListener class and overriding appropriate methods to define desired gesture
functionality (this must be done to make use of the long press gesture).
Method Details
public abstract void addOnGestureListener (MapGesture.OnGestureListener
listener)
Adds a MapGesture.OnGestureListener to listen for map gesture events. When there are multiple
listeners subscribed to the MapGesture events, the order when a subscriber receives a callback is
determined by the order when they are added to MapGesture .
It is important that after adding an MapGesture.OnGestureListener in an user application, remember
to call removeOnGestureListener(OnGestureListener) when there's no longer a need to listen for map
gesture events to free up application resources.
Parameters:
listener
A MapGesture.OnGestureListener to add to this MapGesture
See also:
mapping.MapGesture.removeOnGestureListener (OnGestureListener)
public abstract void cancelKineticPanning ()
Cancels all currently active motions caused by kinetic panning.
public abstract boolean isDoubleTapEnabled ()
Returns a boolean value indicating whether double-tap is enabled for the MapGesture . By default,
this value is set to true.
Returns:
True if double-tap is enabled, false otherwise
HERE SDK for Android Developer's Guide
► API Reference
364
public abstract boolean isFixedMapCenterOnMapRotateZoom ()
Returns a boolean value indicating whether the transform center is applied on rotate and zoom
interactions. The default value is false.
Returns:
True if transform center is fixed during zoom, False otherwise.
public abstract boolean isKineticFlickEnabled ()
Returns a boolean value indicating whether flick-to-scroll (with kinetic momentum) is enabled for the
MapGesture . By default, this value is set to true.
Returns:
True if kinetic flick is enabled, false otherwise
public abstract boolean isKineticPinchEnabled ()
Deprecated: As of release 2.0.
This gesture is disabled at all times.
Returns a boolean value indicating whether pinch (with kinetic momentum) is enabled for this
MapGesture . By default, this value is set to false.
Returns:
True if rotation flick is enabled, false otherwise
public abstract boolean isKineticRotationEnabled ()
Deprecated: As of release 2.0.
This gesture is disabled at all times.
Returns a boolean value indicating whether rotation (with kinetic momentum) is enabled for this
MapGesture . By default, this value is set to false.
Returns:
True if rotation flick is enabled, false otherwise.
public abstract boolean isLongPressEnabled ()
HERE SDK for Android Developer's Guide
► API Reference
365
Returns a boolean value indicating whether long-press is enabled for this MapGesture . By default,
this value is set to true.
Returns:
True if long-press is enabled, false otherwise
public abstract boolean isPanningEnabled ()
Returns a boolean value indicating whether panning is enabled for this MapGesture . By default, this
value is set to true.
Returns:
True if panning is enabled, false otherwise
public abstract boolean isPinchEnabled ()
Returns a boolean value indicating whether pinch is enabled for this MapGesture . By default, this
value is set to true.
Returns:
True if pinch is enabled, false otherwise
public abstract boolean isRotateEnabled ()
Returns a boolean value indicating whether two-finger rotation is enabled for this MapGesture . By
default, this value is set to true.
Returns:
True if rotate is enabled, false otherwise
public abstract boolean isSingleTapEnabled ()
Returns a boolean value indicating whether single-tap is enabled for this MapGesture . By default,
this value is set to true.
Returns:
True if single-tap is enabled, false otherwise
HERE SDK for Android Developer's Guide
► API Reference
366
public abstract boolean isTiltEnabled ()
Returns a boolean value indicating whether tilt is enabled for this MapGesture . By default, this value
is set to true.
Returns:
True if tilt is enabled, false otherwise
public abstract boolean isTwoFingerPanningEnabled ()
Returns a boolean value indicating whether two-finger panning interactions are enabled for this
MapGesture . By default, this value is set to true.
Returns:
A boolean true if enabled, false if disabled.
public abstract boolean isTwoFingerPinchRotateEnabled ()
Deprecated: As of release 2.0.
This gesture is disabled at all times.
Returns a boolean value indicating whether the two-finger pinch-and-rotate interaction is enabled for
this MapGesture . By default, this value is set to true.
Returns:
true if enabled, false if disabled.
public abstract boolean isTwoFingerTapEnabled ()
Returns a boolean value indicating whether two-finger tap is enabled for this MapGesture . By
default, this value is set to true.
Returns:
True if two-finger tap is enabled, false otherwise
public abstract void removeOnGestureListener (MapGesture.OnGestureListener
listener)
HERE SDK for Android Developer's Guide
► API Reference
367
Removes an existing MapGesture.OnGestureListener. Call this method to free up application
resources when there's no longer any need to listen for map gesture events.
Parameters:
listener
A MapGesture.OnGestureListener to remove from this MapGesture
public abstract MapGesture setAllGesturesEnabled (boolean enabled)
Sets all possible kinds of gesture interaction to be either enabled or disabled for the MapGesture .
Parameters:
enabled
A boolean specifying whether all gestures are enabled
Returns:
The modified MapGesture itself.
public abstract MapGesture setDoubleTapEnabled (boolean enabled)
Sets whether double-tap interactions are enabled or disabled for this MapGesture .
Parameters:
enabled
A boolean specifying whether double-tap is enabled
Returns:
The modified MapGesture itself.
public abstract MapGesture setFixedMapCenterOnMapRotateZoom (boolean lock)
Sets whether the transform center is applied during multitouch gestures. If this value is enabled,
rotation and zoom will always be applied using the transform center, instead of a point relative the
touch interaction.
Parameters:
lock
Returns:
A boolean specifying whether transform center is fixed . Default is false
HERE SDK for Android Developer's Guide
► API Reference
368
The modified MapGesture itself.
public abstract MapGesture setKineticFlickEnabled (boolean enabled)
Sets whether flick-to-scroll (with kinetic momentum) interactions are enabled for this MapGesture .
Parameters:
enabled
A boolean specifying whether kinetic flick is enabled
Returns:
The modified MapGesture itself.
public abstract MapGesture setKineticPinchEnabled (boolean isEnabled)
Deprecated: As of release 2.0.
This gesture is disabled at all times.
Sets whether the pinch (with kinetic momentum) interaction is enabled or disabled for this
MapGesture .
Parameters:
isEnabled
A boolean specifying whether rotation flick is enabled
Returns:
The modified MapGesture itself.
public abstract MapGesture setKineticRotationEnabled (boolean enabled)
Deprecated: As of release 2.0.
This gesture is disabled at all times.
Sets whether the rotation (with kinetic momentum) interaction is enabled or disabled for this
MapGesture .
Parameters:
enabled
Returns:
A boolean specifying whether rotation flick is enabled
HERE SDK for Android Developer's Guide
► API Reference
369
The modified MapGesture itself.
public abstract MapGesture setLongPressEnabled (boolean enabled)
Sets whether long-press interactions are enabled or disabled for this MapGesture .
Parameters:
enabled
A boolean specifying whether long-press is enabled
Returns:
The modified MapGesture itself.
public abstract MapGesture setPanningEnabled (boolean enabled)
Sets panning interactions to be either enabled or disabled for this MapGesture . Note that when
panning is disabled, kinetic panning will also be blocked, even if it is enabled.
Parameters:
enabled
A boolean specifying whether panning is enabled
Returns:
The modified MapGesture itself.
public abstract MapGesture setPinchEnabled (boolean enabled)
Sets whether pinch interactions are enabled or disabled for this MapGesture .
Parameters:
enabled
A boolean specifying whether pinch is enabled
Returns:
The modified MapGesture itself.
public abstract MapGesture setRotateEnabled (boolean enabled)
Sets whether two-finger rotate interactions are enabled for this MapGesture .
HERE SDK for Android Developer's Guide
► API Reference
370
Parameters:
enabled
A boolean specifying whether rotate is enabled
Returns:
The modified MapGesture itself.
public abstract MapGesture setSingleTapEnabled (boolean enabled)
Sets whether single-tap interactions are enabled or disabled for this MapGesture .
Parameters:
enabled
A boolean specifying whether single-tap is enabled
Returns:
The modified MapGesture itself.
public abstract MapGesture setTiltEnabled (boolean enabled)
Sets whether tilt interactions are enabled or disabled for this MapGesture .
Parameters:
enabled
A boolean specifying whether tilt is enabled
Returns:
The modified MapGesture itself.
public abstract MapGesture setTwoFingerPanningEnabled (boolean enable)
Sets whether the two-finger panning interaction is enabled for this MapGesture .
Parameters:
enable
True if two finger panning will be enabled (default). False if two-finger panning will not be enabled.
Returns:
The modified MapGesture itself.
HERE SDK for Android Developer's Guide
► API Reference
371
public abstract MapGesture setTwoFingerPinchRotateEnabled (boolean enable)
Deprecated: As of release 2.0.
This gesture is disabled at all times.
Sets whether the two-finger pinch-and-rotate interaction is enabled for this MapGesture . If true,
pinch and rotate can happen concurrently. If false, they will be made mutually exclusive.
Parameters:
enable
true if two finger pinch an rotate will be enabled; false if two finger pinch
and rotate will not be enabled.
Returns:
The modified MapGesture itself.
public abstract MapGesture setTwoFingerTapEnabled (boolean enabled)
Sets whether two-finger tap gestures are enabled or disabled for this MapGesture .
Parameters:
enabled
A boolean specifying whether two-finger tap is enabled
Returns:
The modified MapGesture itself.
OnGestureListener
The interface OnGestureListener is a member of com.here.android.mpa.mapping.MapGesture .
Interface Summary
public static abstract interface MapGesture.OnGestureListener
Event Listener interface for gesture events.
[For complete information, see the section Interface Details]
HERE SDK for Android Developer's Guide
► API Reference
Nested Class Summary
Table 128: Nested Classes in OnGestureListener
Nested Classes
public static abstract class
MapGesture.OnGestureListener.OnGestureListenerAdapter
Default implementation for the OnGestureListener interface.
Method Summary
Table 129: Methods in OnGestureListener
Methods
public abstract boolean
onDoubleTapEvent (PointF p)
A callback indicating that a user has performed a double tap gesture on a map.
public abstract boolean
onLongPressEvent (PointF p)
A callback indicating that a user has performed a long-press gesture on a map.
public abstract void
onLongPressRelease ()
A callback indicating that a user has released a long-press gesture on a map.
public abstract boolean onMapObjectsSelected (java.util.List
<com.here.android.mpa.common.ViewObject> objects)
A callback indicating that at least one ViewObject has been selected as a result of a user tapping on the map.
public abstract void
onMultiFingerManipulationEnd ()
A callback indicating the user has removed all or all-except-one fingers from the screen.
public abstract void
onMultiFingerManipulationStart ()
A callback indicating the user has put more than one finger onto the screen.
public abstract void
onPanEnd ()
A callback indicating the user has lifted up their finger and stopped panning.
public abstract void
onPanStart ()
A callback indicating the user has put one finger on the screen and moved their finger to trigger panning.
public abstract void
onPinchLocked ()
A callback indicating that a user has pinched enough to be recognized as the two-finger zoom gesture.
public abstract boolean
onPinchZoomEvent (float scaleFactor, PointF p)
A callback indicating that a user has performed a pinch-to-zoom gesture on a map.
372
HERE SDK for Android Developer's Guide
► API Reference
373
Methods
public abstract boolean
onRotateEvent (float rotateAngle)
A callback indicating that a user has performed a rotate gesture on a map.
public abstract void
onRotateLocked ()
A callback indicating that a user has rotated enough to be recognized as the two-finger rotation gesture.
public abstract boolean
onTapEvent (PointF p)
A callback indicating that a user has performed a single-tap gesture on a map.
public abstract boolean
onTiltEvent (float angle)
A callback indicating that a user has performed a two-finger-tilt gesture on a map.
public abstract boolean
onTwoFingerTapEvent (PointF p)
A callback indicating that a user has performed a two-finger tap gesture on a map.
Interface Details
Event Listener interface for gesture events. Please use MapGesture.OnGestureListener if all events
are necessary and MapGesture.OnGestureListener.OnGestureListenerAdapter if some events are
required. This interface can be added via addOnGestureListener(OnGestureListener) and removed via
removeOnGestureListener(OnGestureListener). Please see MapGesture for a full set of configurable
APIs.
Method Details
public abstract boolean onDoubleTapEvent (PointF p)
A callback indicating that a user has performed a double tap gesture on a map.
Parameters:
p
A PointF representing the on-screen point of the double-tap gesture
Returns:
True if consumed (which prevents the default map zoom-in behavior), false otherwise
public abstract boolean onLongPressEvent (PointF p)
A callback indicating that a user has performed a long-press gesture on a map.
HERE SDK for Android Developer's Guide
► API Reference
374
If a MapMarker with dragging enabled is located at the same location, returning true for this method
will nullify that setting.
Parameters:
p
A PointF representing the on-screen point where a user has long-pressed
Returns:
True if consumed (which prevents the default map move-to-here behavior), false otherwise
See also:
mapping.MapMarker.setDraggable (boolean)
public abstract void onLongPressRelease ()
A callback indicating that a user has released a long-press gesture on a map.
This callback may also occur when the user has panned around the map.
public abstract boolean onMapObjectsSelected (java.util.List
<com.here.android.mpa.common.ViewObject> objects)
A callback indicating that at least one ViewObject has been selected as a result of a user tapping on
the map.
If the user tapping on the map results in ViewObject selection (there are selectable objects located at
the tap point), this callback will be made after onTapEvent(PointF), if and only if, false is returned
for that callback.
Parameters:
objects
A list of selected ViewObject objects
Returns:
true if consumed, false otherwise
See also:
mapping.Map.getSelectedObjectsNearby (PointF)
public abstract void onMultiFingerManipulationEnd ()
HERE SDK for Android Developer's Guide
► API Reference
A callback indicating the user has removed all or all-except-one fingers from the screen.
public abstract void onMultiFingerManipulationStart ()
A callback indicating the user has put more than one finger onto the screen. Pinch, Rotate or Tilt
manipulation events may also be called back.
See also:
mapping.MapGesture.OnGestureListener.onTiltEvent (float)
mapping.MapGesture.OnGestureListener.onRotateEvent (float)
mapping.MapGesture.OnGestureListener.onPinchZoomEvent (float, PointF)
public abstract void onPanEnd ()
A callback indicating the user has lifted up their finger and stopped panning.
public abstract void onPanStart ()
A callback indicating the user has put one finger on the screen and moved their finger to trigger
panning.
public abstract void onPinchLocked ()
A callback indicating that a user has pinched enough to be recognized as the two-finger
zoom gesture. This callback will only occur if MapGesture is set to exclusive mode from
setTwoFingerPinchRotateEnabled(boolean)
See also:
mapping.MapGesture.setTwoFingerPinchRotateEnabled (boolean)
public abstract boolean onPinchZoomEvent (float scaleFactor, PointF p)
A callback indicating that a user has performed a pinch-to-zoom gesture on a map.
Parameters:
375
HERE SDK for Android Developer's Guide
► API Reference
376
scaleFactor
A scale factor relative to the points of the two simultaneous touches at separate screen coordinates
p
A PointF representing the on-screen point of the pinch gesture
Returns:
True if consumed (which prevents the default map zoom-in or zoom-out behavior), false otherwise
public abstract boolean onRotateEvent (float rotateAngle)
A callback indicating that a user has performed a rotate gesture on a map.
Parameters:
rotateAngle
An angle, in degrees, of the user interaction gesture since its last change
Returns:
True if consumed (which prevents the default map rotate-to-here behavior), false otherwise
public abstract void onRotateLocked ()
A callback indicating that a user has rotated enough to be recognized as the two-finger
rotation gesture. This callback will only occur if MapGesture is set to exclusive mode from
setTwoFingerPinchRotateEnabled(boolean)
See also:
mapping.MapGesture.setTwoFingerPinchRotateEnabled (boolean)
public abstract boolean onTapEvent (PointF p)
A callback indicating that a user has performed a single-tap gesture on a map.
If true is returned from this callback, no onMapObjectsSelected(List) callback will be made to any
gesture subscribers even if any objects are found at the screen point.
Parameters:
p
Returns:
A PointF representing the on-screen point of the single-tap gesture
HERE SDK for Android Developer's Guide
► API Reference
377
true if consumed (which prevents the default pan-to-here behavior), false otherwise.
See also:
mapping.Map.getSelectedObjectsNearby (PointF)
public abstract boolean onTiltEvent (float angle)
A callback indicating that a user has performed a two-finger-tilt gesture on a map.
Parameters:
angle
An angle, in degrees between the range of the minimum and maximum angle
inclusively, to which the map tilt will change. The minimum and maximum angle can be retrieved thru the calls getMinTilt() and getMaxTilt().
Returns:
True if consumed (which prevents the default map tilt-to-here behavior), false otherwise
See also:
mapping.Map.getMaxTilt ()
mapping.Map.getMinTilt ()
public abstract boolean onTwoFingerTapEvent (PointF p)
A callback indicating that a user has performed a two-finger tap gesture on a map.
Parameters:
p
A PointF representing the on-screen point where the two-finger tap occurred
Returns:
True if consumed (which prevents the default map zoom-out behavior), false otherwise
OnGestureListenerAdapter
The class OnGestureListenerAdapter is a member of
com.here.android.mpa.mapping.MapGesture.OnGestureListener .
HERE SDK for Android Developer's Guide
► API Reference
378
Class Summary
public static abstract class MapGesture.OnGestureListener.OnGestureListenerAdapter
implements com.here.android.mpa.mapping.MapGesture.OnGestureListener
extends java.lang.Object
Default implementation for the OnGestureListener interface.
[For complete information, see the section Class Details]
See also:
Constructor Summary
Table 130: Constructors in OnGestureListenerAdapter
Constructors
OnGestureListenerAdapter ()
Method Summary
Table 131: Methods in OnGestureListenerAdapter
Methods
public boolean
onDoubleTapEvent (PointF p)
A callback indicating that a user has performed a double tap gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onDoubleTapEvent(PointF)
public boolean
onLongPressEvent (PointF p)
A callback indicating that a user has performed a long-press gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onLongPressEvent(PointF)
public void
onLongPressRelease ()
A callback indicating that a user has released a long-press gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onLongPressRelease(void)
public boolean
objects)
onMapObjectsSelected (java.util.List <com.here.android.mpa.common.ViewObject>
A callback indicating that at least one ViewObject has been selected as a result of a user tapping on the map.
This method overrides mapping.MapGesture.OnGestureListener.onMapObjectsSelected(List)
HERE SDK for Android Developer's Guide
► API Reference
Methods
public void
onMultiFingerManipulationEnd ()
A callback indicating the user has removed all or all-except-one fingers from the screen.
This method overrides mapping.MapGesture.OnGestureListener.onMultiFingerManipulationEnd(void)
public void
onMultiFingerManipulationStart ()
A callback indicating the user has put more than one finger onto the screen.
This method overrides mapping.MapGesture.OnGestureListener.onMultiFingerManipulationStart(void)
public void
onPanEnd ()
A callback indicating the user has lifted up their finger and stopped panning.
This method overrides mapping.MapGesture.OnGestureListener.onPanEnd(void)
public void
onPanStart ()
A callback indicating the user has put one finger on the screen and moved their finger to trigger panning.
This method overrides mapping.MapGesture.OnGestureListener.onPanStart(void)
public void
onPinchLocked ()
A callback indicating that a user has pinched enough to be recognized as the two-finger zoom gesture.
This method overrides mapping.MapGesture.OnGestureListener.onPinchLocked(void)
public boolean
onPinchZoomEvent (float scaleFactor, PointF p)
A callback indicating that a user has performed a pinch-to-zoom gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onPinchZoomEvent(float, PointF)
public boolean
onRotateEvent (float rotateAngle)
A callback indicating that a user has performed a rotate gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onRotateEvent(float)
public void
onRotateLocked ()
A callback indicating that a user has rotated enough to be recognized as the two-finger rotation gesture.
This method overrides mapping.MapGesture.OnGestureListener.onRotateLocked(void)
public boolean
onTapEvent (PointF p)
A callback indicating that a user has performed a single-tap gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onTapEvent(PointF)
public boolean
onTiltEvent (float angle)
A callback indicating that a user has performed a two-finger-tilt gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onTiltEvent(float)
public boolean
onTwoFingerTapEvent (PointF p)
379
HERE SDK for Android Developer's Guide
► API Reference
380
Methods
A callback indicating that a user has performed a two-finger tap gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onTwoFingerTapEvent(PointF)
Class Details
Default implementation for the OnGestureListener interface. Users may use this abstract class and
overload specific methods to have a smaller code footprint.
See also:
Constructor Details
OnGestureListenerAdapter ()
Method Details
public boolean onDoubleTapEvent (PointF p)
A callback indicating that a user has performed a double tap gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onDoubleTapEvent(PointF)
Parameters:
p
public boolean onLongPressEvent (PointF p)
A callback indicating that a user has performed a long-press gesture on a map.
If a MapMarker with dragging enabled is located at the same location, returning true for this method
will nullify that setting.
This method overrides mapping.MapGesture.OnGestureListener.onLongPressEvent(PointF)
Parameters:
p
HERE SDK for Android Developer's Guide
► API Reference
381
public void onLongPressRelease ()
A callback indicating that a user has released a long-press gesture on a map.
This callback may also occur when the user has panned around the map.
This method overrides mapping.MapGesture.OnGestureListener.onLongPressRelease(void)
public boolean onMapObjectsSelected (java.util.List
<com.here.android.mpa.common.ViewObject> objects)
A callback indicating that at least one ViewObject has been selected as a result of a user tapping on
the map.
If the user tapping on the map results in ViewObject selection (there are selectable objects located at
the tap point), this callback will be made after onTapEvent(PointF), if and only if, false is returned
for that callback.
This method overrides mapping.MapGesture.OnGestureListener.onMapObjectsSelected(List)
Parameters:
objects
public void onMultiFingerManipulationEnd ()
A callback indicating the user has removed all or all-except-one fingers from the screen.
This method overrides mapping.MapGesture.OnGestureListener.onMultiFingerManipulationEnd(void)
public void onMultiFingerManipulationStart ()
A callback indicating the user has put more than one finger onto the screen. Pinch, Rotate or Tilt
manipulation events may also be called back.
This method overrides mapping.MapGesture.OnGestureListener.onMultiFingerManipulationStart(void)
public void onPanEnd ()
A callback indicating the user has lifted up their finger and stopped panning.
This method overrides mapping.MapGesture.OnGestureListener.onPanEnd(void)
HERE SDK for Android Developer's Guide
► API Reference
382
public void onPanStart ()
A callback indicating the user has put one finger on the screen and moved their finger to trigger
panning.
This method overrides mapping.MapGesture.OnGestureListener.onPanStart(void)
public void onPinchLocked ()
A callback indicating that a user has pinched enough to be recognized as the two-finger
zoom gesture. This callback will only occur if MapGesture is set to exclusive mode from
setTwoFingerPinchRotateEnabled(boolean)
This method overrides mapping.MapGesture.OnGestureListener.onPinchLocked(void)
public boolean onPinchZoomEvent (float scaleFactor, PointF p)
A callback indicating that a user has performed a pinch-to-zoom gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onPinchZoomEvent(float, PointF)
Parameters:
scaleFactor
p
public boolean onRotateEvent (float rotateAngle)
A callback indicating that a user has performed a rotate gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onRotateEvent(float)
Parameters:
rotateAngle
public void onRotateLocked ()
A callback indicating that a user has rotated enough to be recognized as the two-finger
rotation gesture. This callback will only occur if MapGesture is set to exclusive mode from
setTwoFingerPinchRotateEnabled(boolean)
HERE SDK for Android Developer's Guide
► API Reference
383
This method overrides mapping.MapGesture.OnGestureListener.onRotateLocked(void)
public boolean onTapEvent (PointF p)
A callback indicating that a user has performed a single-tap gesture on a map.
If true is returned from this callback, no onMapObjectsSelected(List) callback will be made to any
gesture subscribers even if any objects are found at the screen point.
This method overrides mapping.MapGesture.OnGestureListener.onTapEvent(PointF)
Parameters:
p
public boolean onTiltEvent (float angle)
A callback indicating that a user has performed a two-finger-tilt gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onTiltEvent(float)
Parameters:
angle
public boolean onTwoFingerTapEvent (PointF p)
A callback indicating that a user has performed a two-finger tap gesture on a map.
This method overrides mapping.MapGesture.OnGestureListener.onTwoFingerTapEvent(PointF)
Parameters:
p
MapLabeledMarker
The class MapLabeledMarker is a member of com.here.android.mpa.mapping .
HERE SDK for Android Developer's Guide
► API Reference
Class Summary
public final class MapLabeledMarker
extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
This class represents a labeled icon on the Map.
[For complete information, see the section Class Details]
Constructor Summary
Table 132: Constructors in MapLabeledMarker
Constructors
MapLabeledMarker (GeoCoordinate loc)
Creates a MapLabeledMarker at a specific GeoCoordinate with a default POI icon.
MapLabeledMarker (GeoCoordinate loc, Image icon)
Creates a MapLabeledMarker at a specific GeoCoordinate with the specified Image.
Method Summary
Table 133: Methods in MapLabeledMarker
Methods
public PointF
getAnchorPoint ()
Returns the anchor point for this MapLabeledMarker .
public GeoCoordinate
getCoordinate ()
Returns the current GeoCoordinate for this MapLabeledMarker .
public float
getFontScalingFactor ()
This method get the current font scaling factor applied to draw the fonts.
public String
getLabelText (String marcCode)
This method retrieves the localized text of the MapLabeledMarker .
public float
getTransparency ()
Gets the current transparency for the icon.
public boolean
isDeclutteringEnabled ()
This method queries if the icon decluttering is enabled.
384
HERE SDK for Android Developer's Guide
► API Reference
385
Methods
public boolean
isFadingAnimationEnabled ()
This method queries whether fading animation is enabled for the label.
public boolean
isOverlappingEnabled ()
This method queries if icons can be rendered overlapping the labels in the map if they share a common screen area.
public MapLabeledMarker
setAnchorPoint (PointF anchor)
Sets an anchor point for this MapLabeledMarker .
public MapLabeledMarker
setCoordinate (GeoCoordinate value)
Sets a GeoCoordinate for this MapLabeledMarker .
public MapLabeledMarker
setDeclutteringEnabled (boolean enabled)
This method enables or disables decluttering in tilted view.
public MapLabeledMarker
setFadingAnimationEnabled (boolean enabled)
This method enables or disables fading animation for the label.
public MapLabeledMarker
setFontScalingFactor (float value)
This method set the new font scaling factor will be applied to draw the fonts.
public MapLabeledMarker
setIcon (IconCategory value)
Sets this MapLabeledMarker to use the default places category icon of the specified IconCategory.
public MapLabeledMarker
setIcon (Image icon)
Sets an icon image for this MapLabeledMarker .
public MapLabeledMarker
setLabelText (String marcCode, String text)
This method sets the localized text of the MapLabeledMarker .
public MapLabeledMarker
setOverlappingEnabled (boolean enabled)
This method enables or disables labels rendered later in the map to overlap on the icon if they share a common screen area.
public MapLabeledMarker
setTransparency (float value)
Sets a transparency level, within the range of [0..1], for the icon.
Class Details
This class represents a labeled icon on the Map.
Different from MapMarkers, the MapLabeledMarker s avoid overlapping with other user-defined
labeled icons as well as built-in icons and texts on the map. It provides the possibility of using builtin POI icons by specifying a com.here.android.map.common.IconCategory or using an Image. One can
HERE SDK for Android Developer's Guide
► API Reference
386
specify multilingual texts to the icon. Depending on the current language and secondary language of
Map , different language of text can be displayed.
Constructor Details
MapLabeledMarker (GeoCoordinate loc)
Creates a MapLabeledMarker at a specific GeoCoordinate with a default POI icon.
Parameters:
loc
A GeoCoordinate representing this marker's location.
MapLabeledMarker (GeoCoordinate loc, Image icon)
Creates a MapLabeledMarker at a specific GeoCoordinate with the specified Image.
Parameters:
loc
A GeoCoordinate representing this marker's location.
icon
An Image representing this marker's icon.
Method Details
public PointF getAnchorPoint ()
Returns the anchor point for this MapLabeledMarker .
The marker is drawn with the specified pixel offset from its getCoordinate() position. To clear an
anchor set previously, pass a PointF to this method with an X-coordinate equal to half the width of
the marker and a Y-coordinate equal to half the height of the marker.
By default, there is no offset and the MapLabeledMarker is centered in the center of the icon
image.
public GeoCoordinate getCoordinate ()
Returns the current GeoCoordinate for this MapLabeledMarker .
Returns:
HERE SDK for Android Developer's Guide
► API Reference
387
The current GeoCoordinate location
public float getFontScalingFactor ()
This method get the current font scaling factor applied to draw the fonts.
Returns:
A float value representing the current font factor. If the value cannot be retrieved, returns -1.
public String getLabelText (String marcCode)
This method retrieves the localized text of the MapLabeledMarker .
Parameters:
marcCode
The international MARC code describing the language of the text. Case-insensitive.
Returns:
The text for the marker corresponds to the language MARC code.
See also:
http://www.loc.gov/marc/languages for list of valid marc codes.
public float getTransparency ()
Gets the current transparency for the icon.
The transparency level is only precise to two decimal places due to numerical operations performed
internally when rendering the map.
Returns:
The current transparency of the icon
public boolean isDeclutteringEnabled ()
This method queries if the icon decluttering is enabled.
Returns:
true if the decluttering is enabled. Otherwise returns false.
HERE SDK for Android Developer's Guide
► API Reference
388
public boolean isFadingAnimationEnabled ()
This method queries whether fading animation is enabled for the label.
Returns:
true if fading animation is enabled, false otherwise.
public boolean isOverlappingEnabled ()
This method queries if icons can be rendered overlapping the labels in the map if they share a
common screen area.
Returns:
true if icon overlapping is enabled, false otherwise.
public MapLabeledMarker setAnchorPoint (PointF anchor)
Sets an anchor point for this MapLabeledMarker .
The marker is drawn with the specified pixel offset from its getCoordinate() position. To clear an
anchor set previously, pass a PointF to this method with an X-coordinate equal to half the width of
the marker and a Y-coordinate equal to half the height of the marker.
By default, there is no offset and the MapLabeledMarker is centered in the center of the icon
image.
Parameters:
anchor
A PointF relative to the top-left corner of the MapLabeledMarker.
Returns:
The updated MapLabeledMarker itself.
public MapLabeledMarker setCoordinate (GeoCoordinate value)
Sets a GeoCoordinate for this MapLabeledMarker .
Parameters:
value
Desired GeoCoordinate location for this marker.
HERE SDK for Android Developer's Guide
► API Reference
389
Returns:
The updated MapLabeledMarker itself.
public MapLabeledMarker setDeclutteringEnabled (boolean enabled)
This method enables or disables decluttering in tilted view. By enabling this, icons will not be shown
when they are faraway in tilted view. By default, decluttering is disabled.
Parameters:
enabled
true means enabling icon decluttering.
Returns:
The updated MapLabeledMarker itself.
public MapLabeledMarker setFadingAnimationEnabled (boolean enabled)
This method enables or disables fading animation for the label. However, the fading animation
set using setFadingAnimations(boolean) takes priority over this setting. For example, if the fading
animation is disabled for the Map, which contains the label, the fading will be also disabled for the
label regardless the state set to this label.
Fading animation is enabled by default.
Parameters:
enabled
true to enable fading animation.
Returns:
The updated MapLabeledMarker itself.
public MapLabeledMarker setFontScalingFactor (float value)
This method set the new font scaling factor will be applied to draw the fonts.
Parameters:
value
A floating point value representing the new font factor. Valid values must be
between 1.0 and 2.0.
HERE SDK for Android Developer's Guide
► API Reference
390
Returns:
The updated MapLabeledMarker itself.
public MapLabeledMarker setIcon (IconCategory value)
Sets this MapLabeledMarker to use the default places category icon of the specified IconCategory.
If no icon is available for the specified IconCategory , a default icon will be used.
Parameters:
value
An IconCategory of the icon to be used for the marker.
Returns:
The updated MapLabeledMarker itself.
public MapLabeledMarker setIcon (Image icon)
Sets an icon image for this MapLabeledMarker .
Parameters:
icon
An Image representing this marker's icon
Returns:
The updated MapLabeledMarker itself.
public MapLabeledMarker setLabelText (String marcCode, String text)
This method sets the localized text of the MapLabeledMarker . If there is an existing localization
for the specified language, the existing one will be replaced. Otherwise, the new localized text will be
stored. When text is an empty string, the existing localized text, if any, will be removed.
If the text contains any glyphs, which are currently not supported by the fonts shipped with the
library, those glyphs will not be displayed.
Parameters:
marcCode
The international MARC code describing the language of the text. Case-insensitive.
HERE SDK for Android Developer's Guide
► API Reference
text
391
The text for the marker in the language described by the marcCode.
Returns:
The updated MapLabeledMarker itself.
See also:
http://www.loc.gov/marc/languages for list of valid marc codes.
public MapLabeledMarker setOverlappingEnabled (boolean enabled)
This method enables or disables labels rendered later in the map to overlap on the icon if they share
a common screen area. By default, overlapping is enabled.
Parameters:
enabled
true to enable icon overlapping, false otherwise.
Returns:
The updated MapLabeledMarker itself.
public MapLabeledMarker setTransparency (float value)
Sets a transparency level, within the range of [0..1], for the icon. By default, transparency level is 1.
Parameters:
value
Returns:
The updated MapLabeledMarker itself.
MapLocalModel
The class MapLocalModel is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapLocalModel
HERE SDK for Android Developer's Guide
► API Reference
extends com.here.android.mpa.mapping.MapModelObject,
com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
Represents a relative local coordinate mesh displayed on a map.
[For complete information, see the section Class Details]
See also:
Constructor Summary
Table 134: Constructors in MapLocalModel
Constructors
MapLocalModel ()
Creates a MapLocalModel .
Method Summary
Table 135: Methods in MapLocalModel
Methods
public GeoCoordinate
getAnchor ()
Gets the GeoCoordinate representing the anchor that is currently associated with the MapLocalModel .
public LocalMesh
getMesh ()
Gets the LocalMesh currently associated with the MapLocalModel .
public float
getPitch ()
Gets the current pitch of the MapLocalModel .
public float
getRoll ()
Gets the current roll or the MapLocalModel .
public float
getScale ()
Gets the current scaling factor for the LocalMesh.
public Image
getTexture ()
Gets the current texture Image of the MapLocalModel .
392
HERE SDK for Android Developer's Guide
► API Reference
393
Methods
public float
getYaw ()
Gets the current yaw of the MapLocalModel .
public boolean
isDynamicScalingEnabled ()
Gets the boolean indicating whether dynamic scaling is enabled for the MapLocalModel .
public MapLocalModel
setAnchor (GeoCoordinate anchor)
Sets an anchor GeoCoordinate for the MapLocalModel .
public MapLocalModel
setDynamicScalingEnabled (boolean enable)
Sets dynamic scaling to be either enabled or disabled for the MapLocalModel .
public MapLocalModel
setMesh (LocalMesh mesh)
Sets a LocalMesh for the MapLocalModel
public MapLocalModel
setPitch (float angle)
Sets a pitch value for the MapLocalModel .
public MapLocalModel
setRoll (float angle)
Sets a roll value for the MapLocalModel .
public MapLocalModel
setScale (float scale)
Sets a scaling factor used to scale the size of the LocalMesh.
public MapLocalModel
setTexture (Image texture)
Sets a texture Image for the MapLocalModel .
public MapLocalModel
setYaw (float angle)
Sets a yaw value for the MapLocalModel .
Class Details
Represents a relative local coordinate mesh displayed on a map. The format for the mesh is
interpreted as an array of float offsets relative to the anchor, which itself specifies the center base
of the objects.
A unit of 1.0f represents 1 meter in the real world. For example, a Vector3f( 100, 200, 300 )
represents a point offset by 100 meters in the x-axis direction (east), 200 meters in the y-axis
direction (north), and 300 meters in the z-axis direction (up), all relative to the anchor.
Note: a MapLocalModel object can be augmented by specifying additional attributes such as scale,
scale style, or rotation.
HERE SDK for Android Developer's Guide
► API Reference
See also:
Constructor Details
MapLocalModel ()
Creates a MapLocalModel .
Method Details
public GeoCoordinate getAnchor ()
Gets the GeoCoordinate representing the anchor that is currently associated with the
MapLocalModel .
Returns:
The GeoCoordinate
public LocalMesh getMesh ()
Gets the LocalMesh currently associated with the MapLocalModel .
Returns:
The LocalMesh
public float getPitch ()
Gets the current pitch of the MapLocalModel .
Returns:
The current pitch in degrees
public float getRoll ()
Gets the current roll or the MapLocalModel .
Returns:
394
HERE SDK for Android Developer's Guide
► API Reference
The current roll in degrees
public float getScale ()
Gets the current scaling factor for the LocalMesh.
Returns:
The current scaling factor
public Image getTexture ()
Gets the current texture Image of the MapLocalModel .
Returns:
The texture Image
public float getYaw ()
Gets the current yaw of the MapLocalModel .
Returns:
The current yaw in degrees
public boolean isDynamicScalingEnabled ()
Gets the boolean indicating whether dynamic scaling is enabled for the MapLocalModel .
Returns:
True if dynamic scaling is enabled, false otherwise
public MapLocalModel setAnchor (GeoCoordinate anchor)
Sets an anchor GeoCoordinate for the MapLocalModel .
Parameters:
anchor
Returns:
Desired GeoCoordinate
395
HERE SDK for Android Developer's Guide
► API Reference
The modified MapLocalModel itself.
public MapLocalModel setDynamicScalingEnabled (boolean enable)
Sets dynamic scaling to be either enabled or disabled for the MapLocalModel . When dynamic
scaling is enabled, the rendered size of the model on screen is constant regardless of the map's
zoom level.
Parameters:
enable
A boolean specifying whether dynamic scaling is enabled
Returns:
The modified MapLocalModel itself.
public MapLocalModel setMesh (LocalMesh mesh)
Sets a LocalMesh for the MapLocalModel
Parameters:
mesh
Desired LocalMesh
Returns:
The modified MapLocalModel itself.
public MapLocalModel setPitch (float angle)
Sets a pitch value for the MapLocalModel .
Parameters:
angle
Desired pitch in degrees
Returns:
The modified MapLocalModel itself.
public MapLocalModel setRoll (float angle)
396
HERE SDK for Android Developer's Guide
► API Reference
Sets a roll value for the MapLocalModel .
Parameters:
angle
Desired roll in degrees
Returns:
The modified
public MapLocalModel setScale (float scale)
Sets a scaling factor used to scale the size of the LocalMesh.
Parameters:
scale
Desired scaling factor
Returns:
The modified MapLocalModel itself.
public MapLocalModel setTexture (Image texture)
Sets a texture Image for the MapLocalModel .
Parameters:
texture
Desired texture Image
Returns:
The modified MapLocalModel itself.
public MapLocalModel setYaw (float angle)
Sets a yaw value for the MapLocalModel .
Parameters:
angle
Returns:
Desired yaw in degrees
397
HERE SDK for Android Developer's Guide
► API Reference
The modified MapLocalModel itself.
MapMarker
The class MapMarker is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapMarker
extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
Represents a marker used to display an icon at a geographical position on a map.
[For complete information, see the section Class Details]
Nested Class Summary
Table 136: Nested Classes in MapMarker
Nested Classes
public static abstract interface
MapMarker.OnDragListener
Callback interface for drag events on MapMarker objects.
Constructor Summary
Table 137: Constructors in MapMarker
Constructors
MapMarker ()
Creates a default MapMarker.
MapMarker (float hue)
Creates a default MapMarker.
MapMarker (GeoCoordinate coordinate, Image image)
Creates a MapMarker with a specified GeoCoordinate and Image.
398
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 138: Methods in MapMarker
Methods
public PointF
getAnchorPoint ()
Returns the anchor point for this MapMarker .
public GeoCoordinate
getCoordinate ()
Returns the current map GeoCoordinate for this MapMarker .
public String
getDescription ()
Gets the current description text.
public Image
getIcon ()
Returns the icon image for this MapMarker .
public int
getInfoBubbleHashCode ()
Returns non-zero hash code of the info bubble if it is showing.
public float
getSvgIconScaling ()
Get the scaling factor for markers using SVG Image .
public String
getTitle ()
Gets the current title to be used by the default info bubble.
public float
getTransparency ()
Gets the current transparency for the icon
public void
hideInfoBubble ()
Hides the info bubble if it's currently showing.
public boolean
isDeclutteringEnabled ()
This method queries if the icon decluttering is enabled.
public boolean
isDraggable ()
Returns a boolean indicating whether the marker is draggable.
public boolean
isInfoBubbleVisible ()
Returns a boolean indicating if the info bubble is currently displayed on this marker.
public MapMarker
setAnchorPoint (PointF anchor)
Sets an anchor point for this MapMarker .
public MapMarker
setCoordinate (GeoCoordinate coordinate)
399
HERE SDK for Android Developer's Guide
► API Reference
400
Methods
Sets a map GeoCoordinate for this MapMarker .
public MapMarker
setDeclutteringEnabled (boolean enabled)
This method enables or disables decluttering in tilted view.
public MapMarker
setDescription (String description)
Sets the description text.
public MapMarker
setDraggable (boolean isDraggable)
Sets whether this marker is draggable or not.
public MapMarker
setIcon (Image icon)
Sets an icon image for this MapMarker .
public void
setSvgIconScaling (float scale)
Set a scaling factor for markers using SVG Image .
public MapMarker
setTitle (String title)
Sets a title to be used by the default info bubble.
public boolean
setTransparency (float alpha)
Sets a transparency level, within the range of [0..1], for the icon.
public void
showInfoBubble ()
Displays the default info bubble if setTitle(String) has been set to something non-null.
Class Details
Represents a marker used to display an icon at a geographical position on a map. The map handles
proper placement of icons on the screen as well as panning and rotation.
MapMarker objects can be selected by application users.
Constructor Details
MapMarker ()
Creates a default MapMarker. The marker will contain the default marker image.
See also:
mapping.MapMarker.MapMarker (float)
mapping.MapMarker.MapMarker (GeoCoordinate, Image)
HERE SDK for Android Developer's Guide
► API Reference
401
MapMarker (float hue)
Creates a default MapMarker. The marker will contain a colorization of the default marker image.
Parameters:
hue
The hue of the marker. Value must be greater or equal to 0 and less than
360.
See also:
mapping.MapMarker.MapMarker ()
mapping.MapMarker.MapMarker (GeoCoordinate, Image)
MapMarker (GeoCoordinate coordinate, Image image)
Creates a MapMarker with a specified GeoCoordinate and Image.
Parameters:
coordinate
A GeoCoordinate representing the map coordinates of the marker
image
An Image used to display the marker
See also:
mapping.MapMarker.MapMarker ()
mapping.MapMarker.MapMarker (float)
Method Details
public PointF getAnchorPoint ()
Returns the anchor point for this MapMarker .
The marker is drawn with the specified pixel offset from its getCoordinate() position. To clear an
anchor set previously, pass a PointF to this method with an X-coordinate equal to half the width of
the marker and a Y-coordinate equal to half the height of the marker.
By default, there is no offset and the MapMarker is centered in the center of the icon image.
HERE SDK for Android Developer's Guide
► API Reference
public GeoCoordinate getCoordinate ()
Returns the current map GeoCoordinate for this MapMarker .
Returns:
The current GeoCoordinate location
public String getDescription ()
Gets the current description text.
Returns:
The current description. Can be null if it has not been set.
public Image getIcon ()
Returns the icon image for this MapMarker .
Returns:
An Image representing this marker's icon
public int getInfoBubbleHashCode ()
Returns non-zero hash code of the info bubble if it is showing.
Use this hash code to compare against the hash code of the objects returned by
onMapObjectsSelected(List) to determine if object selected is an info bubble. If so, call
hideInfoBubble() to close the info bubble.
Returns:
The hash code of the info bubble that is visible. 0 if the info bubble is not showing.
See also:
mapping.MapGesture.OnGestureListener.onMapObjectsSelected (List)
public float getSvgIconScaling ()
Get the scaling factor for markers using SVG Image .
Returns:
402
HERE SDK for Android Developer's Guide
► API Reference
403
scale
public String getTitle ()
Gets the current title to be used by the default info bubble.
Returns:
The current title. Can be null if it has not been set.
public float getTransparency ()
Gets the current transparency for the icon
The transparency level is only precise to two decimal places due to numerical operations performed
internally when rendering the map.
Returns:
The current transparency of the icon
public void hideInfoBubble ()
Hides the info bubble if it's currently showing.
public boolean isDeclutteringEnabled ()
This method queries if the icon decluttering is enabled.
Returns:
True if the decluttering is enabled. Otherwise return false.
public boolean isDraggable ()
Returns a boolean indicating whether the marker is draggable.
Returns:
True if the marker is draggable, false otherwise.
public boolean isInfoBubbleVisible ()
HERE SDK for Android Developer's Guide
► API Reference
404
Returns a boolean indicating if the info bubble is currently displayed on this marker.
Returns:
True if the info bubble is displayed, false otherwise.
public MapMarker setAnchorPoint (PointF anchor)
Sets an anchor point for this MapMarker .
The marker is drawn with the specified pixel offset from its getCoordinate() position. To clear an
anchor set previously, pass a PointF to this method with an X-coordinate equal to half the width of
the marker and a Y-coordinate equal to half the height of the marker.
By default, there is no offset and the MapMarker is centered in the center of the icon image.
Parameters:
anchor
A PointF relative to the top-left corner of the MapMarker.
Returns:
The updated MapMarker itself.
public MapMarker setCoordinate (GeoCoordinate coordinate)
Sets a map GeoCoordinate for this MapMarker .
Parameters:
coordinate
Desired GeoCoordinate location for this marker
Returns:
The updated MapMarker itself.
public MapMarker setDeclutteringEnabled (boolean enabled)
This method enables or disables decluttering in tilted view. By enabling this, icons will not be shown
when they are faraway in tilted view. By default, decluttering is disabled.
Parameters:
enabled
true means enabling icon decluttering.
HERE SDK for Android Developer's Guide
► API Reference
405
Returns:
The updated MapMarker itself.
public MapMarker setDescription (String description)
Sets the description text. This will be shown below the title in normal typeface.
Parameters:
description
The description to be set.
Returns:
The updated MapMarker itself.
public MapMarker setDraggable (boolean isDraggable)
Sets whether this marker is draggable or not. By default, the marker is not draggable.
If any user overridden methods of onLongPressEvent(PointF) or onDoubleTapEvent(PointF) that is
registered with MapGesture returns true , the MapMarker will ignore any drag events even if the
marker is set to enable dragging.
Parameters:
isDraggable
true if the marker is draggable, false otherwise.
Returns:
The updated MapMarker itself.
See also:
public MapMarker setIcon (Image icon)
Sets an icon image for this MapMarker .
Parameters:
icon
Returns:
An Image representing this marker's icon
HERE SDK for Android Developer's Guide
► API Reference
406
The updated MapMarker itself.
public void setSvgIconScaling (float scale)
Set a scaling factor for markers using SVG Image .
Parameters:
scale
Scaling factor.
public MapMarker setTitle (String title)
Sets a title to be used by the default info bubble.
Parameters:
title
The title to set.
Returns:
The updated MapMarker itself.
public boolean setTransparency (float alpha)
Sets a transparency level, within the range of [0..1], for the icon.
Parameters:
alpha
Desired alpha value for the icon, 0 for fully transparent, 1 for fully opaque
(the default value is 1)
Returns:
True if successful, false otherwise.
public void showInfoBubble ()
Displays the default info bubble if setTitle(String) has been set to something non-null. This
method should be called only after the MapMarker is added onto a Map, otherwise making this
call would make no effects. As only one info bubble can be displayed on the map at a time, thus
HERE SDK for Android Developer's Guide
► API Reference
when calling showInfoBubble() on a different MapMarker , the current info bubble on display will
automatically be closed before the newly selected one is shown.
See also:
mapping.Map.addMapObject (MapObject)
mapping.Map.addMapObjects (java.util.List)
OnDragListener
The interface OnDragListener is a member of com.here.android.mpa.mapping.MapMarker .
Interface Summary
public static abstract interface MapMarker.OnDragListener
Callback interface for drag events on MapMarker objects.
[For complete information, see the section Interface Details]
Method Summary
Table 139: Methods in OnDragListener
Methods
public abstract void
onMarkerDrag (MapMarker marker)
Called repeatedly while a marker is being dragged.
public abstract void
onMarkerDragEnd (MapMarker marker)
Called when a marker has finished being dragged.
public abstract void
onMarkerDragStart (MapMarker marker)
Called when a marker starts being dragged.
Interface Details
Callback interface for drag events on MapMarker objects.
Method Details
public abstract void onMarkerDrag (MapMarker marker)
407
HERE SDK for Android Developer's Guide
► API Reference
408
Called repeatedly while a marker is being dragged. The MapMarker 's location can be accessed
through getCoordinate().
Parameters:
marker
The MapMarker that is being dragged.
public abstract void onMarkerDragEnd (MapMarker marker)
Called when a marker has finished being dragged. The MapMarker 's location can be accessed
through getCoordinate().
Parameters:
marker
The MapMarker that is being dragged.
public abstract void onMarkerDragStart (MapMarker marker)
Called when a marker starts being dragged. The MapMarker 's location can be accessed via
getCoordinate(). This position may be different to the position prior to the start of the drag because
the marker is popped up above the touch point.
Parameters:
marker
The MapMarker that is being dragged.
MapModelObject
The class MapModelObject is a member of com.here.android.mpa.mapping .
Class Summary
public class MapModelObject
extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
Base class for MapLocalModel and MapGeoModel.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
Nested Class Summary
Table 140: Nested Classes in MapModelObject
Nested Classes
public static final class
MapModelObject.DirectionalLight
This class specifies a directional light.
public static abstract interface
MapModelObject.Light
Base Interface for all Lights supported by MapModel This class will be extended in the new future with more methods.
public static abstract interface
MapModelObject.Material
Base Interface for all Materials supported by MapModel This class will be extended in future with more methods.
public static final class
MapModelObject.PhongMaterial
PhongMaterial is used for shading a model.
Constructor Summary
Table 141: Constructors in MapModelObject
Constructors
MapModelObject (MapModelObjectImpl impl)
Protected constructor.
Method Summary
Table 142: Methods in MapModelObject
Methods
public static int
ARGBToRGBA (int color)
Simple color converter.
public static int
RGBAToARGB (int color)
Simple color converter.
public boolean
addLight (MapModelObject.Light light)
Add a light to the object.
public MapModelObject.Light
Get an already added Light
getLight (int index)
409
HERE SDK for Android Developer's Guide
► API Reference
410
Methods
public MapModelObject.Material
getMaterial ()
Get the Material
public int
getNumLights ()
Get the number of lights.
public int
getNumberLightsSupported ()
Get the maximum number of lights supported.
public boolean
removeAllLights ()
Remove all lights from this model object.
public boolean
setLight (int index, MapModelObject.Light light)
Update the light for a particular light
public boolean
setMaterial (MapModelObject.Material material)
Set the Material
Class Details
Base class for MapLocalModel and MapGeoModel. This class provides additional functionalities to set
lighting and material properties to a model object.
Constructor Details
MapModelObject (MapModelObjectImpl impl)
Protected constructor.
Parameters:
impl
Method Details
public static int ARGBToRGBA (int color)
Simple color converter. Converts from ARGB to RGBA
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
color
public static int RGBAToARGB (int color)
Simple color converter. Converts from RRGB to ARGB
Parameters:
color
public boolean addLight (MapModelObject.Light light)
Add a light to the object.
Parameters:
light
New light to add.
Returns:
true if successful, false otherwise. Light#getNumberLightsSupported
public MapModelObject.Light getLight (int index)
Get an already added Light
Parameters:
index
Index of the light to get
Returns:
Light object if successful
public MapModelObject.Material getMaterial ()
Get the Material
Returns:
public int getNumLights ()
411
HERE SDK for Android Developer's Guide
► API Reference
Get the number of lights.
Returns:
int, number of lights.
public int getNumberLightsSupported ()
Get the maximum number of lights supported.
Returns:
int maximum light count.
public boolean removeAllLights ()
Remove all lights from this model object.
public boolean setLight (int index, MapModelObject.Light light)
Update the light for a particular light
Parameters:
index
Index of the light to update
light
Light object to update
Returns:
true if successful, false otherwise.
public boolean setMaterial (MapModelObject.Material material)
Set the Material
Parameters:
material
Returns:
boolean true if successful, false otherwise.
412
HERE SDK for Android Developer's Guide
► API Reference
DirectionalLight
The class DirectionalLight is a member of com.here.android.mpa.mapping.MapModelObject .
Class Summary
public static final class MapModelObject.DirectionalLight
implements com.here.android.mpa.mapping.MapModelObject.Light
extends java.lang.Object
This class specifies a directional light.
[For complete information, see the section Class Details]
Constructor Summary
Table 143: Constructors in DirectionalLight
Constructors
DirectionalLight ()
Default Constructor
DirectionalLight (Vector3f direction)
Construct a DirectionalLight
Method Summary
Table 144: Methods in DirectionalLight
Methods
public Vector3f
getSource ()
Get the directional light direction.
public void
setSource (Vector3f direction)
Set the directional light source.
Class Details
This class specifies a directional light.
413
HERE SDK for Android Developer's Guide
► API Reference
Constructor Details
DirectionalLight ()
Default Constructor
DirectionalLight (Vector3f direction)
Construct a DirectionalLight
Parameters:
direction
Method Details
public Vector3f getSource ()
Get the directional light direction.
Returns:
Vector3d vector containing the light direction.
public void setSource (Vector3f direction)
Set the directional light source. This will only take effect before the light is added.
Parameters:
direction
Light
The interface Light is a member of com.here.android.mpa.mapping.MapModelObject .
Interface Summary
public static abstract interface MapModelObject.Light
414
HERE SDK for Android Developer's Guide
► API Reference
415
Base Interface for all Lights supported by MapModel This class will be extended in the new future
with more methods.
[For complete information, see the section Interface Details]
Interface Details
Base Interface for all Lights supported by MapModel This class will be extended in the new future
with more methods.
Material
The interface Material is a member of com.here.android.mpa.mapping.MapModelObject .
Interface Summary
public static abstract interface MapModelObject.Material
Base Interface for all Materials supported by MapModel This class will be extended in future with
more methods.
[For complete information, see the section Interface Details]
Interface Details
Base Interface for all Materials supported by MapModel This class will be extended in future with
more methods.
PhongMaterial
The class PhongMaterial is a member of com.here.android.mpa.mapping.MapModelObject .
Class Summary
public static final class MapModelObject.PhongMaterial
implements com.here.android.mpa.mapping.MapModelObject.Material
extends java.lang.Object
PhongMaterial is used for shading a model.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
416
Constructor Summary
Table 145: Constructors in PhongMaterial
Constructors
PhongMaterial ()
Default constructor
PhongMaterial (int diffuseColor, int ambiantColor)
Field Summary
Table 146: Fields in PhongMaterial
Fields
public static final int
DEFAULT_AMBIANT_COLOR
public static final int
DEFAULT_DIFFUSE_COLOR
Method Summary
Table 147: Methods in PhongMaterial
Methods
public int
getAmbientColor ()
Get the Ambient Material color
public int
getDiffuseColor ()
Get the Diffuse Material color
public MapModelObject.PhongMaterial
setAmbientColor (int color)
Set the Ambient Material color
public MapModelObject.PhongMaterial
setDiffuseColor (int color)
Set the Diffuse Material color
Class Details
PhongMaterial is used for shading a model. This class can be used to change the transparency or
color of textured map models.
HERE SDK for Android Developer's Guide
► API Reference
Constructor Details
PhongMaterial ()
Default constructor
PhongMaterial (int diffuseColor, int ambiantColor)
Parameters:
diffuseColor
ambiantColor
Field Details
public static final int DEFAULT_AMBIANT_COLOR
public static final int DEFAULT_DIFFUSE_COLOR
Method Details
public int getAmbientColor ()
Get the Ambient Material color
Returns:
color Color The color format is in ARGB
public int getDiffuseColor ()
Get the Diffuse Material color
Returns:
color Color
public MapModelObject.PhongMaterial setAmbientColor (int color)
417
HERE SDK for Android Developer's Guide
► API Reference
Set the Ambient Material color
Parameters:
color
Color The color format is in ARGB
Returns:
PhongMatterial builder pattern.
public MapModelObject.PhongMaterial setDiffuseColor (int color)
Set the Diffuse Material color
Parameters:
color
Color
Returns:
PhongMatterial builder pattern.
MapObject
The class MapObject is a member of com.here.android.mpa.mapping .
Class Summary
public abstract class MapObject
extends com.here.android.mpa.common.ViewObject, java.lang.Object
Represents a base class for all map-related objects that users can add to a Map.
[For complete information, see the section Class Details]
Nested Class Summary
Table 148: Nested Classes in MapObject
Nested Classes
public static final enumeration
MapObject.Type
418
HERE SDK for Android Developer's Guide
► API Reference
Nested Classes
Represents values describing the types of MapObject objects that can be added to a Map.
Constructor Summary
Table 149: Constructors in MapObject
Constructors
MapObject (MapObjectImpl impl)
Method Summary
Table 150: Methods in MapObject
Methods
public MapOverlayType
getOverlayType ()
Returns the overlay in which this MapObject appears.
public MapContainer
getParent ()
Returns the parent of this MapObject .
public MapOverlayType
getReserveOverlayType ()
Returns the overlay in which this MapObject reserves screen space.
public MapObject.Type
getType ()
Returns the type of object that this MapObject represents.
public int
getZIndex ()
Returns the current z-index (stacking order) of this MapObject .
public boolean
isVisible ()
Determines whether this MapObject is visible on the map.
public MapObject
setOverlayType (MapOverlayType type)
Sets the display order in which this MapObject appears relating to other layers of the map.
public MapObject
setReserveOverlayType (MapOverlayType type)
Currently this method is only supported for MapLabeledMarker objects.
public MapObject
setVisible (boolean isVisible)
Sets whether this MapObject is visible.
public MapObject
setVisible (int level, boolean isVisible)
419
HERE SDK for Android Developer's Guide
► API Reference
420
Methods
Sets whether this MapObject is visible for the specified zoom level.
public MapObject
setVisible (int levelStart, int levelEnd, boolean isVisible)
Sets whether this MapObject is visible for the specified range of zoom levels.
public MapObject
setZIndex (int index)
Sets a z-index (stacking order) value for this MapObject .
Class Details
Represents a base class for all map-related objects that users can add to a Map.
This abstract class serves as a base for several more specified map object types, bundling their
common properties. The types of map objects that you can add to a map include:
•
•
•
•
•
•
•
•
•
MapContainer
MapCircle
MapPolygon
MapPolyline
MapRoute
MapMarker
MapScreenMarker
MapLocalModel
MapGeoModel
Objects extending this class, with the exception of MapRoute but including MapContainer, can be
grouped within a MapContainer instance.
For a complete enumeration of available MapObject types, refer to MapObject.Type.
Constructor Details
MapObject (MapObjectImpl impl)
Parameters:
impl
Method Details
public MapOverlayType getOverlayType ()
HERE SDK for Android Developer's Guide
► API Reference
421
Returns the overlay in which this MapObject appears.
Returns:
A MapOverlayType specifying the display grouping of the MapObject
public MapContainer getParent ()
Returns the parent of this MapObject .
Returns:
The parent MapContainer. If the current object is the root object, null is returned.
public MapOverlayType getReserveOverlayType ()
Returns the overlay in which this MapObject reserves screen space.
Returns:
A MapOverlayType specifying the display grouping of the MapObject
public MapObject.Type getType ()
Returns the type of object that this MapObject represents.
Returns:
One of the MapObject.Type values
public int getZIndex ()
Returns the current z-index (stacking order) of this MapObject . A higher z-index indicates that the
object is positioned more in front.
Returns:
The current ordinal z-index number
public boolean isVisible ()
Determines whether this MapObject is visible on the map.
Returns:
HERE SDK for Android Developer's Guide
► API Reference
422
True if this MapObject is visible, false otherwise
public MapObject setOverlayType (MapOverlayType type)
Sets the display order in which this MapObject appears relating to other layers of the map.
Note that this API only takes effect if the object is currently not added to a Map. To change the
MapOverlayType, the MapObject object must be removed and added from the map again.
Parameters:
type
A MapOverlayType specifying the display grouping of this MapObject
Returns:
The updated MapObject itself.
See also:
mapping.Map.addMapObject (MapObject)
mapping.Map.removeMapObject (MapObject)
public MapObject setReserveOverlayType (MapOverlayType type)
Currently this method is only supported for MapLabeledMarker objects.
It sets the reserve order in which this MapObject reserves screen space relating to other layers of
the map. When applied, the screen space around the label will be reserved for the layer and ensure
the label can be rendered without obstruction by other objects.
Note that this API only takes effect if the object is currently not added to a Map. To change the
MapOverlayType, the MapObject object must be removed and added from the map again.
Parameters:
type
A MapOverlayType specifying the display grouping of this MapObject
Returns:
The updated MapObject itself.
See also:
mapping.Map.addMapObject (MapObject)
mapping.Map.removeMapObject (MapObject)
HERE SDK for Android Developer's Guide
► API Reference
public MapObject setVisible (boolean isVisible)
Sets whether this MapObject is visible.
Parameters:
isVisible
A boolean variable specifying whether this MapObject is visible
Returns:
The updated MapObject itself.
See also:
mapping.MapObject.setVisible (int, boolean)
mapping.MapObject.setVisible (int, int, boolean)
public MapObject setVisible (int level, boolean isVisible)
Sets whether this MapObject is visible for the specified zoom level.
Parameters:
level
A zoom level
isVisible
A boolean variable specifying whether this MapObject is visible
Returns:
The updated MapObject itself.
See also:
mapping.MapObject.setVisible (boolean)
mapping.MapObject.setVisible (int, int, boolean)
public MapObject setVisible (int levelStart, int levelEnd, boolean
isVisible)
Sets whether this MapObject is visible for the specified range of zoom levels.
Parameters:
423
HERE SDK for Android Developer's Guide
► API Reference
levelStart
A starting zoom level of the range to show or hide
levelEnd
An ending zoom level of the range to show or hide
isVisible
A boolean variable specifying whether this MapObject is visible
424
Returns:
The updated MapObject itself.
See also:
mapping.MapObject.setVisible (boolean)
mapping.MapObject.setVisible (int, boolean)
public MapObject setZIndex (int index)
Sets a z-index (stacking order) value for this MapObject .
Parameters:
index
A new z-index value for this MapObject, a 16-bit int within the range of
[0..65535]
Returns:
The updated MapObject itself.
Type
The enumeration Type is a member of com.here.android.mpa.mapping.MapObject .
Enumeration Summary
public static final enumeration MapObject.Type
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing the types of MapObject objects that can be added to a Map.
[For complete information, see the section Enumeration Details]
HERE SDK for Android Developer's Guide
► API Reference
Enum Constant Summary
Table 151: Enum Constants in Type
Fields
public static final MapObject.Type
UNKNOWN
An unknown type of MapObject .
public static final MapObject.Type
MARKER
A MapMarker.
public static final MapObject.Type
SCREEN_MARKER
A MapScreenMarker.
public static final MapObject.Type
POLYGON
A MapPolygon.
public static final MapObject.Type
POLYLINE
A MapPolyline.
public static final MapObject.Type
ROUTE
A MapRoute.
public static final MapObject.Type
CONTAINER
A MapContainer.
public static final MapObject.Type
CIRCLE
A MapCircle.
public static final MapObject.Type
LOCAL_MODEL
A MapLocalModel.
public static final MapObject.Type
GEO_MODEL
A MapGeoModel.
public static final MapObject.Type
LABELED_MARKER
A MapLabeledMarker.
Method Summary
Table 152: Methods in Type
Methods
public static MapObject.Type
valueOf (String name)
425
HERE SDK for Android Developer's Guide
► API Reference
Methods
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapObject.Type[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the types of MapObject objects that can be added to a Map.
Enum Constant Details
public static final MapObject.Type UNKNOWN
An unknown type of MapObject .
public static final MapObject.Type MARKER
A MapMarker.
public static final MapObject.Type SCREEN_MARKER
A MapScreenMarker.
public static final MapObject.Type POLYGON
A MapPolygon.
public static final MapObject.Type POLYLINE
A MapPolyline.
public static final MapObject.Type ROUTE
A MapRoute.
public static final MapObject.Type CONTAINER
426
HERE SDK for Android Developer's Guide
► API Reference
427
A MapContainer.
public static final MapObject.Type CIRCLE
A MapCircle.
public static final MapObject.Type LOCAL_MODEL
A MapLocalModel.
public static final MapObject.Type GEO_MODEL
A MapGeoModel.
public static final MapObject.Type LABELED_MARKER
A MapLabeledMarker.
Method Details
public static MapObject.Type valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapObject.Type[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
HERE SDK for Android Developer's Guide
► API Reference
MapOffScreenRenderer
The class MapOffScreenRenderer is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapOffScreenRenderer
implements com.here.android.mpa.common.OffScreenRenderer
extends java.lang.Object
Map derivation of the OffScreenRenderer.
[For complete information, see the section Class Details]
Constructor Summary
Table 153: Constructors in MapOffScreenRenderer
Constructors
MapOffScreenRenderer (Context ctx)
Constructor of a MapOffScreenRenderer .
Method Summary
Table 154: Methods in MapOffScreenRenderer
Methods
public void
addOnMapRenderListener (OnMapRenderListener listener)
Adds a OnMapRenderListener to listen for map render events.
public void
addRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Adds a MapRenderListener to listen for map render events.
public boolean
getBlockingRendering ()
Get whether the offscreen renderer is rendering synchronously.
public void
getScreenCapture (OnScreenCaptureListener listener)
Returns the full screen bitmap for the Map .
public void
removeOnMapRenderListener (OnMapRenderListener listener)
428
HERE SDK for Android Developer's Guide
► API Reference
429
Methods
Removes an existing OnMapRenderListener.
public void
removeRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Removes an existing MapRenderListener .
public MapOffScreenRenderer
setBlockingRendering (boolean blocking)
Toggle if the offscreen renderer draws synchronously.
public MapOffScreenRenderer
setMap (Map map)
Associate the Map with the OffScreen renderer.
public MapOffScreenRenderer
setSize (int width, int height)
Set the size of the requested screen surface
public MapOffScreenRenderer
setViewRect (ViewRect viewRect)
Set the view rectangle where the map will be drawn.
public void
start ()
Starts the offscreen renderer.
public void
listener)
start (SurfaceHolder renderTarget, OffScreenRenderer.SurfaceUpdatedListener
Start the offscreen renderer.
public void
stop ()
Stop the offscreen renderer.
Class Details
Map derivation of the OffScreenRenderer. This class as allows users to capture screenshots of a Map
with or without the map rendered in an Android android.view.android.view.View.
Here's a short example to capture a screenshot of a Map not rendered in a View :
{@literal
MapRenderListener listener = new MapRenderListener() {
...</body>
Constructor Details
MapOffScreenRenderer (Context ctx)
HERE SDK for Android Developer's Guide
► API Reference
430
Constructor of a MapOffScreenRenderer .
Parameters:
ctx
Context to be used by the MapOffScreenRenderer
Method Details
public void addOnMapRenderListener (OnMapRenderListener listener)
Adds a OnMapRenderListener to listen for map render events.
Parameters:
listener
See also:
public void addRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Instead use addOnMapRenderListener(OnMapRenderListener).
Adds a MapRenderListener to listen for map render events. This method is only effective after a
Map has been associated with the renderer by calling setMap(Map).
Parameters:
listener
A MapRenderListener to add to the MapOffScreenRenderer
See also:
mapping.MapOffScreenRenderer.removeRenderListener (MapRenderListener)
public boolean getBlockingRendering ()
Get whether the offscreen renderer is rendering synchronously.
This API only takes effect after setMap(Map) has been called. By default, blocking rendering is
disabled.
Returns:
HERE SDK for Android Developer's Guide
► API Reference
431
true if rendering synchronously, false otherwise.
public void getScreenCapture (OnScreenCaptureListener listener)
Returns the full screen bitmap for the Map . This method is asynchronous and will invoke a callback
once the operation is completed through the OnScreenCaptureListener.
The MapOffScreenRenderer must have been started and the Map rendered in order to create
the screen capture. For Map being rendered in a View , users can use the methods getHeight()
or getWidth() to verify that the Map has been rendered. Otherwise, users can also utilize the
onPostDraw(boolean, long) callback to confirm when the Map has been rendered.
Note that this requires the device to support EGL pBuffer Surfaces. It is recommended to have a size
of a power of two. (For example 128x128, 256x256).
Parameters:
listener
A OnScreenCaptureListener to listen for the callback when screen capture is complete.
See also:
mapping.MapOffScreenRenderer.start ()
mapping.MapOffScreenRenderer.start (SurfaceHolder, SurfaceUpdatedListener)
mapping.MapRenderListener.onPostDraw (boolean, long)
public void removeOnMapRenderListener (OnMapRenderListener listener)
Removes an existing OnMapRenderListener.
Parameters:
listener
public void removeRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Instead use removeOnMapRenderListener(OnMapRenderListener).
Removes an existing MapRenderListener .
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
listener
432
A MapRenderListener to remove from the MapOffScreenRenderer
public MapOffScreenRenderer setBlockingRendering (boolean blocking)
Toggle if the offscreen renderer draws synchronously. This means it will block waiting for all required
data to complete rendering.
This API only takes effect after setMap(Map) has been called.
It is also recommended animations be disabled with the method setFadingAnimations(boolean).
Parameters:
blocking
true if rendering will block, false otherwise. Default is false.
Returns:
This MapOffScreenRenderer object
public MapOffScreenRenderer setMap (Map map)
Associate the Map with the OffScreen renderer.
Make sure to set the map back to null after calling stop() to free up resources properly.
Parameters:
map
Map instance to render in the offscreen renderer.
Returns:
This MapOffScreenRenderer object
public MapOffScreenRenderer setSize (int width, int height)
Set the size of the requested screen surface
Parameters:
width
The screen surface width, in number of pixels
height
The screen surface height, in number of pixels
HERE SDK for Android Developer's Guide
► API Reference
433
Returns:
This MapOffScreenRenderer object
public MapOffScreenRenderer setViewRect (ViewRect viewRect)
Set the view rectangle where the map will be drawn. This API can only called after the setMap(Map)
with a valid Map has been called.
Parameters:
viewRect
Rectangle where the map will be drawn to the view.
Returns:
This MapOffScreenRenderer object
public void start ()
Starts the offscreen renderer. A new PBuffer based surface will be allocated. Before calling this
method, ensure a valid size has been set by calling the method setSize(int, int).
public void start (SurfaceHolder renderTarget,
OffScreenRenderer.SurfaceUpdatedListener listener)
Start the offscreen renderer. The renderer will be attached to the supplied Surface argument.
Parameters:
renderTarget
Surface to attach to.
listener
Callback when the surface has been updated
public void stop ()
Stop the offscreen renderer. All resource allocated will be released.
HERE SDK for Android Developer's Guide
► API Reference
MapOverlayType
The enumeration MapOverlayType is a member of com.here.android.mpa.mapping .
Enumeration Summary
public final enumeration MapOverlayType
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing the display grouping of MapObject objects when added to a Map.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 155: Enum Constants in MapOverlayType
Fields
public static final MapOverlayType
FOREGROUND_OVERLAY
Identifies objects that are to be placed on top of any other objects.
public static final MapOverlayType
POI_OVERLAY
Identifies objects which augment POI information.
public static final MapOverlayType
TRANSIT_STOP_OVERLAY
Identifies objects which augment Transit Stop information.
public static final MapOverlayType
ROAD_OVERLAY
Identifies objects which add some information to the road network, such as traffic or GPS location.
public static final MapOverlayType
AREA_OVERLAY
Identifies objects which add information to area features such as heat maps.
public static final MapOverlayType
BACKGROUND_OVERLAY
Identifies objects which are placed directly over (on top or in front of) BACKGROUND_REPLACEMENT objects.
public static final MapOverlayType
BACKGROUND_REPLACEMENT
Identifies objects that replace the background, such as custom satellite data.
434
HERE SDK for Android Developer's Guide
► API Reference
435
Method Summary
Table 156: Methods in MapOverlayType
Methods
public static MapOverlayType
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapOverlayType[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the display grouping of MapObject objects when added to a Map.
Enum Constant Details
public static final MapOverlayType FOREGROUND_OVERLAY
Identifies objects that are to be placed on top of any other objects. These objects appear closer to
the viewer than other objects.
public static final MapOverlayType POI_OVERLAY
Identifies objects which augment POI information.
public static final MapOverlayType TRANSIT_STOP_OVERLAY
Identifies objects which augment Transit Stop information. Transit-related objects have higher
priority over street names and other area feature labels.
public static final MapOverlayType ROAD_OVERLAY
Identifies objects which add some information to the road network, such as traffic or GPS location.
public static final MapOverlayType AREA_OVERLAY
Identifies objects which add information to area features such as heat maps.
HERE SDK for Android Developer's Guide
► API Reference
436
public static final MapOverlayType BACKGROUND_OVERLAY
Identifies objects which are placed directly over (on top or in front of) BACKGROUND_REPLACEMENT
objects. Apply this type to custom raster tiles and other map objects that should be drawn on top of
the (background) map, but should not hide other objects.
public static final MapOverlayType BACKGROUND_REPLACEMENT
Identifies objects that replace the background, such as custom satellite data. Note that this semantic
type does not disable rendering of the background.
Method Details
public static MapOverlayType valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapOverlayType[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
MapPolygon
The class MapPolygon is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapPolygon
extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
A graphical representation of a GeoPolygon to be rendered on a map.
HERE SDK for Android Developer's Guide
► API Reference
437
[For complete information, see the section Class Details]
See also:
Constructor Summary
Table 157: Constructors in MapPolygon
Constructors
MapPolygon ()
Creates a MapPolygon , which is a MapObject in the shape of a polygon.
MapPolygon (GeoPolygon polygon)
Creates a MapPolygon , which is a MapObject in the shape of a polygon.
MapPolygon (GeoPolygon polygon, java.util.List <com.here.android.mpa.common.GeoPolygon>
holes)
Deprecated: As of SDK 2.1.
Creates a MapPolygon , which is a MapObject in the shape of a polygon.
MapPolygon (MapPolygonImpl impl)
Method Summary
Table 158: Methods in MapPolygon
Methods
public int
getFillColor ()
Returns the current fill color for this MapPolygon , returning an ARGB (Alpha/Red/Green/Blue) integer color value.
public int
getLineColor ()
Returns the current border line color for this MapPolygon , returning an ARGB (Alpha/Red/Green/Blue) integer color value.
public int
getLineWidth ()
Returns the current border line width for the MapPolygon , in pixels.
public boolean
isGeodesicEnabled ()
Returns a boolean indicating whether each segment of this GeoPolygon is drawn as a geodesic.
public MapPolygon
setFillColor (int color)
Sets a fill color for this MapPolygon , using an ARGB (Alpha/Red/Green/Blue) integer color value.
HERE SDK for Android Developer's Guide
► API Reference
438
Methods
public MapPolygon
setGeoPolygon (GeoPolygon polygon)
Changes the GeoPolygon rendered by this MapPolygon .
public MapPolygon
setGeodesicEnabled (boolean enabled)
Specifies whether to draw each segment of the represented GeoPolygon as a geodesic.
public MapPolygon
setLineColor (int color)
Sets a border line color for this MapPolygon , using an ARGB (Alpha/Red/Green/Blue) integer color value.
public MapPolygon
setLineWidth (int width)
Sets a border line width, in pixels, for this MapPolygon , an int value within the [1..100] range.
Class Details
A graphical representation of a GeoPolygon to be rendered on a map. In contrast to a MapPolyline,
it is assumed that the last coordinate within the path is connected with the first coordinate, thereby
constructing an enclosed geometry. Self-intersecting polygons rendering are not supported.
See also:
Constructor Details
MapPolygon ()
Creates a MapPolygon , which is a MapObject in the shape of a polygon.
MapPolygon (GeoPolygon polygon)
Creates a MapPolygon , which is a MapObject in the shape of a polygon.
Parameters:
polygon
GeoPolygon to construct the MapPolygon
MapPolygon (GeoPolygon polygon, java.util.List
<com.here.android.mpa.common.GeoPolygon> holes)
Deprecated: As of SDK 2.1.
This feature is no longer supported.
HERE SDK for Android Developer's Guide
► API Reference
439
Creates a MapPolygon , which is a MapObject in the shape of a polygon.
Parameters:
polygon
GeoPolygon to construct the MapPolygon
holes
GeoPolygon list of holes in the MapPolygon
See also:
mapping.MapPolygon.MapPolygon (GeoPolygon)
MapPolygon (MapPolygonImpl impl)
Parameters:
impl
Method Details
public int getFillColor ()
Returns the current fill color for this MapPolygon , returning an ARGB (Alpha/Red/Green/Blue)
integer color value.
Returns:
The current ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green,
blue. Each color component has a value range from [0..255], with 0 meaning no contribution for that
component, and 255 meaning 100% contribution
See also:
android.graphics.Color
public int getLineColor ()
Returns the current border line color for this MapPolygon , returning an ARGB (Alpha/Red/Green/
Blue) integer color value.
Returns:
HERE SDK for Android Developer's Guide
► API Reference
440
The current ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green,
blue. Each color component has a value range from [0..255], with 0 meaning no contribution for that
component, and 255 meaning 100% contribution
See also:
android.graphics.Color
public int getLineWidth ()
Returns the current border line width for the MapPolygon , in pixels.
Returns:
The current width of the line defining the border of the MapPolygon
public boolean isGeodesicEnabled ()
Returns a boolean indicating whether each segment of this GeoPolygon is drawn as a geodesic.
Returns:
true if GeoPolygon segments are drawn as a geodesic, false otherwise.
public MapPolygon setFillColor (int color)
Sets a fill color for this MapPolygon , using an ARGB (Alpha/Red/Green/Blue) integer color value.
Parameters:
color
The ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green, blue. Each color component has a value range from [0..255],
with 0 meaning no contribution for that component, and 255 meaning 100%
contribution
See also:
android.graphics.Color
public MapPolygon setGeoPolygon (GeoPolygon polygon)
Changes the GeoPolygon rendered by this MapPolygon .
HERE SDK for Android Developer's Guide
► API Reference
441
Parameters:
polygon
GeoPolygon to be rendered
Returns:
The updated MapPolygon itself.
public MapPolygon setGeodesicEnabled (boolean enabled)
Specifies whether to draw each segment of the represented GeoPolygon as a geodesic.
Parameters:
enabled
true if GeoPolygon segments will be drawn as a geodesic
Returns:
The updated @ code MapPolygon} itself.
public MapPolygon setLineColor (int color)
Sets a border line color for this MapPolygon , using an ARGB (Alpha/Red/Green/Blue) integer color
value.
Parameters:
color
The ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green, blue. Each color component has a value range from [0..255],
with 0 meaning no contribution for that component, and 255 meaning 100%
contribution
Returns:
The updated @ code MapPolygon} itself.
See also:
android.graphics.Color
public MapPolygon setLineWidth (int width)
Sets a border line width, in pixels, for this MapPolygon , an int value within the [1..100] range.
HERE SDK for Android Developer's Guide
► API Reference
Parameters:
width
Width of the line defining the border of the MapPolygon
Returns:
The updated @ code MapPolygon} itself.
MapPolyline
The class MapPolyline is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapPolyline
extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
A graphical representation of a GeoPolyline that can be rendered on a map.
[For complete information, see the section Class Details]
Nested Class Summary
Table 159: Nested Classes in MapPolyline
Nested Classes
public static final enumeration
MapPolyline.CapStyle
Line ending cap rendering styles
Constructor Summary
Table 160: Constructors in MapPolyline
Constructors
MapPolyline ()
Creates a MapPolyline , which is a MapObject in the shape of a polyline.
MapPolyline (GeoPolyline polyline)
Creates a MapPolyline , which is a MapObject in the shape of a polyline.
442
HERE SDK for Android Developer's Guide
► API Reference
Constructors
MapPolyline (MapPolylineImpl impl)
Method Summary
Table 161: Methods in MapPolyline
Methods
public MapPolyline.CapStyle
getCapStyle ()
Get the MapPolyline rendering cap style
public int
getDashPrimaryLength ()
Returns the current length of the primary dash segment of a dashed MapPolyline , in pixels.
public int
getDashSecondaryLength ()
Returns the current length of the secondary (empty) dash segments of a dashed MapPolyline , in pixels.
public int
getLineColor ()
Gets the current line color for this MapPolyline , returning an ARGB (Alpha/Red/Green/Blue) integer color value.
public int
getLineWidth ()
Returns the current line width for this MapPolyline , in pixels.
public GeoPolyline
getPoyline ()
Deprecated: As of release 2.0.1.
public boolean
isDashEnabled ()
Returns a boolean indicating whether the MapPolyline appears as a dashed line.
public boolean
isGeodesicEnabled ()
Returns a boolean indicating whether each segment of this GeoPolyline is drawn as a geodesic.
public MapPolyline
setCapStyle (MapPolyline.CapStyle style)
Set the MapPolyline rendering cap style.
public MapPolyline
setDashEnabled (boolean enabled)
Sets the appearance of this MapPolyline as either a dashed or solid line.
public MapPolyline
setDashPrimaryLength (int length)
Sets a length, in pixels, for the primary dash segment of a dashed MapPolyline .
public MapPolyline
setDashSecondaryLength (int length)
Sets a length, in pixels, for the secondary (empty) dash segments of a dashed MapPolyline .
443
HERE SDK for Android Developer's Guide
► API Reference
Methods
public MapPolyline
setGeoPolyline (GeoPolyline polyline)
Changes the GeoPolyline rendered by this GeoPolyline
public MapPolyline
setGeodesicEnabled (boolean enabled)
Set whether to draw each segment of the represented GeoPolyline as a geodesic.
public MapPolyline
setLineColor (int color)
Sets a line color for this MapPolyline , using an ARGB (Alpha/Red/Green/Blue) integer color value.
public MapPolyline
setLineWidth (int width)
Sets a line width, in pixels, for this MapPolyline , an int value within the [1..100] range.
Class Details
A graphical representation of a GeoPolyline that can be rendered on a map. A MapPolyline has
multiple points that combine to create its path.
Constructor Details
MapPolyline ()
Creates a MapPolyline , which is a MapObject in the shape of a polyline.
MapPolyline (GeoPolyline polyline)
Creates a MapPolyline , which is a MapObject in the shape of a polyline.
Parameters:
polyline
GeoPolyline to construct the MapPolyline.
MapPolyline (MapPolylineImpl impl)
Parameters:
impl
444
HERE SDK for Android Developer's Guide
► API Reference
445
Method Details
public MapPolyline.CapStyle getCapStyle ()
Get the MapPolyline rendering cap style
Returns:
CapStyle cap style.
public int getDashPrimaryLength ()
Returns the current length of the primary dash segment of a dashed MapPolyline , in pixels.
Returns:
The current length of the primary dash
See also:
mapping.MapPolyline.getDashSecondaryLength ()
public int getDashSecondaryLength ()
Returns the current length of the secondary (empty) dash segments of a dashed MapPolyline , in
pixels.
Returns:
The current length of the empty dash
See also:
mapping.MapPolyline.getDashPrimaryLength ()
public int getLineColor ()
Gets the current line color for this MapPolyline , returning an ARGB (Alpha/Red/Green/Blue) integer
color value.
Returns:
The current ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green,
blue. Each color component has a value range from [0..255], with 0 meaning no contribution for that
component and 255 meaning 100% contribution
See also:
HERE SDK for Android Developer's Guide
► API Reference
446
android.graphics.Color
public int getLineWidth ()
Returns the current line width for this MapPolyline , in pixels.
Returns:
The current line width for this MapPolyline
public GeoPolyline getPoyline ()
Deprecated: As of release 2.0.1.
Modifying the GeoPolyline returned by this method will not alter MapPolyline. Please set GeoPolyline by way of
setGeoPolyline(GeoPolyline) function to change MapPolyline properties.
public boolean isDashEnabled ()
Returns a boolean indicating whether the MapPolyline appears as a dashed line. By default, dash
is disabled.
Returns:
True if the MapPolyline is dashed, false otherwise
public boolean isGeodesicEnabled ()
Returns a boolean indicating whether each segment of this GeoPolyline is drawn as a geodesic. By
default, GeoDesic is disabled.
Returns:
true if GeoPolyline segments are drawn as a geodesic, false otherwise.
public MapPolyline setCapStyle (MapPolyline.CapStyle style)
Set the MapPolyline rendering cap style.
Parameters:
style
CapStyle
HERE SDK for Android Developer's Guide
► API Reference
447
Returns:
The updated MapPolyline itself.
public MapPolyline setDashEnabled (boolean enabled)
Sets the appearance of this MapPolyline as either a dashed or solid line.
Parameters:
enabled
A boolean specifying whether the MapPolyline should be dashed
Returns:
The updated MapPolyline itself.
public MapPolyline setDashPrimaryLength (int length)
Sets a length, in pixels, for the primary dash segment of a dashed MapPolyline . By default, the
primary dash length is 1.
Parameters:
length
Desired length of the primary dash
Returns:
The updated MapPolyline itself.
See also:
mapping.MapPolyline.setDashSecondaryLength (int)
public MapPolyline setDashSecondaryLength (int length)
Sets a length, in pixels, for the secondary (empty) dash segments of a dashed MapPolyline . By
default, the secondary dash length is 1.
Parameters:
length
Desired length of the empty dash
Returns:
The updated MapPolyline itself.
HERE SDK for Android Developer's Guide
► API Reference
448
See also:
mapping.MapPolyline.setDashPrimaryLength (int)
public MapPolyline setGeoPolyline (GeoPolyline polyline)
Changes the GeoPolyline rendered by this GeoPolyline
Parameters:
polyline
GeoPolyline to be rendered
Returns:
The updated MapPolyline itself.
public MapPolyline setGeodesicEnabled (boolean enabled)
Set whether to draw each segment of the represented GeoPolyline as a geodesic.
Parameters:
enabled
true if GeoPolyline segments will be drawn as a geodesic
Returns:
The updated MapPolyline itself.
public MapPolyline setLineColor (int color)
Sets a line color for this MapPolyline , using an ARGB (Alpha/Red/Green/Blue) integer color value.
The default line color is Color.BLUE .
Parameters:
color
The ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green, blue. Each color component has a value range from [0..255]
with 0 meaning no contribution for that component, and 255 meaning 100%
contribution
Returns:
The updated MapPolyline itself.
HERE SDK for Android Developer's Guide
► API Reference
449
See also:
android.graphics.Color
public MapPolyline setLineWidth (int width)
Sets a line width, in pixels, for this MapPolyline , an int value within the [1..100] range. By default,
the line width is 1.
Parameters:
width
Desired width of the line defining the MapPolyline
Returns:
The updated MapPolyline itself.
CapStyle
The enumeration CapStyle is a member of com.here.android.mpa.mapping.MapPolyline .
Enumeration Summary
public static final enumeration MapPolyline.CapStyle
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Line ending cap rendering styles
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 162: Enum Constants in CapStyle
Fields
public static final MapPolyline.CapStyle
BUTT
The line ends exactly where the endpoint is located.
public static final MapPolyline.CapStyle
Adding a round cap to the endpoint.
ROUND
HERE SDK for Android Developer's Guide
► API Reference
450
Method Summary
Table 163: Methods in CapStyle
Methods
public static MapPolyline.CapStyle
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapPolyline.CapStyle[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Line ending cap rendering styles
Enum Constant Details
public static final MapPolyline.CapStyle BUTT
The line ends exactly where the endpoint is located.
public static final MapPolyline.CapStyle ROUND
Adding a round cap to the endpoint.
Method Details
public static MapPolyline.CapStyle valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapPolyline.CapStyle[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
HERE SDK for Android Developer's Guide
► API Reference
MapProxyObject
The class MapProxyObject is a member of com.here.android.mpa.mapping .
Class Summary
public abstract class MapProxyObject
extends com.here.android.mpa.common.ViewObject, java.lang.Object
Represents a base interface for all view objects rendered as part of the map.
[For complete information, see the section Class Details]
Nested Class Summary
Table 164: Nested Classes in MapProxyObject
Nested Classes
public static final enumeration
MapProxyObject.Type
Represents values describing the types of MapProxyObject objects that can be added to a Map.
Constructor Summary
Table 165: Constructors in MapProxyObject
Constructors
MapProxyObject (MapProxyObjectImpl impl)
Method Summary
Table 166: Methods in MapProxyObject
Methods
public MapProxyObject.Type
getType ()
Returns the type of object that the MapProxyObject represents.
451
HERE SDK for Android Developer's Guide
► API Reference
452
Class Details
Represents a base interface for all view objects rendered as part of the map. A proxy object may
contain special information depending on its type (for example, TransitStopObject may provide
transit stop-related information), but it cannot be created or modified.
This interface serves as a generalization for several more specified proxy object types, bundling their
common properties.
Constructor Details
MapProxyObject (MapProxyObjectImpl impl)
Parameters:
impl
Method Details
public MapProxyObject.Type getType ()
Returns the type of object that the MapProxyObject represents.
Returns:
The MapProxyObject.Type
Type
The enumeration Type is a member of com.here.android.mpa.mapping.MapProxyObject .
Enumeration Summary
public static final enumeration MapProxyObject.Type
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing the types of MapProxyObject objects that can be added to a Map.
[For complete information, see the section Enumeration Details]
HERE SDK for Android Developer's Guide
► API Reference
Enum Constant Summary
Table 167: Enum Constants in Type
Fields
public static final MapProxyObject.Type
UNKNOWN
An unknown type of MapProxyObject .
public static final MapProxyObject.Type
SAFETY_SPOT
A SafetySpotObject .
public static final MapProxyObject.Type
TRAFFIC_EVENT
A TrafficEventObject .
public static final MapProxyObject.Type
TRANSIT_ACCESS
A TransitAccessObject .
public static final MapProxyObject.Type
TRANSIT_LINE
A TransitLineObject .
public static final MapProxyObject.Type
TRANSIT_LINE_SEGMENT
A TransitLineSegmentObject .
public static final MapProxyObject.Type
TRANSIT_STOP
A TransitStopObject .
public static final MapProxyObject.Type
EXTRUDED_BUILDING
A MapBuildingObject .
public static final MapProxyObject.Type
MAP_CARTO_MARKER
A MapCartoMarker .
Method Summary
Table 168: Methods in Type
Methods
public static MapProxyObject.Type
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapProxyObject.Type[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
453
HERE SDK for Android Developer's Guide
► API Reference
Enumeration Details
Represents values describing the types of MapProxyObject objects that can be added to a Map.
Enum Constant Details
public static final MapProxyObject.Type UNKNOWN
An unknown type of MapProxyObject .
public static final MapProxyObject.Type SAFETY_SPOT
A SafetySpotObject . Not supported.
public static final MapProxyObject.Type TRAFFIC_EVENT
A TrafficEventObject .
public static final MapProxyObject.Type TRANSIT_ACCESS
A TransitAccessObject .
public static final MapProxyObject.Type TRANSIT_LINE
A TransitLineObject .
public static final MapProxyObject.Type TRANSIT_LINE_SEGMENT
A TransitLineSegmentObject .
public static final MapProxyObject.Type TRANSIT_STOP
A TransitStopObject .
public static final MapProxyObject.Type EXTRUDED_BUILDING
A MapBuildingObject .
454
HERE SDK for Android Developer's Guide
► API Reference
455
public static final MapProxyObject.Type MAP_CARTO_MARKER
A MapCartoMarker .
Method Details
public static MapProxyObject.Type valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapProxyObject.Type[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
MapRasterTileSource
The class MapRasterTileSource is a member of com.here.android.mpa.mapping .
Class Summary
public abstract class MapRasterTileSource
extends java.lang.Object
Represents an interface for a map raster tile source, used to render custom tile images on top of a
Map.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
Nested Class Summary
Table 169: Nested Classes in MapRasterTileSource
Nested Classes
public static final class
MapRasterTileSource.MapTileSystemHelper
Represents a helper class for converting raster tile coordinates to other tile system values.
public static class
MapRasterTileSource.TileResult
Result class for getting tile.
public static final enumeration
MapRasterTileSource.Transparency
Represents values describing the state of raster tile image transparency.
Constructor Summary
Table 170: Constructors in MapRasterTileSource
Constructors
MapRasterTileSource ()
Field Summary
Table 171: Fields in MapRasterTileSource
Fields
protected MapRasterTileSourceImpl
m_impl
Method Summary
Table 172: Methods in MapRasterTileSource
Methods
public GeoBoundingBox
getBoundingArea ()
Gets the GeoBoundingBox representing the bounding area within which raster tiles are visible.
public int
getCacheExpiration ()
Get the cache expiration time
public MapOverlayType
getOverlayType ()
Gets the raster tile overlay type.
456
HERE SDK for Android Developer's Guide
► API Reference
Methods
public byte[]
getTile (int x, int y, int zoomLevel)
Deprecated: See getTileWithError(int, int, int)
Method to be overwritten by derived class to get a tile.
public int
getTileSize ()
Gets the raster tile image size, in pixels.
public MapRasterTileSource.TileResult
getTileWithError (int x, int y, int zoomLevel)
Method to be overwritten by derived class to get a tile.
public int
getZIndex ()
Gets the current z-index (stacking order) of the MapObject .
public abstract boolean
hasTile (int x, int y, int zoomLevel)
Abstract method to be overwritten by derived class to check if a tile exists.
public boolean
hasTransparency ()
Determines whether raster tile images have transparency enabled.
public MapRasterTileSource
hideAtZoomLevel (int level)
Hides tiles at the specified zoom level of the Map .
public MapRasterTileSource
hideAtZoomRange (int beginZoomLevel, int endZoomLevel)
Hides tiles within a given zoom level range of the Map .
public boolean
isCachingEnabled ()
Get whether tiles are cached to the file system
public boolean
isShownAtZoomLevel (int zoomLevel)
Determines whether raster tiles are shown at the specified zoom level of the Map .
public MapRasterTileSource
setBoundingArea (GeoBoundingBox boundingBox)
Sets a bounding area within which raster tiles are visible.
public MapRasterTileSource
setCacheExpiration (int expireSeconds)
Set the cache expiration time
public MapRasterTileSource
setCachePrefix (String cache)
Set the cache file prefix
public MapRasterTileSource
setCachingEnabled (boolean enabled)
Set whether tiles are cached to the file system.
public MapRasterTileSource
setOverlayType (MapOverlayType newValue)
457
HERE SDK for Android Developer's Guide
► API Reference
458
Methods
Sets a MapOverlayType for the MapRasterTileSource .
public MapRasterTileSource
setTileSize (int newValue)
Sets a size, in pixels, for the raster tile image.
public MapRasterTileSource
setTransparency (MapRasterTileSource.Transparency value)
Sets a Transparency state for raster tile image.
public MapRasterTileSource
setZIndex (int zIndex)
Sets a z-index (stacking order) value for the MapObject .
public MapRasterTileSource
showAtZoomLevel (int level)
Shows tiles at the specified zoom level of the Map .
public MapRasterTileSource
showAtZoomRange (int beginZoomLevel, int endZoomLevel)
Shows tiles within a given zoom level range of the Map .
Class Details
Represents an interface for a map raster tile source, used to render custom tile images on top of a
Map.
Default attribute values are as follows:
Overlay type:
RasterTileOverlayType.BACKGROUND_REPLACEMENT
Transparency:
Transparency.TRANSPARENCY_ON
Tile size:
256x256 pixels
Valid zoom levels: 0-20 (all zoom levels)
Bounding area:
Top-Left coordinate: (-180.0, 90.0), Bottom-Right
coordinate: (179.99, -90.0)
Note: the currently supported pixel format for the tile images is RGBA.
Constructor Details
MapRasterTileSource ()
Field Details
protected MapRasterTileSourceImpl m_impl
HERE SDK for Android Developer's Guide
► API Reference
Method Details
public GeoBoundingBox getBoundingArea ()
Gets the GeoBoundingBox representing the bounding area within which raster tiles are visible.
Returns:
The raster tile bounding area
public int getCacheExpiration ()
Get the cache expiration time
Returns:
Expire time in seconds
public MapOverlayType getOverlayType ()
Gets the raster tile overlay type.
Returns:
The raster tile overlay type, a MapOverlayType value
public byte[] getTile (int x, int y, int zoomLevel)
Deprecated: See getTileWithError(int, int, int)
Method to be overwritten by derived class to get a tile.
Parameters:
x
y
zoomLevel
public int getTileSize ()
Gets the raster tile image size, in pixels.
459
HERE SDK for Android Developer's Guide
► API Reference
460
Returns:
The size of the raster tile image
public MapRasterTileSource.TileResult getTileWithError (int x, int y, int
zoomLevel)
Method to be overwritten by derived class to get a tile.
Parameters:
x
X coordinate
y
Y coordinate
zoomLevel
zoom level
Returns:
A TileResult representing tile data and operation error. Check TileResult#getError() to
check for error. Check TileResult#getData() to get RasterTile
public int getZIndex ()
Gets the current z-index (stacking order) of the MapObject .
Returns:
The current ordinal z-index number
public abstract boolean hasTile (int x, int y, int zoomLevel)
Abstract method to be overwritten by derived class to check if a tile exists.
Parameters:
x
X coordinate
y
Y coordinate
zoomLevel
zoom level
Returns:
HERE SDK for Android Developer's Guide
► API Reference
461
true if the tile exists, false otherwise
public boolean hasTransparency ()
Determines whether raster tile images have transparency enabled.
Returns:
True if raster tile images are set to Transparency.TRANSPARENCY_ON, false otherwise
public MapRasterTileSource hideAtZoomLevel (int level)
Hides tiles at the specified zoom level of the Map .
Parameters:
level
Zoom level at which tiles are to be hidden
Returns:
The updated MapRasterTileSource itself.
See also:
mapping.Map.getMaxZoomLevel ()
public MapRasterTileSource hideAtZoomRange (int beginZoomLevel, int
endZoomLevel)
Hides tiles within a given zoom level range of the Map .
Parameters:
beginZoomLevel
Zoom level representing the beginning of the range within which tiles are to
be hidden
endZoomLevel
Zoom level representing the end of the range within which tiles are to be
hidden
Returns:
The updated MapRasterTileSource itself.
See also:
HERE SDK for Android Developer's Guide
► API Reference
462
mapping.Map.getMaxZoomLevel ()
public boolean isCachingEnabled ()
Get whether tiles are cached to the file system
Returns:
True of tiles are cached. False otherwise.
public boolean isShownAtZoomLevel (int zoomLevel)
Determines whether raster tiles are shown at the specified zoom level of the Map .
Parameters:
zoomLevel
Zoom level to check for raster tile visibility
Returns:
True if raster tiles are shown at the specified zoom level, false otherwise
See also:
mapping.Map.getZoomLevel ()
public MapRasterTileSource setBoundingArea (GeoBoundingBox boundingBox)
Sets a bounding area within which raster tiles are visible.
Parameters:
boundingBox
A GeoBoundingBox representing the bounding area of visible raster tiles
Returns:
The updated MapRasterTileSource itself.
public MapRasterTileSource setCacheExpiration (int expireSeconds)
Set the cache expiration time
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
expireSeconds
463
Expire time in seconds
Returns:
The updated MapRasterTileSource itself.
public MapRasterTileSource setCachePrefix (String cache)
Set the cache file prefix
Parameters:
cache
Prefix tag
Returns:
The updated MapRasterTileSource itself.
public MapRasterTileSource setCachingEnabled (boolean enabled)
Set whether tiles are cached to the file system.
Parameters:
enabled
True to cache, False otherwise
Returns:
The updated MapRasterTileSource itself.
public MapRasterTileSource setOverlayType (MapOverlayType newValue)
Sets a MapOverlayType for the MapRasterTileSource .
Parameters:
newValue
A MapOverlayType value representing the desired raster tile overlay type
Returns:
The updated MapRasterTileSource itself.
HERE SDK for Android Developer's Guide
► API Reference
464
public MapRasterTileSource setTileSize (int newValue)
Sets a size, in pixels, for the raster tile image.
Parameters:
newValue
Desired size of the raster tile image
Returns:
The updated MapRasterTileSource itself.
public MapRasterTileSource setTransparency (MapRasterTileSource.Transparency
value)
Sets a Transparency state for raster tile image.
Parameters:
value
A Transparency value representing the desired raster tile image transparency
Returns:
The updated MapRasterTileSource itself.
public MapRasterTileSource setZIndex (int zIndex)
Sets a z-index (stacking order) value for the MapObject .
Parameters:
zIndex
A new z-index value for the MapObject, a 16-bit int within the range of
[0..655xx]
Returns:
The updated MapRasterTileSource itself.
public MapRasterTileSource showAtZoomLevel (int level)
Shows tiles at the specified zoom level of the Map .
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
level
465
Zoom level at which tiles are to be shown
Returns:
The updated MapRasterTileSource itself.
See also:
mapping.Map.getMaxZoomLevel ()
public MapRasterTileSource showAtZoomRange (int beginZoomLevel, int
endZoomLevel)
Shows tiles within a given zoom level range of the Map .
Parameters:
beginZoomLevel
Zoom level representing the beginning of the range within which tiles are to
be shown
endZoomLevel
Zoom level representing the end of the range within which tiles are to be
shown
Returns:
The updated MapRasterTileSource itself.
See also:
mapping.Map.getMaxZoomLevel ()
MapTileSystemHelper
The class MapTileSystemHelper is a member of
com.here.android.mpa.mapping.MapRasterTileSource .
Class Summary
public static final class MapRasterTileSource.MapTileSystemHelper
extends java.lang.Object
Represents a helper class for converting raster tile coordinates to other tile system values.
HERE SDK for Android Developer's Guide
► API Reference
[For complete information, see the section Class Details]
Constructor Summary
Table 173: Constructors in MapTileSystemHelper
Constructors
MapTileSystemHelper ()
Method Summary
Table 174: Methods in MapTileSystemHelper
Methods
public static String
tileXYToQuadKey (int x, int y, int zoomLevel)
Converts a raster tile's X-coordinate and Y-coordinate into an equivalent QuadKey at a specified zoom level.
Class Details
Represents a helper class for converting raster tile coordinates to other tile system values.
Constructor Details
MapTileSystemHelper ()
Method Details
public static String tileXYToQuadKey (int x, int y, int zoomLevel)
Converts a raster tile's X-coordinate and Y-coordinate into an equivalent QuadKey at a specified
zoom level.
See also The Tile Coordinates and Quadkeys.
Parameters:
x
Current X-coordinate of the tile
y
Current Y-coordinate of the tile
466
HERE SDK for Android Developer's Guide
► API Reference
zoomLevel
467
Desired zoom level, an int within a range from 1 (lowest detail) to 20 (highest detail)
Returns:
The QuadKey
TileResult
The class TileResult is a member of com.here.android.mpa.mapping.MapRasterTileSource .
Class Summary
public static class MapRasterTileSource.TileResult
extends java.lang.Object
Result class for getting tile.
[For complete information, see the section Class Details]
Nested Class Summary
Table 175: Nested Classes in TileResult
Nested Classes
public static final enumeration
MapRasterTileSource.TileResult.Error
Error code for raster tile result.
Constructor Summary
Table 176: Constructors in TileResult
Constructors
TileResult (MapRasterTileSource.TileResult.Error error, byte[] data)
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 177: Methods in TileResult
Methods
public byte[]
getData ()
Get the retrieved tile.
public MapRasterTileSource.TileResult.Error
getError ()
Get the Error for get tile operation
Class Details
Result class for getting tile. MapRasterTileSource#getTileWithError(int, int, int)
Constructor Details
TileResult (MapRasterTileSource.TileResult.Error error, byte[] data)
Parameters:
error
data
Method Details
public byte[] getData ()
Get the retrieved tile.
Returns:
RasterTile
public MapRasterTileSource.TileResult.Error getError ()
Get the Error for get tile operation
Returns:
Error encountered during get tile operation
468
HERE SDK for Android Developer's Guide
469
► API Reference
Error
The enumeration Error is a member of
com.here.android.mpa.mapping.MapRasterTileSource.TileResult .
Enumeration Summary
public static final enumeration MapRasterTileSource.TileResult.Error
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Error code for raster tile result.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 178: Enum Constants in Error
Fields
public static final MapRasterTileSource.TileResult.Error
NONE
public static final MapRasterTileSource.TileResult.Error
NOT_READY
public static final MapRasterTileSource.TileResult.Error
NOT_FOUND
Method Summary
Table 179: Methods in Error
Methods
public static MapRasterTileSource.TileResult.Error
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapRasterTileSource.TileResult.Error[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Error code for raster tile result.
HERE SDK for Android Developer's Guide
► API Reference
470
Enum Constant Details
public static final MapRasterTileSource.TileResult.Error NONE
public static final MapRasterTileSource.TileResult.Error NOT_READY
public static final MapRasterTileSource.TileResult.Error NOT_FOUND
Method Details
public static MapRasterTileSource.TileResult.Error valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapRasterTileSource.TileResult.Error[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Transparency
The enumeration Transparency is a member of com.here.android.mpa.mapping.MapRasterTileSource
.
Enumeration Summary
public static final enumeration MapRasterTileSource.Transparency
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing the state of raster tile image transparency.
[For complete information, see the section Enumeration Details]
HERE SDK for Android Developer's Guide
471
► API Reference
Enum Constant Summary
Table 180: Enum Constants in Transparency
Fields
public static final MapRasterTileSource.Transparency
ON
Raster tile image transparency is enabled.
public static final MapRasterTileSource.Transparency
OFF
Raster tile image transparency is disabled.
Method Summary
Table 181: Methods in Transparency
Methods
public static MapRasterTileSource.Transparency
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapRasterTileSource.Transparency[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the state of raster tile image transparency.
Enum Constant Details
public static final MapRasterTileSource.Transparency ON
Raster tile image transparency is enabled.
public static final MapRasterTileSource.Transparency OFF
Raster tile image transparency is disabled.
Method Details
public static MapRasterTileSource.Transparency valueOf (String name)
HERE SDK for Android Developer's Guide
► API Reference
472
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapRasterTileSource.Transparency[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
MapRenderListener
The interface MapRenderListener is a member of com.here.android.mpa.mapping .
Interface Summary
public abstract interface MapRenderListener
Represents a listener to provide notification upon completion of a Map rendering event.
Deprecated: As of SDK 2.1.1.
[For complete information, see the section Interface Details]
See also:
mapping.MapFragment.addRenderListener (MapRenderListener)
mapping.MapFragment.removeRenderListener (MapRenderListener)
mapping.MapCompatibilityFragment.addRenderListener (MapRenderListener)
mapping.MapCompatibilityFragment.removeRenderListener (MapRenderListener)
mapping.MapView.addRenderListener (MapRenderListener)
mapping.MapView.removeRenderListener (MapRenderListener)
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 182: Methods in MapRenderListener
Methods
public abstract void
onGraphicsDetached ()
Deprecated: As of SDK 2.1.1.
Callback indicating that the map renderer has been cleanly detached from the view.
public abstract void
onPostDraw (boolean invalidated, long renderTime)
Deprecated: As of SDK 2.1.1.
Callback indicating that a Map drawing event has ended.
public abstract void
onPreDraw ()
Deprecated: As of SDK 2.1.1.
Callback indicating that a Map drawing event is about to occur.
public abstract void
onSizeChanged (int width, int height)
Deprecated: As of SDK 2.1.1.
Callback indicating that a Map size has changed following a rotation.
Interface Details
Deprecated: As of SDK 2.1.1.
Instead use OnMapRenderListener.
Represents a listener to provide notification upon completion of a Map rendering event.
See also:
mapping.MapFragment.addRenderListener (MapRenderListener)
mapping.MapFragment.removeRenderListener (MapRenderListener)
mapping.MapCompatibilityFragment.addRenderListener (MapRenderListener)
mapping.MapCompatibilityFragment.removeRenderListener (MapRenderListener)
mapping.MapView.addRenderListener (MapRenderListener)
mapping.MapView.removeRenderListener (MapRenderListener)
Method Details
public abstract void onGraphicsDetached ()
473
HERE SDK for Android Developer's Guide
► API Reference
474
Deprecated: As of SDK 2.1.1.
Instead use onGraphicsDetached().
Callback indicating that the map renderer has been cleanly detached from the view.
public abstract void onPostDraw (boolean invalidated, long renderTime)
Deprecated: As of SDK 2.1.1.
Instead use onPostDraw(boolean, long).
Callback indicating that a Map drawing event has ended. Applications can perform custom rendering
when this callback is sent.
Note: This callback is made on the rendering thread.
Parameters:
invalidated
A boolean specifying whether the map is invalidated and will redraw
renderTime
The time taken to render the map
public abstract void onPreDraw ()
Deprecated: As of SDK 2.1.1.
Instead use onPreDraw().
Callback indicating that a Map drawing event is about to occur. Applications can perform custom
rendering when this callback is sent.
This callback is preferred to onPostDraw(boolean, long) when making changes to MapObjects as the
changes can be made during the upcoming draw and another Map invalidation will not need to take
place.
Note: This callback is made on the rendering thread.
public abstract void onSizeChanged (int width, int height)
Deprecated: As of SDK 2.1.1.
Instead use onSizeChanged(int, int).
Callback indicating that a Map size has changed following a rotation. Applications can perform
custom rendering when this callback is sent.
Note: This callback is made on the UI thread.
HERE SDK for Android Developer's Guide
► API Reference
Parameters:
width
A post-rotation width
height
A post-rotation height
MapRoute
The class MapRoute is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapRoute
extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
Represents a Route that can be displayed on a Map.
[For complete information, see the section Class Details]
Nested Class Summary
Table 183: Nested Classes in MapRoute
Nested Classes
public static final enumeration
MapRoute.RenderType
Render classification of the route.
Constructor Summary
Table 184: Constructors in MapRoute
Constructors
MapRoute ()
Creates a MapRoute object.
MapRoute (Route route)
Creates a MapRoute with a specified Route .
475
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 185: Methods in MapRoute
Methods
public int
getColor ()
Returns the current ARGB (Alpha/Red/Green/Blue) integer color value used to display this route.
public MapRoute.RenderType
getRenderType ()
Get the RenderType associated with this MapRoute.
public Route
getRoute ()
Returns the Route that has been displayed on the Map .
public boolean
isManeuverNumberVisible ()
Returns a boolean indicating whether maneuver numbers are displayed along with this route.
public MapRoute
setColor (int argbColor)
Sets a color for displaying the route, using an ARGB (Alpha/Red/Green/Blue) integer color value.
public MapRoute
setManeuverNumberVisible (boolean visible)
Sets maneuver numbers to be either displayed along with this route or not displayed.
public MapRoute
setRenderType (MapRoute.RenderType type)
Sets the RenderType associated with this MapRoute.
public MapRoute
setRoute (Route route)
Sets a Route that will be displayed on the Map .
Class Details
Represents a Route that can be displayed on a Map.
Constructor Details
MapRoute ()
Creates a MapRoute object.
MapRoute (Route route)
Creates a MapRoute with a specified Route .
476
HERE SDK for Android Developer's Guide
► API Reference
477
Typically, a MapRoute is created after a Route has been calculated. An application can pass a
calculated Route as a parameter to this method instead of making an explicit call to setRoute(Route).
Adding the new MapRoute object to a Map can be done by way of the addMapObject(MapObject)
method.
Parameters:
route
A calculated Route used to set to the MapRoute
Method Details
public int getColor ()
Returns the current ARGB (Alpha/Red/Green/Blue) integer color value used to display this route.
Returns:
The current ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green,
blue. Each color component has a value range from [0..255], with 0 meaning no contribution for that
component and 255 meaning 100% contribution
See also:
android.graphics.Color
public MapRoute.RenderType getRenderType ()
Get the RenderType associated with this MapRoute.
Returns:
RenderType
public Route getRoute ()
Returns the Route that has been displayed on the Map .
Returns:
The Route
public boolean isManeuverNumberVisible ()
HERE SDK for Android Developer's Guide
► API Reference
478
Returns a boolean indicating whether maneuver numbers are displayed along with this route.
Returns:
True if maneuver numbers are displayed with the route, false otherwise
public MapRoute setColor (int argbColor)
Sets a color for displaying the route, using an ARGB (Alpha/Red/Green/Blue) integer color value.
Parameters:
argbColor
The ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green, blue. Each color component has a value range from [0..255],
with 0 meaning no contribution for that component and 255 meaning 100%
contribution
Returns:
The updated MapRoute itself.
See also:
android.graphics.Color
public MapRoute setManeuverNumberVisible (boolean visible)
Sets maneuver numbers to be either displayed along with this route or not displayed. By default,
maneuver number is invisible.
Parameters:
visible
A boolean specifying whether maneuver numbers are displayed
Returns:
The updated MapRoute itself.
public MapRoute setRenderType (MapRoute.RenderType type)
HERE SDK for Android Developer's Guide
► API Reference
479
Sets the RenderType associated with this MapRoute. Note changing the color will change the
RenderType to custom. Also note, the render type must be set before adding the MapRoute Object
to a Map
Parameters:
type
RenderType
Returns:
The updated MapRoute itself.
public MapRoute setRoute (Route route)
Sets a Route that will be displayed on the Map .
Parameters:
route
A Route representing the route to be displayed on the Map.
Returns:
The updated MapRoute itself.
RenderType
The enumeration RenderType is a member of com.here.android.mpa.mapping.MapRoute .
Enumeration Summary
public static final enumeration MapRoute.RenderType
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Render classification of the route.
[For complete information, see the section Enumeration Details]
HERE SDK for Android Developer's Guide
► API Reference
480
Enum Constant Summary
Table 186: Enum Constants in RenderType
Fields
public static final MapRoute.RenderType
PRIMARY
Default primary color of a route.
public static final MapRoute.RenderType
SECONDARY
Secondary color for alternate routes.
public static final MapRoute.RenderType
CUSTOM
Custom color.
Method Summary
Table 187: Methods in RenderType
Methods
public int
value ()
public static MapRoute.RenderType
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapRoute.RenderType[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Render classification of the route. Primary and Secondary routes have pre-defined colors and render
widths Custom routes are routes customized via MapRoute#setColor(int)
Enum Constant Details
public static final MapRoute.RenderType PRIMARY
Default primary color of a route.
public static final MapRoute.RenderType SECONDARY
Secondary color for alternate routes.
HERE SDK for Android Developer's Guide
► API Reference
481
public static final MapRoute.RenderType CUSTOM
Custom color.
Method Details
public int value ()
public static MapRoute.RenderType valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapRoute.RenderType[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
MapScreenMarker
The class MapScreenMarker is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapScreenMarker
extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject,
java.lang.Object
Represents a marker used to display an icon at a screen position on a map.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
Constructor Summary
Table 188: Constructors in MapScreenMarker
Constructors
MapScreenMarker ()
Default constructor.
MapScreenMarker (PointF position, Image icon)
Constructor
Method Summary
Table 189: Methods in MapScreenMarker
Methods
public PointF
getAnchorPoint ()
Gets the anchor point for the MapScreenMarker .
public Image
getIcon ()
Gets the icon image for the MapScreenMarker .
public PointF
getScreenCoordinate ()
Gets the screen location of the MapScreenMarker .
public float
getTransparency ()
Gets the current transparency level of the MapScreenMarker .
public MapScreenMarker
setAnchorPoint (PointF anchor)
Sets an anchor point for the MapScreenMarker .
public MapScreenMarker
setIcon (Image icon)
Sets an icon image for the MapScreenMarker .
public MapScreenMarker
setScreenCoordinate (PointF position)
Sets the screen location of the MapScreenMarker .
public MapScreenMarker
setTransparency (float alpha)
Sets a transparency level, within the range of [0..1], for the MapScreenMarker .
482
HERE SDK for Android Developer's Guide
► API Reference
483
Class Details
Represents a marker used to display an icon at a screen position on a map. The marker stays at its
screen location regardless of map movements such as panning and rotation.
MapScreenMarker are selectable MapObjects.
Constructor Details
MapScreenMarker ()
Default constructor. Call setIcon(Image) and {@link MapScreenMarker#setAnchorPoint(PointF) to
place the marker.
MapScreenMarker (PointF position, Image icon)
Constructor
Parameters:
position
Anchor position MapScreenMarker#setAnchorPoint(PointF)
icon
An Image representing the icon. MapScreenMarker#setIcon(Image)
Method Details
public PointF getAnchorPoint ()
Gets the anchor point for the MapScreenMarker .
By default, the MapScreenMarker is anchored at the center of the icon image.
Returns:
A PointF representing the anchor point of the MapScreenMarker.
public Image getIcon ()
Gets the icon image for the MapScreenMarker .
Returns:
An Image representing the icon.
HERE SDK for Android Developer's Guide
► API Reference
484
public PointF getScreenCoordinate ()
Gets the screen location of the MapScreenMarker .
Returns:
A PointF representing the screen location of the marker.
public float getTransparency ()
Gets the current transparency level of the MapScreenMarker .
The transparency level is only precise to two decimal places due to numerical operations performed
internally when rendering the map.
Returns:
The current transparency level of the MapScreenMarker.
public MapScreenMarker setAnchorPoint (PointF anchor)
Sets an anchor point for the MapScreenMarker .
The marker is drawn with the specified pixel offset from its getScreenCoordinate() position. To clear
an anchor set previously, pass a PointF to this method with an X-coordinate equal to half the width
of the marker and a Y-coordinate equal to half the height of the marker.
By default, the MapScreenMarker is anchored at the center of the icon image.
Parameters:
anchor
A PointF representing the anchor point of the MapScreenMarker.
Returns:
The updated MapScreenMarker itself.
public MapScreenMarker setIcon (Image icon)
Sets an icon image for the MapScreenMarker .
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
icon
485
An Image representing the icon.
public MapScreenMarker setScreenCoordinate (PointF position)
Sets the screen location of the MapScreenMarker .
Parameters:
position
A PointF
Returns:
The updated MapScreenMarker itself.
public MapScreenMarker setTransparency (float alpha)
Sets a transparency level, within the range of [0..1], for the MapScreenMarker .
Parameters:
alpha
Desired alpha value for the MapScreenMarker, 0 for fully transparent, 1
for fully opaque. Default value is 1.
Returns:
The modified MapScreenMarker itself.
MapState
The class MapState is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapState
implements android.os.Parcelable
extends java.lang.Object
Represents a composite class comprised of tilt, orientation, zoom level and center point for a Map.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
Constructor Summary
Table 190: Constructors in MapState
Constructors
MapState (float tilt, float orientation, double zoomLevel, GeoCoordinate center)
A constructor that initializes state values for tilt, orientation, zoom level, and map center.
Field Summary
Table 191: Fields in MapState
Fields
public static final android.os.Parcelable.Creator <com.here.android.mpa.mapping.MapState>
CREATOR
Method Summary
Table 192: Methods in MapState
Methods
public int
describeContents ()
For documentation, see android.os.Parcelable.describeContents()
public GeoCoordinate
getCenter ()
Returns the GeoCoordinate representing the center position.
public float
getOrientation ()
Returns the orientation, in degrees relative to true-north (which is designated as being an orientation of 0 degrees).
public float
getTilt ()
Returns the tilt, in degrees.
public double
getZoomLevel ()
Returns the zoom level.
public void
writeToParcel (Parcel dest, int flags)
For documentation, see android.os.Parcelable.writeToParcel()
486
HERE SDK for Android Developer's Guide
► API Reference
487
Class Details
Represents a composite class comprised of tilt, orientation, zoom level and center point for a Map.
This object can be retrieved by calling getMapState().
Constructor Details
MapState (float tilt, float orientation, double zoomLevel, GeoCoordinate
center)
A constructor that initializes state values for tilt, orientation, zoom level, and map center.
Parameters:
tilt
tilt value, in degrees
orientation
orientation value, in degrees, where true-north is 0 degrees
zoomLevel
zoom level value
center
A GeoCoordinate representing the center of the map
See also:
mapping.Map.setTilt (float)
mapping.Map.setOrientation (float)
mapping.Map.setZoomLevel (double)
Field Details
public static final android.os.Parcelable.Creator
<com.here.android.mpa.mapping.MapState> CREATOR
Method Details
public int describeContents ()
For documentation, see android.os.Parcelable.describeContents()
HERE SDK for Android Developer's Guide
► API Reference
488
public GeoCoordinate getCenter ()
Returns the GeoCoordinate representing the center position.
Returns:
The center position GeoCoordinate
public float getOrientation ()
Returns the orientation, in degrees relative to true-north (which is designated as being an orientation
of 0 degrees).
Returns:
orientation, in degrees relative to true-north
public float getTilt ()
Returns the tilt, in degrees.
Returns:
tilt, in degrees
public double getZoomLevel ()
Returns the zoom level.
Returns:
zoom level
public void writeToParcel (Parcel dest, int flags)
For documentation, see android.os.Parcelable.writeToParcel()
Parameters:
dest
flags
HERE SDK for Android Developer's Guide
► API Reference
MapTransitLayer
The class MapTransitLayer is a member of com.here.android.mpa.mapping .
Class Summary
public final class MapTransitLayer
extends java.lang.Object
Represents a Map layer that can display any combination of transit stops, accesses, and lines
(including none).
[For complete information, see the section Class Details]
See also:
mapping.Map.getMapTransitLayer ()
Nested Class Summary
Table 193: Nested Classes in MapTransitLayer
Nested Classes
public static final enumeration
MapTransitLayer.Mode
Represents values describing various ways to display public transit within a MapTransitLayer .
Method Summary
Table 194: Methods in MapTransitLayer
Methods
public void
clearTransitHighlights ()
Clears all MapTransitLayer elements, resetting them to a non-highlighted state.
public MapTransitLayer.Mode
getMode ()
Gets the Mode for the MapTransitLayer .
public void highlightTransitAccesses (java.util.List
<com.here.android.mpa.common.Identifier> ids)
Highlights a specified list of transit accesses.
489
HERE SDK for Android Developer's Guide
► API Reference
490
Methods
public void highlightTransitLineSegments (java.util.List
<com.here.android.mpa.common.Identifier> ids)
Highlights a specified list of transit segment lines.
public void
ids)
highlightTransitLines (java.util.List <com.here.android.mpa.common.Identifier>
Highlights a specified list of transit lines.
public void
ids)
highlightTransitStops (java.util.List <com.here.android.mpa.common.Identifier>
Highlights a specified list of transit stops.
public void
setMode (MapTransitLayer.Mode mode)
Sets a Mode for the MapTransitLayer .
Class Details
Represents a Map layer that can display any combination of transit stops, accesses, and lines
(including none).
See also:
mapping.Map.getMapTransitLayer ()
Method Details
public void clearTransitHighlights ()
Clears all MapTransitLayer elements, resetting them to a non-highlighted state.
public MapTransitLayer.Mode getMode ()
Gets the Mode for the MapTransitLayer .
Returns:
The Mode
public void highlightTransitAccesses (java.util.List
<com.here.android.mpa.common.Identifier> ids)
HERE SDK for Android Developer's Guide
► API Reference
491
Highlights a specified list of transit accesses. Previously highlighted lines remain highlighted until
clearTransitHighlights() is called to clear all highlighted objects.
Parameters:
ids
A list of IDs Identifier representing the accesses to highlight. If an
Identifier supplied does not match any transit accesses, it will be ignored.
See also:
mapping.TransitAccessInfo.getStopId ()
mapping.TransitStopInfo.getId ()
mapping.MapTransitLayer.clearTransitHighlights ()
public void highlightTransitLineSegments (java.util.List
<com.here.android.mpa.common.Identifier> ids)
Highlights a specified list of transit segment lines. Previously highlighted lines remain highlighted
until clearTransitHighlights() is called to clear all highlighted objects.
Parameters:
ids
A list of IDs Identifier representing the segment lines to highlight. If an
Identifier supplied does not match any transit segment lines, it will be
ignored.
See also:
mapping.TransitLineSegmentObject.getLineSegmentId ()
mapping.MapTransitLayer.clearTransitHighlights ()
public void highlightTransitLines (java.util.List
<com.here.android.mpa.common.Identifier> ids)
Highlights a specified list of transit lines. Previously highlighted lines remain highlighted until
clearTransitHighlights() is called to clear all highlighted objects.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
ids
492
A list of Identifiers representing the lines to highlight. If an Identifier supplied does not match any transit lines, it will be ignored.
See also:
mapping.TransitLineObject.getLineId ()
mapping.MapTransitLayer.clearTransitHighlights ()
public void highlightTransitStops (java.util.List
<com.here.android.mpa.common.Identifier> ids)
Highlights a specified list of transit stops. Previously highlighted lines remain highlighted until
clearTransitHighlights() is called to clear all highlighted objects.
Parameters:
ids
A list of Identifiers representing the stops to highlight. If an Identifier supplied does not match any transit stops, it will be ignored.
See also:
mapping.TransitAccessInfo.getStopId ()
mapping.TransitStopInfo.getId ()
mapping.MapTransitLayer.clearTransitHighlights ()
public void setMode (MapTransitLayer.Mode mode)
Sets a Mode for the MapTransitLayer . The default mode is STOPS_AND_ACCESSES.
Parameters:
mode
A Mode to set
Mode
The enumeration Mode is a member of com.here.android.mpa.mapping.MapTransitLayer .
HERE SDK for Android Developer's Guide
► API Reference
Enumeration Summary
public static final enumeration MapTransitLayer.Mode
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing various ways to display public transit within a MapTransitLayer .
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 195: Enum Constants in Mode
Fields
public static final MapTransitLayer.Mode
NOTHING
Hide all transit stops, accesses, and lines.
public static final MapTransitLayer.Mode
STOPS_AND_ACCESSES
(Default) Show transit stops and accesses, but hide transit lines.
public static final MapTransitLayer.Mode
EVERYTHING
Show transit stops, accesses, and lines.
Method Summary
Table 196: Methods in Mode
Methods
public int
getValue ()
public static MapTransitLayer.Mode
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static MapTransitLayer.Mode[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing various ways to display public transit within a MapTransitLayer .
493
HERE SDK for Android Developer's Guide
► API Reference
494
Enum Constant Details
public static final MapTransitLayer.Mode NOTHING
Hide all transit stops, accesses, and lines.
public static final MapTransitLayer.Mode STOPS_AND_ACCESSES
(Default) Show transit stops and accesses, but hide transit lines.
public static final MapTransitLayer.Mode EVERYTHING
Show transit stops, accesses, and lines.
Method Details
public int getValue ()
public static MapTransitLayer.Mode valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static MapTransitLayer.Mode[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
MapView
The class MapView is a member of com.here.android.mpa.mapping .
HERE SDK for Android Developer's Guide
► API Reference
Class Summary
public class MapView
extends java.lang.Object
Represents a map view.
[For complete information, see the section Class Details]
See also:
android.view.ViewGroup
Constructor Summary
Table 197: Constructors in MapView
Constructors
MapView (Context context)
Constructor that initializes the context.
MapView (Context context, AttributeSet attrs)
Constructor that initializes the context and a set of attributes.
Field Summary
Table 198: Fields in MapView
Fields
protected AttributeSet
m_attrs
protected MapScreenMarker
m_copyrightLogoMarker
protected boolean
m_copyrightLogoVisible
protected Context
m_ctx
protected View
m_viewImpl
protected MapProxy
m_viewProxy
495
HERE SDK for Android Developer's Guide
► API Reference
496
Method Summary
Table 199: Methods in MapView
Methods
public void
addOnMapRenderListener (OnMapRenderListener listener)
Adds a OnMapRenderListener to listen for map render events.
public void
addRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Adds a MapRenderListener to listen for map render events.
protected void
dispatchRestoreInstanceState (SparseArray container)
Override to prevent thawing of any child views.
protected void
dispatchSaveInstanceState (SparseArray container)
Override to prevent freezing of any child views.
public ViewRect
getClipRect ()
Gets the ViewRect representing the clip rectangle for the MapView .
public Rect
getCopyrightBoundaryRect ()
Gets the current rectangle relative to the MapView's boundary as a container for the HERE copyright logo.
public int
getCopyrightLogoHeight ()
Gets the height of the copyright logo.
public CopyrightLogoPosition
getCopyrightLogoPosition ()
Gets the current position for the HERE copyright logo.
public int
getCopyrightLogoVisibility ()
Gets the visibility of the HERE copyright logo.
public int
getCopyrightLogoWidth ()
Gets the width of the copyright logo.
public int
getCopyrightMargin ()
Gets the current margin, in pixels, for the HERE copyright logo, an offset from the edge of the visible map area to the edge
of the logo.
public Map
getMap ()
Returns the instance of Map associated with this MapView
public MapGesture
getMapGesture ()
HERE SDK for Android Developer's Guide
► API Reference
497
Methods
Gets the MapGesture representing the current gesture handler for the MapView .
public void
getScreenCapture (OnScreenCaptureListener listener)
Gets the full screen bitmap for the MapView.
protected void
onLayout (boolean changed, int left, int top, int right, int bottom)
For documentation, see android.view.ViewGroup
public void
onPause ()
Propagates an activity's onPause() event to the view.
public void
onRestoreInstanceState (Parcelable state)
Callback indicating that a stored view state was restored (e.g.
public void
onResume ()
Propagates an activity's onResume() event to the view.
public Parcelable
onSaveInstanceState ()
Callback indicating that the internal state of a view was saved for later use (e.g.
public void
removeOnMapRenderListener (OnMapRenderListener listener)
Removes an existing OnMapRenderListener.
public void
removeRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Removes an existing MapRenderListener.
public void
setClipRect (ViewRect rect, PointF transformCenter)
Sets a clipping rectangle to the MapView .
public void
setClipRect (ViewRect rect)
Sets a clipping rectangle to the MapView .
public void
setCopyrightBoundaryRect (Rect rect)
Sets a rectangle, in pixels, relative to the top left corner of the MapView's boundary, for the placement of the HERE
copyright logo.
public void
setCopyrightLogoPosition (CopyrightLogoPosition position)
Sets a position for the HERE copyright logo.
public void
setCopyrightMargin (int margin)
Sets a margin, in pixels, for the HERE copyright logo, an offset from the edge of the visible map area (or copyright boundary
rect, if used) to the edge of the logo (depending on the placement).
public void
setMap (Map aMap)
HERE SDK for Android Developer's Guide
► API Reference
498
Methods
Associates the graphical view element with a Map .
public void
setMapMarkerDragListener (MapMarker.OnDragListener listener)
Sets a MapMarker.OnDragListener to be invoked whenever any MapMarker added onto a Map that is attached to this
MapView is dragged.
public void
setOnTouchListener (View.OnTouchListener listener)
Sets an OnTouchListener to be invoked whenever a touch event is sent to the MapView .
Class Details
Represents a map view. This is the "View" UI class designed to handle all UI-related use cases,
including rendering and screen touch events.
Each MapView must be bound to a Map, and map-related objects should be persisted during
application runtime. MapView objects live and expire according to the associated activity's lifecycle.
A MapView is defined in an Android layout XML file. For example:
<com.here.android.mapping.MapView;
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="visible"/>
Each MapView should follow the regular android lifecycle. When an activity's onResume() and
onPause() are called, the view should also be notified via calls from within those methods. Please
take care in how much processing is done in the onResume() method of an activity. Performing
significant amounts of processing may delay the view rendering in cases such as device orientation
change. It is recommended to use a specifically designated handler for organizing the amount of
processing to be done in such cases.
Note that MapView does not notify the MapEngine when it is paused or resumed. User of MapView is
responsible for handling the pausing and resuming of the MapEngine if needed. Another option is to
utilize the MapActivity class when creating an activity with a MapView.
Although this class inherits from ViewGroup , it is not advisable for users to add children to
MapView as no layout actions will be performed on any added children views.
See also:
android.view.ViewGroup
HERE SDK for Android Developer's Guide
► API Reference
Constructor Details
MapView (Context context)
Constructor that initializes the context.
Parameters:
context
Context of the MapView
See also:
mapping.MapView.MapView (Context, AttributeSet)
android.content.Context
MapView (Context context, AttributeSet attrs)
Constructor that initializes the context and a set of attributes.
Parameters:
context
Context of the MapView
attrs
An AttributeSet representing attributes of the MapView
See also:
mapping.MapView.MapView (Context)
android.content.Context
android.util.AttributeSet
Field Details
protected AttributeSet m_attrs
protected MapScreenMarker m_copyrightLogoMarker
protected boolean m_copyrightLogoVisible
499
HERE SDK for Android Developer's Guide
► API Reference
protected Context m_ctx
protected View m_viewImpl
protected MapProxy m_viewProxy
Method Details
public void addOnMapRenderListener (OnMapRenderListener listener)
Adds a OnMapRenderListener to listen for map render events.
Parameters:
listener
See also:
public void addRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Use OnMapRenderListener with addOnMapRenderListener(OnMapRenderListener) instead. .
Adds a MapRenderListener to listen for map render events.
Parameters:
listener
A MapRenderListener to add to the MapView
See also:
mapping.MapView.removeRenderListener (MapRenderListener)
protected void dispatchRestoreInstanceState (SparseArray container)
500
HERE SDK for Android Developer's Guide
► API Reference
501
Override to prevent thawing of any child views. As child views created and added to the view group
dynamically have the same id as the parent, causing conflict when the state is saved, all child views
are blocked from being saved. Instead, this container will manually trigger the save and restore.
Parameters:
container
protected void dispatchSaveInstanceState (SparseArray container)
Override to prevent freezing of any child views. As child views created and added to the view group
dynamically have the same id as the parent, causing conflict when the state is saved, all child views
are blocked from being saved. Instead, this container will manually trigger the save and restore.
Parameters:
container
public ViewRect getClipRect ()
Gets the ViewRect representing the clip rectangle for the MapView .
Returns:
The clip rectangle for rendering MapObject objects and similar map-related screen elements
public Rect getCopyrightBoundaryRect ()
Gets the current rectangle relative to the MapView's boundary as a container for the HERE copyright
logo. null is returned unless a boundary rect has been set previously.
Returns:
The boundary rect (null if not set).
See also:
mapping.MapView.getClipRect ()
mapping.MapView.setCopyrightBoundaryRect (Rect)
public int getCopyrightLogoHeight ()
HERE SDK for Android Developer's Guide
► API Reference
502
Gets the height of the copyright logo.
This method only returns a valid value once a Map has been set to this view.
Returns:
The height of the copyright logo in pixels. Returns -1 if unavailable.
public CopyrightLogoPosition getCopyrightLogoPosition ()
Gets the current position for the HERE copyright logo.
Returns:
The position of the logo.
public int getCopyrightLogoVisibility ()
Gets the visibility of the HERE copyright logo. Copyright logo is defaulted to be visible. Once changed,
the visibility of logo stays effective even when the screen is rotated or re-created.
Returns:
One of the two values View.VISIBLE or View.INVISIBLE to represent the copyright logo's
visibility.
public int getCopyrightLogoWidth ()
Gets the width of the copyright logo.
This method only returns a valid value once a Map has been set to this view.
Returns:
The width of the copyright logo in pixels. Returns -1 if unavailable.
public int getCopyrightMargin ()
Gets the current margin, in pixels, for the HERE copyright logo, an offset from the edge of the visible
map area to the edge of the logo.
This method only returns a valid value once a Map has been set to this view.
Returns:
HERE SDK for Android Developer's Guide
► API Reference
503
The current offset from the edge of the MapView
public Map getMap ()
Returns the instance of Map associated with this MapView
Returns:
The Map object currently displayed in this view.
public MapGesture getMapGesture ()
Gets the MapGesture representing the current gesture handler for the MapView . Applications can
intercept this object and override the default events.
Returns:
The MapGesture
public void getScreenCapture (OnScreenCaptureListener listener)
Gets the full screen bitmap for the MapView. This API can be used to capture a screen shot of
the MapView. The API is asynchronous and will callback once the operation is completed via
OnScreenCaptureListener. Note the MapView must be visible to create the screen capture.
Parameters:
listener
A OnScreenCaptureListener to callback on screen capture completion.
protected void onLayout (boolean changed, int left, int top, int right, int
bottom)
For documentation, see android.view.ViewGroup
Parameters:
changed
left
top
right
HERE SDK for Android Developer's Guide
► API Reference
bottom
504
public void onPause ()
Propagates an activity's onPause() event to the view. Applications can call this method within
the onPause() method of any activity which has a MapView as part of its view hierarchy. Note
that unlike MapFragment, MapView does not automatically handle the pausing and/or resuming of
MapEngine. Owner of MapView is responsible to address the handling of onPause() if needed.
See also:
mapping.MapFragment.onPause ()
common.MapEngine.onPause ()
public void onRestoreInstanceState (Parcelable state)
Callback indicating that a stored view state was restored (e.g. to create a new MapView with the same
state).
Parameters:
state
An android.os.Parcelable in which the view state was stored
See also:
android.view.View.onRestoreInstanceState(Parcelable)
public void onResume ()
Propagates an activity's onResume() event to the view. Applications can call this method within
the onResume() method of any activity which has a MapView as part of its view hierarchy. Note
that unlike MapFragment, MapView does not automatically handle the pausing and/or resuming of
MapEngine. Owner of MapView is responsible to address the handling of onResume() if needed.
See also:
mapping.MapFragment.onResume ()
common.MapEngine.onResume ()
public Parcelable onSaveInstanceState ()
HERE SDK for Android Developer's Guide
► API Reference
505
Callback indicating that the internal state of a view was saved for later use (e.g. to create a new
MapView with the same state).
Returns:
The android.os.Parcelable for storing the view state
See also:
android.view.View.onSaveInstanceState()
public void removeOnMapRenderListener (OnMapRenderListener listener)
Removes an existing OnMapRenderListener.
Parameters:
listener
public void removeRenderListener (MapRenderListener listener)
Deprecated: As of SDK 2.1.1.
Use OnMapRenderListener with removeOnMapRenderListener(OnMapRenderListener) instead.
Removes an existing MapRenderListener.
Parameters:
listener
A MapRenderListener to remove from the MapView
See also:
public void setClipRect (ViewRect rect, PointF transformCenter)
Sets a clipping rectangle to the MapView .
The center of the map is not moved and remains at the center of the map control. Only the
ViewRect specified here will be used for rendering.
Note that the size of the map remains the same as the size of the map control.
The clipping rectangle (and the view rectangle) is reset to full-screen upon screen rotation or upon
recreating the screen.
HERE SDK for Android Developer's Guide
► API Reference
506
Moreover, setting the clipping rectangle will reset the view rectangle to full-screen.
Parameters:
rect
A ViewRect for rendering MapObject objects and similar map-related
screen elements
transformCenter
A PointF representing the center coordinate for map transformations such
as zooming and rotation
See also:
mapping.MapView.setClipRect (ViewRect)
public void setClipRect (ViewRect rect)
Sets a clipping rectangle to the MapView .
Note that the size of the map remains the same as the size of the map control.
The clipping rectangle (and the view rectangle) is reset to full-screen upon screen rotation or upon
recreating the screen.
Parameters:
rect
A ViewRect for rendering MapObject objects and similar map-related
screen elements
See also:
mapping.MapView.setClipRect (ViewRect, PointF)
public void setCopyrightBoundaryRect (Rect rect)
Sets a rectangle, in pixels, relative to the top left corner of the MapView's boundary, for the
placement of the HERE copyright logo.
If the specified rectangle is not contained completely within the current visible map area, their area
of intersection will be used instead of the specified rectangle's area. If the specified rectangle is
outside the current visible map area, it will be ignored. The copyright logo and copyright margin must
fit into the rectangle, otherwise specified rectangle will be ignored.
The copyright boundary rectangle is reset upon screen rotation or upon screen re-creation.
HERE SDK for Android Developer's Guide
► API Reference
507
Parameters:
rect
A Rect representing the rectangular container to position the copyright logo. Use null Rect to reset the boundary container.
public void setCopyrightLogoPosition (CopyrightLogoPosition position)
Sets a position for the HERE copyright logo. The current default is to place the logo at the centerbottom of the visible map view area.
Note: after the logo's position is set, it stays effective even when the screen is rotated or re-created.
Parameters:
position
A CopyrightLogoPosition value representing the desired placement of the
HERE copyright logo with respect to the visible map view area
public void setCopyrightMargin (int margin)
Sets a margin, in pixels, for the HERE copyright logo, an offset from the edge of the visible map
area (or copyright boundary rect, if used) to the edge of the logo (depending on the placement). The
logo and margin must fit into the visible area (or copyright bounding rect). Therefore, the maximum
allowed margin value is: (bounding rect dimension - logo size) / 2. The default (minimum) margin
value is 1/2 of logo width. A margin value smaller than the default will not be saved.
Parameters:
margin
Desired offset from the edge of the MapView
See also:
mapping.MapView.setCopyrightBoundaryRect (Rect)
public void setMap (Map aMap)
Associates the graphical view element with a Map . Applications must call this method to bind the
MapView and Map .
Note: the Map that gets passed as a parameter to this method could be null , in which case all
listeners will be cleaned up.
HERE SDK for Android Developer's Guide
► API Reference
508
Users are advised to call setMap(Map) with null to detach the map only after the onPause() is called
to avoid memory leaks.
Parameters:
aMap
A Map to associate with the MapView (could be null)
public void setMapMarkerDragListener (MapMarker.OnDragListener listener)
Sets a MapMarker.OnDragListener to be invoked whenever any MapMarker added onto a Map that is
attached to this MapView is dragged.
Parameters:
listener
An MapMarker.OnDragListener to set for this MapView
public void setOnTouchListener (View.OnTouchListener listener)
Sets an OnTouchListener to be invoked whenever a touch event is sent to the MapView .
Parameters:
listener
An OnTouchListener to set for the MapView
See also:
android.view.View.OnTouchListener
Mesh
The class Mesh is a member of com.here.android.mpa.mapping .
Class Summary
public abstract class Mesh
extends java.lang.Object
Represents a base class specifying common mesh data for a MapGeoModelObject or
MapLocalModelObject .
HERE SDK for Android Developer's Guide
► API Reference
509
[For complete information, see the section Class Details]
Constructor Summary
Table 200: Constructors in Mesh
Constructors
Mesh (MeshImpl impl)
Method Summary
Table 201: Methods in Mesh
Methods
public Mesh
setTextureCoordinates (FloatBuffer uvCoordinates)
Sets a FloatBuffer representing a list of uv coordinates for the mesh.
public Mesh
setVertexIndices (IntBuffer triangles)
Sets an IntBuffer representing a list of mesh triangles to render.
Class Details
Represents a base class specifying common mesh data for a MapGeoModelObject or
MapLocalModelObject .
Properties of a mesh include:
•
•
•
Vertex positions - positions of the mesh vertices (the maximum number of positions is 65536).
Note: the number of vertex positions should match the number of vertex texture coordinates,
and both should be equal to the number of vertices in the mesh data.
Vertex texture coordinates - coordinates within the range of [0..1], used to reference the
specified texture image (the maximum number of texture coordinates is 65536). Note: the
number of vertex texture coordinates should match the number of vertex positions, and both
should be equal to the number of vertices in the mesh data.
Triangles - the triangular faces of the mesh, defined as three indices referencing the
corresponding set of vertices.
Constructor Details
Mesh (MeshImpl impl)
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
impl
510
Method Details
public Mesh setTextureCoordinates (FloatBuffer uvCoordinates)
Sets a FloatBuffer representing a list of uv coordinates for the mesh. The buffer should be in pairs
for each coordinate, where each pair is in the format uv( u, v ) and within the range of [0..1].
Parameters:
uvCoordinates
A FloatBuffer of desired mesh uv coordinates
Returns:
The updated Mesh
See also:
java.nio.FloatBuffer
public Mesh setVertexIndices (IntBuffer triangles)
Sets an IntBuffer representing a list of mesh triangles to render. The buffer should be in triplets
for each triangle, where each triplet is in the format t( v1, v2, v3 ) .
Parameters:
triangles
A IntBuffer of desired mesh triangles
Returns:
The updated Mesh
See also:
java.nio.IntBuffer
OnMapRenderListener
The interface OnMapRenderListener is a member of com.here.android.mpa.mapping .
HERE SDK for Android Developer's Guide
► API Reference
511
Interface Summary
public abstract interface OnMapRenderListener
Represents an abstract class listener to provide notification upon completion of a Map rendering
event.
[For complete information, see the section Interface Details]
See also:
mapping.MapFragment.addOnMapRenderListener (OnMapRenderListener)
mapping.MapFragment.removeOnMapRenderListener (OnMapRenderListener)
mapping.MapCompatibilityFragment.addOnMapRenderListener (OnMapRenderListener)
mapping.MapCompatibilityFragment.removeOnMapRenderListener (OnMapRenderListener)
mapping.MapView.addOnMapRenderListener (OnMapRenderListener)
Nested Class Summary
Table 202: Nested Classes in OnMapRenderListener
Nested Classes
public static abstract class
OnMapRenderListener.OnMapRenderListenerAdapter
Default implementation for the OnMapRenderListener interface.
Method Summary
Table 203: Methods in OnMapRenderListener
Methods
public abstract void
onGraphicsDetached ()
Callback indicating that the map renderer has been cleanly detached from the view.
public abstract void
onPostDraw (boolean invalidated, long renderTime)
Callback indicating that a Map drawing event has ended.
public abstract void
onPreDraw ()
Callback indicating that a Map drawing event is about to occur.
public abstract void
onRenderBufferCreated ()
HERE SDK for Android Developer's Guide
► API Reference
512
Methods
Callback indicating that the map render buffer has been created.
public abstract void
onSizeChanged (int width, int height)
Callback indicating that a Map size has changed following a rotation.
Interface Details
Represents an abstract class listener to provide notification upon completion of a Map rendering
event.
See also:
mapping.MapFragment.addOnMapRenderListener (OnMapRenderListener)
mapping.MapFragment.removeOnMapRenderListener (OnMapRenderListener)
mapping.MapCompatibilityFragment.addOnMapRenderListener (OnMapRenderListener)
mapping.MapCompatibilityFragment.removeOnMapRenderListener (OnMapRenderListener)
mapping.MapView.addOnMapRenderListener (OnMapRenderListener)
Method Details
public abstract void onGraphicsDetached ()
Callback indicating that the map renderer has been cleanly detached from the view.
public abstract void onPostDraw (boolean invalidated, long renderTime)
Callback indicating that a Map drawing event has ended. Applications can perform custom rendering
when this callback is sent.
Note: This callback is made on the rendering thread.
Parameters:
invalidated
A boolean specifying whether the map is invalidated and will redraw
renderTime
The time taken to render the map
HERE SDK for Android Developer's Guide
► API Reference
513
public abstract void onPreDraw ()
Callback indicating that a Map drawing event is about to occur. Applications can perform custom
rendering when this callback is sent.
This callback is preferred to onPostDraw(boolean, long) when making changes to MapObjects as the
changes can be made during the upcoming draw and another Map invalidation will not need to take
place.
Note: This callback is made on the rendering thread.
public abstract void onRenderBufferCreated ()
Callback indicating that the map render buffer has been created.
Note: This callback is made on the rendering thread.
public abstract void onSizeChanged (int width, int height)
Callback indicating that a Map size has changed following a rotation. Applications can perform
custom rendering when this callback is sent.
Note: This callback is made on the UI thread.
Parameters:
width
A post-rotation width
height
A post-rotation height
OnMapRenderListenerAdapter
The class OnMapRenderListenerAdapter is a member of
com.here.android.mpa.mapping.OnMapRenderListener .
Class Summary
public static abstract class OnMapRenderListener.OnMapRenderListenerAdapter
implements com.here.android.mpa.mapping.OnMapRenderListener
extends java.lang.Object
HERE SDK for Android Developer's Guide
► API Reference
514
Default implementation for the OnMapRenderListener interface.
[For complete information, see the section Class Details]
See also:
Constructor Summary
Table 204: Constructors in OnMapRenderListenerAdapter
Constructors
OnMapRenderListenerAdapter ()
Method Summary
Table 205: Methods in OnMapRenderListenerAdapter
Methods
public void
onGraphicsDetached ()
public void
onPostDraw (boolean invalidated, long renderTime)
public void
onPreDraw ()
public void
onRenderBufferCreated ()
public void
onSizeChanged (int width, int height)
Class Details
Default implementation for the OnMapRenderListener interface. Users may use this abstract class
and overload specific methods to have a smaller code footprint.
See also:
Constructor Details
OnMapRenderListenerAdapter ()
HERE SDK for Android Developer's Guide
► API Reference
Method Details
public void onGraphicsDetached ()
public void onPostDraw (boolean invalidated, long renderTime)
Parameters:
invalidated
renderTime
public void onPreDraw ()
public void onRenderBufferCreated ()
public void onSizeChanged (int width, int height)
Parameters:
width
height
OperatingHours
The class OperatingHours is a member of com.here.android.mpa.mapping .
Class Summary
public final class OperatingHours
extends java.lang.Object
Represents the hours of operation for different days of the week, plus holidays.
[For complete information, see the section Class Details]
515
HERE SDK for Android Developer's Guide
516
► API Reference
Method Summary
Table 206: Methods in OperatingHours
Methods
public java.util.List <com.here.android.mpa.common.TimeInterval>
getFridaySchedule ()
Friday schedule as a list of TimeInverval TimeInverval .
public java.util.List <com.here.android.mpa.common.TimeInterval>
getHolidaySchedule ()
Holiday schedule as a list of TimeInverval TimeInverval .
public java.util.List <com.here.android.mpa.common.TimeInterval>
getMondaySchedule ()
Monday schedule as a list of TimeInverval TimeInverval .
public java.util.List <com.here.android.mpa.common.TimeInterval>
getSaturdaySchedule ()
Saturday schedule as a list of TimeInverval TimeInverval .
public java.util.List <com.here.android.mpa.common.TimeInterval>
getSundaySchedule ()
Sunday schedule as a list of TimeInverval TimeInverval .
public java.util.List <com.here.android.mpa.common.TimeInterval>
getThursdaySchedule ()
Thursday schedule as a list of TimeInverval TimeInverval .
public java.util.List <com.here.android.mpa.common.TimeInterval>
getTuesdaySchedule ()
Tuesday schedule as a list of TimeInverval TimeInverval .
public java.util.List <com.here.android.mpa.common.TimeInterval>
getWednesdaySchedule ()
Wednesday schedule as a list of TimeInverval TimeInverval .
Class Details
Represents the hours of operation for different days of the week, plus holidays. For each day, the
operating hours are a non-overlapping sequence of intervals in increasing order of time. Used for
specifying hours of operation for services.
Method Details
public java.util.List <com.here.android.mpa.common.TimeInterval>
getFridaySchedule ()
Friday schedule as a list of TimeInverval TimeInverval .
Returns:
HERE SDK for Android Developer's Guide
► API Reference
The array that contains the TimeInverval TimeInverval
public java.util.List <com.here.android.mpa.common.TimeInterval>
getHolidaySchedule ()
Holiday schedule as a list of TimeInverval TimeInverval .
Returns:
The array that contains the TimeInverval TimeInverval
public java.util.List <com.here.android.mpa.common.TimeInterval>
getMondaySchedule ()
Monday schedule as a list of TimeInverval TimeInverval .
Returns:
The array that contains the TimeInverval TimeInverval
public java.util.List <com.here.android.mpa.common.TimeInterval>
getSaturdaySchedule ()
Saturday schedule as a list of TimeInverval TimeInverval .
Returns:
The array that contains the TimeInverval TimeInverval
public java.util.List <com.here.android.mpa.common.TimeInterval>
getSundaySchedule ()
Sunday schedule as a list of TimeInverval TimeInverval .
Returns:
The array that contains the TimeInverval TimeInverval
public java.util.List <com.here.android.mpa.common.TimeInterval>
getThursdaySchedule ()
Thursday schedule as a list of TimeInverval TimeInverval .
517
HERE SDK for Android Developer's Guide
► API Reference
Returns:
The array that contains the TimeInverval TimeInverval
public java.util.List <com.here.android.mpa.common.TimeInterval>
getTuesdaySchedule ()
Tuesday schedule as a list of TimeInverval TimeInverval .
Returns:
The array that contains the TimeInverval TimeInverval
public java.util.List <com.here.android.mpa.common.TimeInterval>
getWednesdaySchedule ()
Wednesday schedule as a list of TimeInverval TimeInverval .
Returns:
The array that contains the TimeInverval TimeInverval
PositionIndicator
The class PositionIndicator is a member of com.here.android.mpa.mapping .
Class Summary
public final class PositionIndicator
extends java.lang.Object
Represents a class for rendering a map marker to indicate the current position.
[For complete information, see the section Class Details]
See also:
518
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 207: Methods in PositionIndicator
Methods
public Image
getMarker ()
Gets the current marker image.
public int
getZIndex ()
Get the Z index of the position indicator.
public boolean
isAccuracyIndicatorVisible ()
Gets the current visibility state of the GPS accuracy indicator.
public boolean
isVisible ()
Gets the boolean indicating whether the PositionIndicator instance is visible.
public PositionIndicator
setAccuracyIndicatorVisible (boolean visible)
Sets a GPS accuracy indicator for the PositionIndicator to be either visible or hidden.
public PositionIndicator
setMarker (Image marker)
Sets a marker image, overriding the default marker image.
public PositionIndicator
setVisible (boolean visible)
Sets a PositionIndicator to be either visible or hidden.
public PositionIndicator
setZIndex (int index)
Set the Z index of the position indicator.
Class Details
Represents a class for rendering a map marker to indicate the current position. The marker is
surrounded by a circle, the diameter of which illustrates the accuracy of the marked position.
See also:
Method Details
public Image getMarker ()
Gets the current marker image.
Returns:
519
HERE SDK for Android Developer's Guide
► API Reference
520
The marker Image used to display the current position on a map
public int getZIndex ()
Get the Z index of the position indicator.
Returns:
int current z index.
public boolean isAccuracyIndicatorVisible ()
Gets the current visibility state of the GPS accuracy indicator.
Returns:
True if the GPS accuracy indicator is visible, false otherwise
public boolean isVisible ()
Gets the boolean indicating whether the PositionIndicator instance is visible.
Returns:
True if the PositionIndicator is visible, false otherwise
public PositionIndicator setAccuracyIndicatorVisible (boolean visible)
Sets a GPS accuracy indicator for the PositionIndicator to be either visible or hidden. Accuracy is
represented by a circle surrounding the marked position, with a smaller diameter representing higher
accuracy. The default is the GPS accuracy is visible.
Note: if the PositionIndicator is hidden, the GPS accuracy indicator will be hidden as well.
Parameters:
visible
A boolean specifying whether the accuracy indicator should be visible
Returns:
PositionIndicator this object for method chaining.
See also:
mapping.PositionIndicator.setVisible (boolean)
HERE SDK for Android Developer's Guide
► API Reference
521
public PositionIndicator setMarker (Image marker)
Sets a marker image, overriding the default marker image.
Parameters:
marker
An Image representing the marker used to display the current position on a
map
Returns:
PositionIndicator this object for method chaining.
public PositionIndicator setVisible (boolean visible)
Sets a PositionIndicator to be either visible or hidden. By default, the position indicator is
invisible.
Parameters:
visible
A boolean specifying PositionIndicator visibility
Returns:
PositionIndicator this object for method chaining.
public PositionIndicator setZIndex (int index)
Set the Z index of the position indicator. The default Z-Index is currently the max value supported.
Parameters:
index
A new z-index value for the MapObject, a 16-bit int within the range of
[0..65535]
Returns:
PositionIndicator this object for method chaining.
See also:
mapping.MapObject.setZIndex (int)
HERE SDK for Android Developer's Guide
► API Reference
TransitAccessInfo
The class TransitAccessInfo is a member of com.here.android.mpa.mapping .
Class Summary
public final class TransitAccessInfo
extends java.lang.Object
Data structure class containing information about Transit Access locations.
[For complete information, see the section Class Details]
Nested Class Summary
Table 208: Nested Classes in TransitAccessInfo
Nested Classes
public static final enumeration
TransitAccessInfo.Attribute
Represents values describing the attributes of transit access.
public static final enumeration
TransitAccessInfo.Method
Represents values describing the accessible methods of transit access.
Method Summary
Table 209: Methods in TransitAccessInfo
Methods
public java.util.EnumSet <com.here.android.mpa.mapping.TransitAccessInfo.Attribute>
getAttributes ()
Gets all the Attribute of the transit access.
public GeoCoordinate
getCoordinate ()
Gets the position GeoCoordinate for the transit access.
public java.util.EnumSet <com.here.android.mpa.mapping.TransitAccessInfo.Method>
getEntranceMethods ()
Gets all the entrance Method s provided by the transit access.
public java.util.EnumSet <com.here.android.mpa.mapping.TransitAccessInfo.Method>
getExitMethods ()
522
HERE SDK for Android Developer's Guide
523
► API Reference
Methods
Gets all the exit Method s provided by the transit access.
public Identifier
getId ()
Gets the Identifier for the transit access.
public int
getLevel ()
Gets the access level.
public String
getName ()
Gets the name for the transit access.
public OperatingHours
getOpeningHours ()
Gets the opening hours.
public Identifier
getStopId ()
Gets the Identifier for the stop at the transit access.
public java.util.EnumSet <com.here.android.mpa.common.TransitType>
getTransitTypes ()
Gets all the TransitTypes the transit access supports.
Class Details
Data structure class containing information about Transit Access locations. TransitAccessObject
Method Details
public java.util.EnumSet
<com.here.android.mpa.mapping.TransitAccessInfo.Attribute> getAttributes ()
Gets all the Attribute of the transit access.
Returns:
A EnumSet containing all the Attributes of the transit access.
public GeoCoordinate getCoordinate ()
Gets the position GeoCoordinate for the transit access.
Returns:
position of the transit access.
HERE SDK for Android Developer's Guide
► API Reference
524
public java.util.EnumSet
<com.here.android.mpa.mapping.TransitAccessInfo.Method> getEntranceMethods
()
Gets all the entrance Method s provided by the transit access.
Returns:
A EnumSet containing all the entrance Methods provided by the transit access.
public java.util.EnumSet
<com.here.android.mpa.mapping.TransitAccessInfo.Method> getExitMethods ()
Gets all the exit Method s provided by the transit access.
Returns:
A EnumSet containing all the exit Methods provided by the transit access.
public Identifier getId ()
Gets the Identifier for the transit access. TransitDatabase
Returns:
the unique object Identifier.
public int getLevel ()
Gets the access level.
Returns:
the access level.
public String getName ()
Gets the name for the transit access. This text is localized according to the device's locale.
Returns:
name of the transit access.
HERE SDK for Android Developer's Guide
► API Reference
public OperatingHours getOpeningHours ()
Gets the opening hours.
Returns:
The OperatingHours representing the opening hours of this transit access.
public Identifier getStopId ()
Gets the Identifier for the stop at the transit access. TransitDatabase
Returns:
the unique object Identifier.
public java.util.EnumSet <com.here.android.mpa.common.TransitType>
getTransitTypes ()
Gets all the TransitTypes the transit access supports.
Returns:
A EnumSet containing all the supported TransitTypes.
Attribute
The enumeration Attribute is a member of com.here.android.mpa.mapping.TransitAccessInfo .
Enumeration Summary
public static final enumeration TransitAccessInfo.Attribute
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing the attributes of transit access.
[For complete information, see the section Enumeration Details]
525
HERE SDK for Android Developer's Guide
526
► API Reference
Enum Constant Summary
Table 210: Enum Constants in Attribute
Fields
public static final TransitAccessInfo.Attribute
ALLOWS_ENTERING
Transit access allows to enter.
public static final TransitAccessInfo.Attribute
ALLOWS_EXITING
Transit access allows to exit.
public static final TransitAccessInfo.Attribute
ACCESSIBLE_TO_DISABLED
Transit access accessible to disability.
public static final TransitAccessInfo.Attribute
LEVEL_DIFFERENT_FROM_GROUND
Transit access's level is different from ground.
public static final TransitAccessInfo.Attribute
HAS_NAMES
Transit access has proper name.
Method Summary
Table 211: Methods in Attribute
Methods
public static TransitAccessInfo.Attribute
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static TransitAccessInfo.Attribute[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the attributes of transit access.
Enum Constant Details
public static final TransitAccessInfo.Attribute ALLOWS_ENTERING
Transit access allows to enter.
HERE SDK for Android Developer's Guide
► API Reference
527
public static final TransitAccessInfo.Attribute ALLOWS_EXITING
Transit access allows to exit.
public static final TransitAccessInfo.Attribute ACCESSIBLE_TO_DISABLED
Transit access accessible to disability.
public static final TransitAccessInfo.Attribute LEVEL_DIFFERENT_FROM_GROUND
Transit access's level is different from ground.
public static final TransitAccessInfo.Attribute HAS_NAMES
Transit access has proper name.
Method Details
public static TransitAccessInfo.Attribute valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static TransitAccessInfo.Attribute[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Method
The enumeration Method is a member of com.here.android.mpa.mapping.TransitAccessInfo .
HERE SDK for Android Developer's Guide
► API Reference
Enumeration Summary
public static final enumeration TransitAccessInfo.Method
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing the accessible methods of transit access.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 212: Enum Constants in Method
Fields
public static final TransitAccessInfo.Method
STAIRS
Transit access has stairs access.
public static final TransitAccessInfo.Method
ESCALATOR
Transit access has escalator access.
public static final TransitAccessInfo.Method
ELEVATOR
Transit access has elevator access.
public static final TransitAccessInfo.Method
PEDESTRIAN_RAMP
Transit access has pedestrian ramp access.
Method Summary
Table 213: Methods in Method
Methods
public static TransitAccessInfo.Method
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static TransitAccessInfo.Method[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the accessible methods of transit access.
528
HERE SDK for Android Developer's Guide
► API Reference
529
Enum Constant Details
public static final TransitAccessInfo.Method STAIRS
Transit access has stairs access.
public static final TransitAccessInfo.Method ESCALATOR
Transit access has escalator access.
public static final TransitAccessInfo.Method ELEVATOR
Transit access has elevator access.
public static final TransitAccessInfo.Method PEDESTRIAN_RAMP
Transit access has pedestrian ramp access.
Method Details
public static TransitAccessInfo.Method valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static TransitAccessInfo.Method[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
TransitAccessObject
The class TransitAccessObject is a member of com.here.android.mpa.mapping .
HERE SDK for Android Developer's Guide
530
► API Reference
Class Summary
public final class TransitAccessObject
extends com.here.android.mpa.mapping.MapProxyObject,
com.here.android.mpa.common.ViewObject, java.lang.Object
Encapsulates information about a public transit access point on a map.
[For complete information, see the section Class Details]
See also:
mapping.Map.getSelectedObjects (PointF)
mapping.Map.getSelectedObjectsNearby (PointF)
mapping.Map.getSelectedObjects (ViewRect)
Method Summary
Table 214: Methods in TransitAccessObject
Methods
public GeoCoordinate
getCoordinate ()
Gets the GeoCoordinate representing the position of the transit access icon on the map.
public java.util.List <com.here.android.mpa.common.Image>
getIcons ()
Get the list of icons associated with the TransitAccessObject .
public TransitAccessInfo
getTransitAccessInfo ()
Gets the TransitAccessInfo associated with the TransitAccessObject .
Class Details
Encapsulates information about a public transit access point on a map.
A TransitAccessObject represents a specialized MapProxyObject. Users can retrieve an instance
of this object with a call to either getSelectedObjects(PointF) or getSelectedObjectsNearby(PointF) or
getSelectedObjects(ViewRect) at the point or area where a public transit access point exists.
See also:
mapping.Map.getSelectedObjects (PointF)
mapping.Map.getSelectedObjectsNearby (PointF)
mapping.Map.getSelectedObjects (ViewRect)
HERE SDK for Android Developer's Guide
► API Reference
531
Method Details
public GeoCoordinate getCoordinate ()
Gets the GeoCoordinate representing the position of the transit access icon on the map.
Returns:
The GeoCoordinate where the transit access object is located.
public java.util.List <com.here.android.mpa.common.Image> getIcons ()
Get the list of icons associated with the TransitAccessObject .
Returns:
List of icon Images.
public TransitAccessInfo getTransitAccessInfo ()
Gets the TransitAccessInfo associated with the TransitAccessObject . A TransitAccessInfo
instance contains information about the types of transit that can be accessed at a particular transit
access point, as well as the Identifier of any transit stop that is associated with the access point.
Returns:
The TransitAccessInfo
TransitDatabase
The class TransitDatabase is a member of com.here.android.mpa.mapping .
Class Summary
public final class TransitDatabase
extends java.lang.Object
Represents an interface used to get information about public transit elements.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
532
Nested Class Summary
Table 215: Nested Classes in TransitDatabase
Nested Classes
public static final enumeration
TransitDatabase.Error
Represents values describing possible kinds of errors that can be encountered while initiating an asynchronous request to a
TransitDatabase.
public static abstract interface
TransitDatabase.OnGetTransitInfoListener
Represents a listener to provide information about TransitDatabase events.
public static abstract class
TransitDatabase.OnGetTransitInfoListenerAdapter
Represents a listener to provide information about TransitDatabase events.
Constructor Summary
Table 216: Constructors in TransitDatabase
Constructors
TransitDatabase ()
Constructor.
Method Summary
Table 217: Methods in TransitDatabase
Methods
public void
cancel ()
Cancels the current request for transit information.
public TransitDatabase.Error getAccessInfo (Identifier id,
TransitDatabase.OnGetTransitInfoListener listener)
Initiates an asynchronous request for information about a transit access.
public TransitDatabase.Error getLineInfo (Identifier id,
TransitDatabase.OnGetTransitInfoListener listener)
Initiates an asynchronous request for information about a transit line.
public TransitDatabase.Error getStopInfo (Identifier id,
TransitDatabase.OnGetTransitInfoListener listener)
Initiates an asynchronous request for information about a transit stop.
HERE SDK for Android Developer's Guide
► API Reference
533
Methods
public TransitDatabase.Error getSystemInfo (Identifier id,
TransitDatabase.OnGetTransitInfoListener listener)
Initiates an asynchronous request for information about a transit system.
Class Details
Represents an interface used to get information about public transit elements.
Constructor Details
TransitDatabase ()
Constructor. Instantiates an instance of the transit database.
Method Details
public void cancel ()
Cancels the current request for transit information.
public TransitDatabase.Error getAccessInfo (Identifier id,
TransitDatabase.OnGetTransitInfoListener listener)
Initiates an asynchronous request for information about a transit access.
Parameters:
id
An unique Identifier for the transit access
listener
An OnGetTransitInfoListener to provide information about TransitDatabase events
Returns:
The appropriate Error value, which could be:
•
•
•
NONE if the asynchronous request started successfully
INVALID_OPERATION if another request operation is already in progress
INVALID_PARAMETERS if any of the input parameters is invalid
See also:
HERE SDK for Android Developer's Guide
► API Reference
534
mapping.TransitAccessInfo.getId ()
public TransitDatabase.Error getLineInfo (Identifier id,
TransitDatabase.OnGetTransitInfoListener listener)
Initiates an asynchronous request for information about a transit line.
Parameters:
id
An unique Identifier for the transit line
listener
An OnGetTransitInfoListener to provide information about TransitDatabase events
Returns:
The appropriate Error value, which could be:
•
•
•
NONE if the asynchronous request started successfully
INVALID_OPERATION if another request operation is already in progress
INVALID_PARAMETERS if any of the input parameters is invalid
See also:
mapping.TransitLineInfo.getId ()
mapping.TransitLineObject.getLineId ()
mapping.TransitLineSegmentObject.getLineId ()
mapping.TransitStopInfo.getLines ()
public TransitDatabase.Error getStopInfo (Identifier id,
TransitDatabase.OnGetTransitInfoListener listener)
Initiates an asynchronous request for information about a transit stop.
Parameters:
id
An unique Identifier for the transit stop
listener
An OnGetTransitInfoListener to provide information about TransitDatabase events
Returns:
HERE SDK for Android Developer's Guide
► API Reference
535
The appropriate Error value, which could be:
•
NONE if the asynchronous request started successfully
•
•
INVALID_OPERATION if another request operation is already in progress
INVALID_PARAMETERS if any of the input parameters is invalid
See also:
mapping.TransitStopInfo.getId ()
mapping.TransitAccessInfo.getStopId ()
public TransitDatabase.Error getSystemInfo (Identifier id,
TransitDatabase.OnGetTransitInfoListener listener)
Initiates an asynchronous request for information about a transit system.
Parameters:
id
An unique Identifier for the transit system.
listener
An OnGetTransitInfoListener to provide information about TransitDatabase events
Returns:
The appropriate Error value, which could be:
•
•
•
NONE if the asynchronous request started successfully
INVALID_OPERATION if another request operation is already in progress
INVALID_PARAMETERS if any of the input parameters is invalid
See also:
mapping.TransitLineInfo.getSystemId ()
Error
The enumeration Error is a member of com.here.android.mpa.mapping.TransitDatabase .
Enumeration Summary
public static final enumeration TransitDatabase.Error
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
HERE SDK for Android Developer's Guide
► API Reference
Represents values describing possible kinds of errors that can be encountered while initiating an
asynchronous request to a TransitDatabase.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 218: Enum Constants in Error
Fields
public static final TransitDatabase.Error
NONE
There was no error, the request started successfully.
public static final TransitDatabase.Error
NOT_FOUND
There was an error encountered while trying to access the database.
public static final TransitDatabase.Error
ABORTED
The request was aborted.
public static final TransitDatabase.Error
INVALID_PARAMETERS
One or more parameters accompanying the request is invalid.
public static final TransitDatabase.Error
INVALID_OPERATION
Another request operation is already in progress.
public static final TransitDatabase.Error
UNKNOWN
There was an error encountered, cause unknown.
Method Summary
Table 219: Methods in Error
Methods
public static TransitDatabase.Error
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static TransitDatabase.Error[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
536
HERE SDK for Android Developer's Guide
► API Reference
Enumeration Details
Represents values describing possible kinds of errors that can be encountered while initiating an
asynchronous request to a TransitDatabase.
Enum Constant Details
public static final TransitDatabase.Error NONE
There was no error, the request started successfully.
public static final TransitDatabase.Error NOT_FOUND
There was an error encountered while trying to access the database.
public static final TransitDatabase.Error ABORTED
The request was aborted.
public static final TransitDatabase.Error INVALID_PARAMETERS
One or more parameters accompanying the request is invalid.
public static final TransitDatabase.Error INVALID_OPERATION
Another request operation is already in progress.
public static final TransitDatabase.Error UNKNOWN
There was an error encountered, cause unknown.
Method Details
public static TransitDatabase.Error valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
537
HERE SDK for Android Developer's Guide
► API Reference
name
538
A string containing the name of the enumeration member whose value is to
be retrieved.
public static TransitDatabase.Error[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
OnGetTransitInfoListener
The interface OnGetTransitInfoListener is a member of
com.here.android.mpa.mapping.TransitDatabase .
Interface Summary
public static abstract interface TransitDatabase.OnGetTransitInfoListener
Represents a listener to provide information about TransitDatabase events.
[For complete information, see the section Interface Details]
Method Summary
Table 220: Methods in OnGetTransitInfoListener
Methods
public abstract void
onEnd (TransitDatabase.Error error)
A callback indicating the end of available transit database results or an encountered error.
public abstract void
onTransitAccessInfo (TransitAccessInfo info)
A callback indicating the availability of transit access information.
public abstract void
onTransitLineInfo (TransitLineInfo info)
A callback indicating the availability of transit line information.
public abstract void
onTransitStopInfo (TransitStopInfo info)
A callback indicating the availability of transit stop information.
public abstract void
onTransitSystemInfo (TransitSystemInfo info)
A callback indicating the availability of transit system information.
HERE SDK for Android Developer's Guide
► API Reference
Interface Details
Represents a listener to provide information about TransitDatabase events.
Method Details
public abstract void onEnd (TransitDatabase.Error error)
A callback indicating the end of available transit database results or an encountered error.
Parameters:
error
A Error value
public abstract void onTransitAccessInfo (TransitAccessInfo info)
A callback indicating the availability of transit access information.
Parameters:
info
A TransitAccessInfo for the requested transit access point
public abstract void onTransitLineInfo (TransitLineInfo info)
A callback indicating the availability of transit line information.
Parameters:
info
A TransitLineInfo for the requested transit line
public abstract void onTransitStopInfo (TransitStopInfo info)
A callback indicating the availability of transit stop information.
Parameters:
info
A TransitStopInfo for the requested transit stop
public abstract void onTransitSystemInfo (TransitSystemInfo info)
539
HERE SDK for Android Developer's Guide
► API Reference
A callback indicating the availability of transit system information.
Parameters:
A TransitSystemInfo for the requested transit system
info
OnGetTransitInfoListenerAdapter
The class OnGetTransitInfoListenerAdapter is a member of
com.here.android.mpa.mapping.TransitDatabase .
Class Summary
public static abstract class TransitDatabase.OnGetTransitInfoListenerAdapter
implements com.here.android.mpa.mapping.TransitDatabase.OnGetTransitInfoListener
extends java.lang.Object
Represents a listener to provide information about TransitDatabase events.
[For complete information, see the section Class Details]
Constructor Summary
Table 221: Constructors in OnGetTransitInfoListenerAdapter
Constructors
OnGetTransitInfoListenerAdapter ()
Method Summary
Table 222: Methods in OnGetTransitInfoListenerAdapter
Methods
public abstract void
onEnd (TransitDatabase.Error error)
A callback indicating the end of available transit database results or an encountered error.
public void
onTransitAccessInfo (TransitAccessInfo info)
A callback indicating the availability of transit access information.
public void
onTransitLineInfo (TransitLineInfo info)
540
HERE SDK for Android Developer's Guide
► API Reference
Methods
A callback indicating the availability of transit line information.
public void
onTransitStopInfo (TransitStopInfo info)
A callback indicating the availability of transit stop information.
public void
onTransitSystemInfo (TransitSystemInfo info)
A callback indicating the availability of transit system information.
Class Details
Represents a listener to provide information about TransitDatabase events.
Constructor Details
OnGetTransitInfoListenerAdapter ()
Method Details
public abstract void onEnd (TransitDatabase.Error error)
A callback indicating the end of available transit database results or an encountered error.
Parameters:
error
An appropriate Error value
public void onTransitAccessInfo (TransitAccessInfo info)
A callback indicating the availability of transit access information.
Parameters:
info
A TransitAccessInfo for the requested transit access point
public void onTransitLineInfo (TransitLineInfo info)
A callback indicating the availability of transit line information.
Parameters:
541
HERE SDK for Android Developer's Guide
► API Reference
info
A TransitLineInfo for the requested transit line
public void onTransitStopInfo (TransitStopInfo info)
A callback indicating the availability of transit stop information.
Parameters:
info
A TransitStopInfo for the requested transit stop
public void onTransitSystemInfo (TransitSystemInfo info)
A callback indicating the availability of transit system information.
Parameters:
info
A TransitSystemInfo for the requested transit system
TransitLineInfo
The class TransitLineInfo is a member of com.here.android.mpa.mapping .
Class Summary
public final class TransitLineInfo
extends java.lang.Object
Represents information about a public transit line.
[For complete information, see the section Class Details]
Nested Class Summary
Table 223: Nested Classes in TransitLineInfo
Nested Classes
public static final enumeration
TransitLineInfo.Attribute
Represents values describing the attributes of transit line.
542
HERE SDK for Android Developer's Guide
► API Reference
543
Method Summary
Table 224: Methods in TransitLineInfo
Methods
public java.util.EnumSet <com.here.android.mpa.mapping.TransitLineInfo.Attribute>
getAttributes ()
Gets all the Attribute s applicable to the transit line.
public int
getColor ()
Gets the current line color for the transit line, an ARGB (Alpha/Red/Green/Blue) value.
public Identifier
getId ()
Gets the unique Identifier of the transit line.
public String
getInformalName ()
Gets the informal name for the line associated with the transit line.
public String
getOfficialName ()
Gets the official name for the line associated with the transit line.
public String
getShortName ()
Gets the short name for the line associated with the transit line.
public Identifier
getSystemId ()
Gets transit system Identifier for the transit line.
public TransitType
getTransitType ()
Gets the TransitType of the transit line.
Class Details
Represents information about a public transit line.
Method Details
public java.util.EnumSet
<com.here.android.mpa.mapping.TransitLineInfo.Attribute> getAttributes ()
Gets all the Attribute s applicable to the transit line.
Returns:
A EnumSet containing all the applicable Attributes.
HERE SDK for Android Developer's Guide
► API Reference
544
public int getColor ()
Gets the current line color for the transit line, an ARGB (Alpha/Red/Green/Blue) value.
Returns:
The current ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green,
blue. Each color component has a value range from [0..255] with 0 meaning no contribution for that
component, and 255 meaning 100% contribution
See also:
android.graphics.Color
public Identifier getId ()
Gets the unique Identifier of the transit line. TransitDatabase
Returns:
The Identifier
public String getInformalName ()
Gets the informal name for the line associated with the transit line. This text is localized according to
the device's locale.
Returns:
The informal name
public String getOfficialName ()
Gets the official name for the line associated with the transit line. This text is localized according to
the device's locale.
Returns:
The official name
public String getShortName ()
HERE SDK for Android Developer's Guide
► API Reference
545
Gets the short name for the line associated with the transit line. This text is localized according to the
device's locale.
Returns:
The short name
public Identifier getSystemId ()
Gets transit system Identifier for the transit line. TransitDatabase
Returns:
the unique object Identifier.
public TransitType getTransitType ()
Gets the TransitType of the transit line.
Returns:
The TransitType
Attribute
The enumeration Attribute is a member of com.here.android.mpa.mapping.TransitLineInfo .
Enumeration Summary
public static final enumeration TransitLineInfo.Attribute
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing the attributes of transit line.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 225: Enum Constants in Attribute
Fields
public static final TransitLineInfo.Attribute
EXPRESS
HERE SDK for Android Developer's Guide
► API Reference
Fields
Express line.
public static final TransitLineInfo.Attribute
ACCESSIBLE_TO_DISABLED
Accessible to disabled people.
public static final TransitLineInfo.Attribute
LUGGAGE_RACKS
Luggage racks available.
public static final TransitLineInfo.Attribute
ONBOARD_TOILETS
Onboard toilets available.
public static final TransitLineInfo.Attribute
ONBOARD_FOOD
Onboard food available.
public static final TransitLineInfo.Attribute
SMOKING_ALLOWED
Smoking allowed.
public static final TransitLineInfo.Attribute
SLEEPING_CARS
Sleeping cars available.
Method Summary
Table 226: Methods in Attribute
Methods
public static TransitLineInfo.Attribute
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static TransitLineInfo.Attribute[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the attributes of transit line.
Enum Constant Details
public static final TransitLineInfo.Attribute EXPRESS
Express line.
546
HERE SDK for Android Developer's Guide
► API Reference
547
public static final TransitLineInfo.Attribute ACCESSIBLE_TO_DISABLED
Accessible to disabled people.
public static final TransitLineInfo.Attribute LUGGAGE_RACKS
Luggage racks available.
public static final TransitLineInfo.Attribute ONBOARD_TOILETS
Onboard toilets available.
public static final TransitLineInfo.Attribute ONBOARD_FOOD
Onboard food available.
public static final TransitLineInfo.Attribute SMOKING_ALLOWED
Smoking allowed.
public static final TransitLineInfo.Attribute SLEEPING_CARS
Sleeping cars available.
Method Details
public static TransitLineInfo.Attribute valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static TransitLineInfo.Attribute[] values ()
HERE SDK for Android Developer's Guide
► API Reference
548
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
TransitLineObject
The class TransitLineObject is a member of com.here.android.mpa.mapping .
Class Summary
public final class TransitLineObject
extends com.here.android.mpa.mapping.MapProxyObject,
com.here.android.mpa.common.ViewObject, java.lang.Object
Encapsulates information about a public transit line on a map.
[For complete information, see the section Class Details]
See also:
Method Summary
Table 227: Methods in TransitLineObject
Methods
public Identifier
getLineId ()
Gets the unique Identifier for the TransitLineObject .
Class Details
Encapsulates information about a public transit line on a map.
A TransitLineObject represents a specialized MapProxyObject . User can retrieve an instance
of this object by calling getSelectedObjects(PointF) or getSelectedObjects(ViewRect) with the location
where a public transit line is located.
See also:
HERE SDK for Android Developer's Guide
► API Reference
549
Method Details
public Identifier getLineId ()
Gets the unique Identifier for the TransitLineObject . Applications can use this Identifier to
highlight the transit line and to get information about the line.
Returns:
The Identifier
See also:
mapping.MapTransitLayer.highlightTransitLines (List)
mapping.TransitDatabase.getLineInfo (Identifier, TransitDatabase.OnGetTransitInfoListener)
TransitLineSegmentObject
The class TransitLineSegmentObject is a member of com.here.android.mpa.mapping .
Class Summary
public final class TransitLineSegmentObject
extends com.here.android.mpa.mapping.MapProxyObject,
com.here.android.mpa.common.ViewObject, java.lang.Object
Encapsulates information about a transit line segment on the map.
[For complete information, see the section Class Details]
See also:
mapping.Map.getSelectedObjects (PointF)
mapping.Map.getSelectedObjectsNearby (PointF)
mapping.Map.getSelectedObjects (ViewRect)
mapping.MapGesture.OnGestureListener.onMapObjectsSelected (List)
HERE SDK for Android Developer's Guide
► API Reference
550
Method Summary
Table 228: Methods in TransitLineSegmentObject
Methods
public Identifier
getLineId ()
Returns the transit line info Identifier.
public Identifier
getLineSegmentId ()
Returns the transit line segment Identifier .
Class Details
Encapsulates information about a transit line segment on the map. TransitLineSegmentObject s
are returned when they are selected on Map .
See also:
mapping.Map.getSelectedObjects (PointF)
mapping.Map.getSelectedObjectsNearby (PointF)
mapping.Map.getSelectedObjects (ViewRect)
mapping.MapGesture.OnGestureListener.onMapObjectsSelected (List)
Method Details
public Identifier getLineId ()
Returns the transit line info Identifier. The Identifier can be used to highlight the transit line and
to get transit line info.
Returns:
the unique object Identifier.
See also:
mapping.MapTransitLayer.highlightTransitLines (java.util.List)
mapping.TransitDatabase.getLineInfo (Identifier, TransitDatabase.OnGetTransitInfoListener)
public Identifier getLineSegmentId ()
HERE SDK for Android Developer's Guide
► API Reference
Returns the transit line segment Identifier . A transit line segment is a section of a line. The
Identifier can be used to highlight the transit line segment.
Returns:
the unique object Identifier.
See also:
mapping.MapTransitLayer.highlightTransitLineSegments (java.util.List)
TransitStopInfo
The class TransitStopInfo is a member of com.here.android.mpa.mapping .
Class Summary
public final class TransitStopInfo
extends java.lang.Object
Represents information about a public transit stop.
[For complete information, see the section Class Details]
Nested Class Summary
Table 229: Nested Classes in TransitStopInfo
Nested Classes
public static final enumeration
TransitStopInfo.Attribute
Represents values describing attributes of transit stops
public static final enumeration
TransitStopInfo.ParkingSize
Number of parking spots available.
Method Summary
Table 230: Methods in TransitStopInfo
Methods
public java.util.EnumSet <com.here.android.mpa.mapping.TransitStopInfo.Attribute>
getAttributes ()
551
HERE SDK for Android Developer's Guide
552
► API Reference
Methods
Gets the stop attributes Attributes for the transit stop.
public GeoCoordinate
getCoordinate ()
Gets the GeoCoordinate position for the transit stop.
public java.util.List <com.here.android.mpa.common.Identifier>
getDepartingLines ()
Gets the list of departing transit line Identifier s for the transit stop.
public java.util.List <com.here.android.mpa.common.Identifier>
getDepartingSystems ()
Gets the array of departing transit systems Identifier s for the transit stop.
public Identifier
getId ()
Gets the unique Identifier for the transit stop.
public String
getInformalName ()
Gets the informal name for the stop associated with the TransitStopInfo .
public java.util.List <com.here.android.mpa.common.Identifier>
getLines ()
Gets the list of transit line Identifier s associated with the transit stop.
public String
getOfficialName ()
Gets the official name for the stop associated with the TransitStopInfo .
public OperatingHours
getOperatingHours ()
Gets the OperatingHours for the transit stop.
public OperatingHours
getParkingHours ()
Gets the parking OperatingHours for the transit stop, if a parking lot is present.
public TransitStopInfo.ParkingSize
getParkingSize ()
Gets the ParkingSize for the transit stop, if a parking lot is present.
public java.util.List <com.here.android.mpa.common.Identifier>
getSystems ()
Gets the list of transit systems Identifier s associated with the transit stop.
public java.util.List <com.here.android.mpa.common.Identifier>
getTerminatingLines ()
Gets the list of terminating line Identifier s for the transit stop.
public java.util.List <com.here.android.mpa.common.Identifier>
getTerminatingSystems ()
Gets the list of terminating systems Identifier s for the transit stop.
public java.util.List <com.here.android.mpa.common.Identifier>
getTransfers ()
Gets the list of transfer stops Identifier s for the transit stop.
public java.util.EnumSet <com.here.android.mpa.common.TransitType>
getTransitTypes ()
HERE SDK for Android Developer's Guide
► API Reference
553
Methods
Gets the TransitType(s) for the stop associated with the TransitStopInfo .
Class Details
Represents information about a public transit stop.
Method Details
public java.util.EnumSet
<com.here.android.mpa.mapping.TransitStopInfo.Attribute> getAttributes ()
Gets the stop attributes Attributes for the transit stop.
Returns:
A EnumSet containing all the Attributes associated with the transit stop.
public GeoCoordinate getCoordinate ()
Gets the GeoCoordinate position for the transit stop.
Returns:
position of the stop.
public java.util.List <com.here.android.mpa.common.Identifier>
getDepartingLines ()
Gets the list of departing transit line Identifier s for the transit stop.
Returns:
The list of Identifier of transit lines.
See also:
mapping.MapTransitLayer.highlightTransitLines (List)
mapping.TransitDatabase.getLineInfo (Identifier, TransitDatabase.OnGetTransitInfoListener)
public java.util.List <com.here.android.mpa.common.Identifier>
getDepartingSystems ()
HERE SDK for Android Developer's Guide
► API Reference
554
Gets the array of departing transit systems Identifier s for the transit stop.
Returns:
The list of Identifier of transit systems.
See also:
mapping.MapTransitLayer.highlightTransitLines (List)
mapping.TransitDatabase.getLineInfo (Identifier, TransitDatabase.OnGetTransitInfoListener)
public Identifier getId ()
Gets the unique Identifier for the transit stop. Applications can use this Identifier to highlight the
transit stop using highlightTransitStops(List). TransitDatabase#getStopInfo
Returns:
The Identifier of this transit stop.
public String getInformalName ()
Gets the informal name for the stop associated with the TransitStopInfo . This text is localized
according to the device's locale.
Returns:
The informal name
public java.util.List <com.here.android.mpa.common.Identifier> getLines ()
Gets the list of transit line Identifier s associated with the transit stop. Applications can use the
Identifier s to highlight the transit lines and to get information about the lines.
Returns:
The list of transit line Identifiers.
See also:
mapping.MapTransitLayer.highlightTransitLines (List)
mapping.TransitDatabase.getLineInfo (Identifier, TransitDatabase.OnGetTransitInfoListener)
public String getOfficialName ()
HERE SDK for Android Developer's Guide
► API Reference
555
Gets the official name for the stop associated with the TransitStopInfo . This text is localized
according to the device's locale.
Returns:
The official name
public OperatingHours getOperatingHours ()
Gets the OperatingHours for the transit stop.
Returns:
The operating hours.
public OperatingHours getParkingHours ()
Gets the parking OperatingHours for the transit stop, if a parking lot is present.
Returns:
parking hours.
public TransitStopInfo.ParkingSize getParkingSize ()
Gets the ParkingSize for the transit stop, if a parking lot is present.
Returns:
The ParkingSize of the transit stop.
public java.util.List <com.here.android.mpa.common.Identifier> getSystems ()
Gets the list of transit systems Identifier s associated with the transit stop.
Returns:
The list of transit system Identifiers.
public java.util.List <com.here.android.mpa.common.Identifier>
getTerminatingLines ()
Gets the list of terminating line Identifier s for the transit stop.
HERE SDK for Android Developer's Guide
► API Reference
556
Returns:
The List of Identifiers.
See also:
mapping.MapTransitLayer.highlightTransitLines (List)
mapping.TransitDatabase.getLineInfo (Identifier, TransitDatabase.OnGetTransitInfoListener)
public java.util.List <com.here.android.mpa.common.Identifier>
getTerminatingSystems ()
Gets the list of terminating systems Identifier s for the transit stop.
Returns:
The List of Identifiers.
See also:
mapping.MapTransitLayer.highlightTransitLines (List)
mapping.TransitDatabase.getLineInfo (Identifier, TransitDatabase.OnGetTransitInfoListener)
public java.util.List <com.here.android.mpa.common.Identifier> getTransfers
()
Gets the list of transfer stops Identifier s for the transit stop.
Returns:
The List of Identifiers.
public java.util.EnumSet <com.here.android.mpa.common.TransitType>
getTransitTypes ()
Gets the TransitType(s) for the stop associated with the TransitStopInfo .
Returns:
The EnumSet of all TransitType associated with the stop.
HERE SDK for Android Developer's Guide
► API Reference
Attribute
The enumeration Attribute is a member of com.here.android.mpa.mapping.TransitStopInfo .
Enumeration Summary
public static final enumeration TransitStopInfo.Attribute
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing attributes of transit stops
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 231: Enum Constants in Attribute
Fields
public static final TransitStopInfo.Attribute
CONNECTED_STOP
public static final TransitStopInfo.Attribute
INTER_STOPS_TRANSFER
public static final TransitStopInfo.Attribute
TERMINATING_STOP
public static final TransitStopInfo.Attribute
DEPARTING_STOP
public static final TransitStopInfo.Attribute
PAY_CAR_PARKING
public static final TransitStopInfo.Attribute
FREE_CAR_PARKING
public static final TransitStopInfo.Attribute
BICYCLE_PARKING
public static final TransitStopInfo.Attribute
SMOKING_ALLOWED
public static final TransitStopInfo.Attribute
TOILETS
public static final TransitStopInfo.Attribute
WIRELESS_INTERNET
public static final TransitStopInfo.Attribute
CELLULAR_SERVICE
public static final TransitStopInfo.Attribute
TICKET_MACHINES
public static final TransitStopInfo.Attribute
LUGGAGE_LOCKERS
public static final TransitStopInfo.Attribute
LUGGAGE_CHECKS
public static final TransitStopInfo.Attribute
ATTENDANT_BOOTH
557
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final TransitStopInfo.Attribute
SHOPS
public static final TransitStopInfo.Attribute
OUTDOOR
public static final TransitStopInfo.Attribute
COVERED
public static final TransitStopInfo.Attribute
PEDESTRIAN_RAMPS
public static final TransitStopInfo.Attribute
ELEVATORS
public static final TransitStopInfo.Attribute
ESCALATORS
public static final TransitStopInfo.Attribute
STAIRS
Method Summary
Table 232: Methods in Attribute
Methods
public static TransitStopInfo.Attribute
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static TransitStopInfo.Attribute[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing attributes of transit stops
Enum Constant Details
public static final TransitStopInfo.Attribute CONNECTED_STOP
public static final TransitStopInfo.Attribute INTER_STOPS_TRANSFER
public static final TransitStopInfo.Attribute TERMINATING_STOP
public static final TransitStopInfo.Attribute DEPARTING_STOP
558
HERE SDK for Android Developer's Guide
► API Reference
public static final TransitStopInfo.Attribute PAY_CAR_PARKING
public static final TransitStopInfo.Attribute FREE_CAR_PARKING
public static final TransitStopInfo.Attribute BICYCLE_PARKING
public static final TransitStopInfo.Attribute SMOKING_ALLOWED
public static final TransitStopInfo.Attribute TOILETS
public static final TransitStopInfo.Attribute WIRELESS_INTERNET
public static final TransitStopInfo.Attribute CELLULAR_SERVICE
public static final TransitStopInfo.Attribute TICKET_MACHINES
public static final TransitStopInfo.Attribute LUGGAGE_LOCKERS
public static final TransitStopInfo.Attribute LUGGAGE_CHECKS
public static final TransitStopInfo.Attribute ATTENDANT_BOOTH
public static final TransitStopInfo.Attribute SHOPS
public static final TransitStopInfo.Attribute OUTDOOR
559
HERE SDK for Android Developer's Guide
► API Reference
560
public static final TransitStopInfo.Attribute COVERED
public static final TransitStopInfo.Attribute PEDESTRIAN_RAMPS
public static final TransitStopInfo.Attribute ELEVATORS
public static final TransitStopInfo.Attribute ESCALATORS
public static final TransitStopInfo.Attribute STAIRS
Method Details
public static TransitStopInfo.Attribute valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static TransitStopInfo.Attribute[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
ParkingSize
The enumeration ParkingSize is a member of com.here.android.mpa.mapping.TransitStopInfo .
HERE SDK for Android Developer's Guide
561
► API Reference
Enumeration Summary
public static final enumeration TransitStopInfo.ParkingSize
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Number of parking spots available.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 233: Enum Constants in ParkingSize
Fields
public static final TransitStopInfo.ParkingSize
UNKNOWN
public static final TransitStopInfo.ParkingSize
FIVE_OR_LESS
public static final TransitStopInfo.ParkingSize
TEN_OR_LESS
public static final TransitStopInfo.ParkingSize
FIFTY_OR_LESS
public static final TransitStopInfo.ParkingSize
TWO_HUNDRED_OR_LESS
public static final TransitStopInfo.ParkingSize
MORE_THAN_200
Method Summary
Table 234: Methods in ParkingSize
Methods
public static TransitStopInfo.ParkingSize
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static TransitStopInfo.ParkingSize[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Number of parking spots available.
Enum Constant Details
public static final TransitStopInfo.ParkingSize UNKNOWN
HERE SDK for Android Developer's Guide
► API Reference
562
public static final TransitStopInfo.ParkingSize FIVE_OR_LESS
public static final TransitStopInfo.ParkingSize TEN_OR_LESS
public static final TransitStopInfo.ParkingSize FIFTY_OR_LESS
public static final TransitStopInfo.ParkingSize TWO_HUNDRED_OR_LESS
public static final TransitStopInfo.ParkingSize MORE_THAN_200
Method Details
public static TransitStopInfo.ParkingSize valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static TransitStopInfo.ParkingSize[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
TransitStopObject
The class TransitStopObject is a member of com.here.android.mpa.mapping .
HERE SDK for Android Developer's Guide
563
► API Reference
Class Summary
public final class TransitStopObject
extends com.here.android.mpa.mapping.MapProxyObject,
com.here.android.mpa.common.ViewObject, java.lang.Object
Encapsulates information about a public transit stop on a map.
[For complete information, see the section Class Details]
See also:
Method Summary
Table 235: Methods in TransitStopObject
Methods
public GeoCoordinate
getCoordinate ()
Gets the GeoCoordinate representing the position of the transit stop icon on the map.
public java.util.List <com.here.android.mpa.common.Image>
getIcons ()
Get the list of icons associated with the TransitStopObject .
public TransitStopInfo
getTransitStopInfo ()
Gets the TransitStopInfo associated with the TransitStopObject .
Class Details
Encapsulates information about a public transit stop on a map.
A TransitStopObject represents a specialized MapProxyObject. User can retrieve an instance of
this object by calling getSelectedObjects(PointF) or getSelectedObjects(ViewRect) with the location
where a public transit stop is located.
See also:
Method Details
public GeoCoordinate getCoordinate ()
Gets the GeoCoordinate representing the position of the transit stop icon on the map.
HERE SDK for Android Developer's Guide
► API Reference
564
Returns:
The GeoCoordinate
public java.util.List <com.here.android.mpa.common.Image> getIcons ()
Get the list of icons associated with the TransitStopObject .
Returns:
List of icon Images.
public TransitStopInfo getTransitStopInfo ()
Gets the TransitStopInfo associated with the TransitStopObject . A TransitStopInfo instance
contains information about the name of the stop, the types of transit that use the stop, and the IDs
of particular transit lines that stop there.
Returns:
The TransitStopInfo
TransitSystemInfo
The class TransitSystemInfo is a member of com.here.android.mpa.mapping .
Class Summary
public final class TransitSystemInfo
extends java.lang.Object
Represents information about a public transit system.
[For complete information, see the section Class Details]
Nested Class Summary
Table 236: Nested Classes in TransitSystemInfo
Nested Classes
public static final enumeration
TransitSystemInfo.Attribute
HERE SDK for Android Developer's Guide
► API Reference
Nested Classes
Attributes or LOGOS of a Transit System.
Method Summary
Table 237: Methods in TransitSystemInfo
Methods
public java.util.EnumSet <com.here.android.mpa.mapping.TransitSystemInfo.Attribute>
getAttributes ()
Gets all the Attribute s for the transit system.
public OperatingHours
getBicycleHours ()
Gets the Bicycle Parking Hours.
public String
getCompanyInformalName ()
Gets the company informal name for the transit system.
public Image
getCompanyLogo ()
Gets the Company Logo, if present.
public String
getCompanyOfficialName ()
Gets the company official name for the transit system.
public String
getCompanyPhone ()
Gets the company phone number for the transit system.
public String
getCompanyRoutePlannerUrl ()
Gets the company route planner url for the transit system.
public String
getCompanyScheduleUrl ()
Gets the company schedule url for the transit system.
public String
getCompanyShortName ()
Gets the company short name for the transit system.
public String
getCompanyWebsiteUrl ()
Gets the company website url for the transit system.
public Identifier
getId ()
Gets the ID for the transit system.
public Image
getSystemAccessLogo ()
Gets the System Access Logo, if present.
565
HERE SDK for Android Developer's Guide
► API Reference
566
Methods
public String
getSystemInformalName ()
Gets the informal name for the transit system.
public Image
getSystemLogo ()
Gets the System Logo, if present.
public String
getSystemOfficialName ()
Gets the official name for the transit system.
public String
getSystemShortName ()
Gets the short name for the transit system.
public String
getSystemWebsiteUrl ()
Gets the website url for the transit system.
Class Details
Represents information about a public transit system.
Method Details
public java.util.EnumSet
<com.here.android.mpa.mapping.TransitSystemInfo.Attribute> getAttributes ()
Gets all the Attribute s for the transit system.
Returns:
A EnumSet containing all the Attributes associated with the transit system.
public OperatingHours getBicycleHours ()
Gets the Bicycle Parking Hours.
Returns:
The bicycle parking hours as OperatingHours of this transit system.
public String getCompanyInformalName ()
Gets the company informal name for the transit system. This text is localized according to the
device's locale.
HERE SDK for Android Developer's Guide
► API Reference
567
Returns:
company informal name.
public Image getCompanyLogo ()
Gets the Company Logo, if present.
Returns:
The Company Logo as an Image.
public String getCompanyOfficialName ()
Gets the company official name for the transit system. This text is localized according to the device's
locale.
Returns:
company official name.
public String getCompanyPhone ()
Gets the company phone number for the transit system. This text is localized according to the
device's locale.
Returns:
company phone number.
public String getCompanyRoutePlannerUrl ()
Gets the company route planner url for the transit system.
Returns:
company route planner url.
public String getCompanyScheduleUrl ()
Gets the company schedule url for the transit system.
Returns:
HERE SDK for Android Developer's Guide
► API Reference
568
company schedule url.
public String getCompanyShortName ()
Gets the company short name for the transit system. This text is localized according to the device's
locale.
Returns:
company short name.
public String getCompanyWebsiteUrl ()
Gets the company website url for the transit system.
Returns:
company website url.
public Identifier getId ()
Gets the ID for the transit system.
Returns:
the unique object Identifier.
See also:
mapping.TransitDatabase.getSystemInfo (Identifier, TransitDatabase.OnGetTransitInfoListener)
public Image getSystemAccessLogo ()
Gets the System Access Logo, if present.
Returns:
System Access Logo as an Image.
public String getSystemInformalName ()
Gets the informal name for the transit system. This text is localized according to the device's locale.
Returns:
HERE SDK for Android Developer's Guide
► API Reference
569
informal name.
public Image getSystemLogo ()
Gets the System Logo, if present.
Returns:
System Logo as an Image.
public String getSystemOfficialName ()
Gets the official name for the transit system. This text is localized according to the device's locale.
Returns:
official name.
public String getSystemShortName ()
Gets the short name for the transit system. This text is localized according to the device's locale.
Returns:
short name.
public String getSystemWebsiteUrl ()
Gets the website url for the transit system.
Returns:
website url.
Attribute
The enumeration Attribute is a member of com.here.android.mpa.mapping.TransitSystemInfo .
Enumeration Summary
public static final enumeration TransitSystemInfo.Attribute
HERE SDK for Android Developer's Guide
570
► API Reference
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Attributes or LOGOS of a Transit System.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 238: Enum Constants in Attribute
Fields
public static final TransitSystemInfo.Attribute
COMPANY_LOGO
public static final TransitSystemInfo.Attribute
SYSTEM_LOGO
public static final TransitSystemInfo.Attribute
SYSTEM_ACCESS_LOGO
Method Summary
Table 239: Methods in Attribute
Methods
public static TransitSystemInfo.Attribute
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static TransitSystemInfo.Attribute[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Attributes or LOGOS of a Transit System.
Enum Constant Details
public static final TransitSystemInfo.Attribute COMPANY_LOGO
public static final TransitSystemInfo.Attribute SYSTEM_LOGO
public static final TransitSystemInfo.Attribute SYSTEM_ACCESS_LOGO
HERE SDK for Android Developer's Guide
► API Reference
571
Method Details
public static TransitSystemInfo.Attribute valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static TransitSystemInfo.Attribute[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
UrlMapRasterTileSourceBase
The class UrlMapRasterTileSourceBase is a member of com.here.android.mpa.mapping .
Class Summary
public abstract class UrlMapRasterTileSourceBase
extends com.here.android.mpa.mapping.MapRasterTileSource, java.lang.Object
Represents an abstract base class for URL map raster tile sources.
[For complete information, see the section Class Details]
Constructor Summary
Table 240: Constructors in UrlMapRasterTileSourceBase
Constructors
UrlMapRasterTileSourceBase ()
HERE SDK for Android Developer's Guide
► API Reference
572
Method Summary
Table 241: Methods in UrlMapRasterTileSourceBase
Methods
public MapRasterTileSource.TileResult
getTileWithError (int x, int y, int zoomLevel)
UrlMapRasterTileSourceBase will only retrieve tile data using the source URL.
public abstract String
getUrl (int x, int y, int zoomLevel)
Gets the URL representing the source of the specified raster tile image.
public boolean
hasTile (int x, int y, int zoomLevel)
UrlMapRasterTileSourceBase will only retrieve tile data using the source URL.
Class Details
Represents an abstract base class for URL map raster tile sources. Extend this class and implement
the getUrl(int, int, int) method to create custom URL raster tile sources.
Constructor Details
UrlMapRasterTileSourceBase ()
Method Details
public MapRasterTileSource.TileResult getTileWithError (int x, int y, int
zoomLevel)
UrlMapRasterTileSourceBase will only retrieve tile data using the source URL.
A TileResult.getData() always returns null and TileResult.getError() always returns
TileResult.Error.NONE.
Parameters:
x
X coordinate
y
Y coordinate
zoomLevel
zoom level
Returns:
HERE SDK for Android Developer's Guide
► API Reference
573
A TileResult representing tile data and operation error. Check TileResult#getError() to
check for error. Check TileResult#getData() to get RasterTile
public abstract String getUrl (int x, int y, int zoomLevel)
Gets the URL representing the source of the specified raster tile image.
Note: implementations of raster tile sources must override this method to provide a complete URL
string pointing to the raster tile image.
Parameters:
x
A current raster tile's X-coordinate
y
A current raster tile's Y-coordinate
zoomLevel
A current raster tile's zoom level
Returns:
The URL source for the raster tile image. Return null if an URL cannot be created.
public boolean hasTile (int x, int y, int zoomLevel)
UrlMapRasterTileSourceBase will only retrieve tile data using the source URL. So hasTile
always returned false .
Parameters:
x
X coordinate
y
Y coordinate
zoomLevel
zoom level
Returns:
true if the tile exists, false otherwise
HERE SDK for Android Developer's Guide
► API Reference
574
routing
The package routing is a member of com.here.android.mpa.
Package Summary
routing
This package provides classes, interfaces, and enumerations for route calculation and route
description (directions).
Package Details
This package provides classes, interfaces, and enumerations for route calculation and route
description (directions).
Note: the RouteManager class provides access to the route calculation and positioning functionality.
To calculate a route, you need:
•
•
•
a parameter list containing at least two waypoints for the start and end of the route - this is an
instance of RoutePlan
a set of routing options to control route calculation features - this is an instance of RouteOptions
an event listener for listening to RouteManager events - this is an instance of
RouteManager.Listener
For more information on how to use the RouteManager, please see the "Directions" section in the
HERE SDK for Android Developer's Guide
Maneuver
The class Maneuver is a member of com.here.android.mpa.routing .
Class Summary
public class Maneuver
extends java.lang.Object
Represents the action required to leave one street segment and enter the next in the chain of
directions that comprises a calculated Route.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
Nested Class Summary
Table 242: Nested Classes in Maneuver
Nested Classes
public static final enumeration
Maneuver.Action
Represents values describing the possible actions of a Maneuver.
public static final enumeration
Maneuver.Icon
Represents values describing types of Maneuver icons.
public static final enumeration
Maneuver.TrafficDirection
Represents values describing possible traffic directions, the side of road on which one must drive.
public static final enumeration
Maneuver.Turn
Represents values describing possible turns within a Maneuver.
Constructor Summary
Table 243: Constructors in Maneuver
Constructors
Maneuver (ManeuverImpl impl)
Method Summary
Table 244: Methods in Maneuver
Methods
public Maneuver.Action
getAction ()
Gets the Maneuver.Action required to complete the maneuver.
public int
getAngle ()
The angle of the maneuver.
public GeoBoundingBox
getBoundingBox ()
Gets the GeoBoundingBox of the maneuver, which is a group of GeoCoordinates forming a polygon
public GeoCoordinate
getCoordinate ()
Gets the GeoCoordinate of the maneuver.
public int
getDistanceFromPreviousManeuver ()
575
HERE SDK for Android Developer's Guide
576
► API Reference
Methods
Gets the distance from the previous maneuver to the current maneuver, in meters.
public int
getDistanceFromStart ()
Gets the distance from the start of the route to the maneuver, in meters.
public int
getDistanceToNextManeuver ()
Gets the distance to the next maneuver from the current maneuver, in meters.
public Maneuver.Icon
getIcon ()
Gets the Maneuver.Icon for the maneuver.
public String
getInstruction ()
Deprecated: As of release 2.0.1, use the following methods to retrieve all relevant information to form the instruction
instead:
•
getAction()
•
getTurn()
•
getRoadName()
•
getRoadNumber()
•
getNextRoadName()
•
getNextRoadNumber()
The textual instruction describing the maneuver.
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
getManeuverGeometry ()
Puts all points of the maneuvers polyline in the right order into the given collection.
public int
getMapOrientation ()
Gets the map orientation at the start of the maneuver, in degrees.
public String
getNextRoadName ()
Gets the name of the road to which the maneuver leads.
public String
getNextRoadNumber ()
Gets the road number to which the maneuver leads.
public String
getRoadName ()
Gets the name of the road on which the maneuver takes place.
public String
getRoadNumber ()
Gets the road number on which the maneuver takes place, a short label for the road or highway (e.g.
public Signpost
getSignpost ()
Gets the Signpost for this maneuver.
HERE SDK for Android Developer's Guide
► API Reference
Methods
public Date
getStartTime ()
Gets the (estimated) time at which the maneuver starts.
public Maneuver.TrafficDirection
getTrafficDirection ()
Return traffic direction.
public RouteOptions.TransportMode
getTransportMode ()
Gets the RouteOptions.TransportMode used for the maneuver.
public Maneuver.Turn
getTurn ()
Gets the Maneuver.Turn required to complete the maneuver.
Class Details
Represents the action required to leave one street segment and enter the next in the chain of
directions that comprises a calculated Route.
Constructor Details
Maneuver (ManeuverImpl impl)
Parameters:
impl
Method Details
public Maneuver.Action getAction ()
Gets the Maneuver.Action required to complete the maneuver.
Returns:
The Maneuver.Action
public int getAngle ()
The angle of the maneuver.
Returns:
577
HERE SDK for Android Developer's Guide
► API Reference
578
The angle in degrees from end of the start road to the start of the end road. Angle has a value from
0, 360, north is up, clockwise
public GeoBoundingBox getBoundingBox ()
Gets the GeoBoundingBox of the maneuver, which is a group of GeoCoordinates forming a polygon
Returns:
The GeoBoundingBox
public GeoCoordinate getCoordinate ()
Gets the GeoCoordinate of the maneuver.
Returns:
The GeoCoordinate
public int getDistanceFromPreviousManeuver ()
Gets the distance from the previous maneuver to the current maneuver, in meters.
Returns:
The distance
public int getDistanceFromStart ()
Gets the distance from the start of the route to the maneuver, in meters.
Returns:
The distance
public int getDistanceToNextManeuver ()
Gets the distance to the next maneuver from the current maneuver, in meters.
Returns:
The distance
HERE SDK for Android Developer's Guide
► API Reference
579
public Maneuver.Icon getIcon ()
Gets the Maneuver.Icon for the maneuver.
Returns:
The Maneuver.Icon
public String getInstruction ()
Deprecated: As of release 2.0.1, use the following methods to retrieve all relevant information to form the instruction
instead:
•
•
•
•
•
•
getAction()
getTurn()
getRoadName()
getRoadNumber()
getNextRoadName()
getNextRoadNumber()
The textual instruction describing the maneuver.
Returns:
the instruction.
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
getManeuverGeometry ()
Puts all points of the maneuvers polyline in the right order into the given collection.
Returns:
a collection of GeoCoordinates.
public int getMapOrientation ()
Gets the map orientation at the start of the maneuver, in degrees.
Note: a returned value of zero represents true-north, with increasing values representing a clockwise
progression of map orientation.
Returns:
The orientation
HERE SDK for Android Developer's Guide
► API Reference
580
public String getNextRoadName ()
Gets the name of the road to which the maneuver leads.
Next road name is provided if available for a given Maneuver . If not provided, it should be left blank.
It's erroneous to assume that it is the same as prior maneuvers.
Returns:
The next road name
public String getNextRoadNumber ()
Gets the road number to which the maneuver leads.
Returns:
The road number of the next road element
public String getRoadName ()
Gets the name of the road on which the maneuver takes place.
Road name is provided if available for a given Maneuver . If not provided, it should be left blank. It's
erroneous to assume that it is the same as prior maneuvers.
Returns:
The road name
public String getRoadNumber ()
Gets the road number on which the maneuver takes place, a short label for the road or highway (e.g.
5 for Interstate 5).
If the road number is unknown, this method will return an empty string.
Returns:
The road number
HERE SDK for Android Developer's Guide
► API Reference
581
public Signpost getSignpost ()
Gets the Signpost for this maneuver. If the signpost is not valid, null is returned.
Returns:
A Signpost object if a valid one exists. Otherwise, returns null.
public Date getStartTime ()
Gets the (estimated) time at which the maneuver starts.
If no departure time was set for the RouteOptions associated with the maneuver, then the time is
relative to the system time when the route calculation took place. Otherwise, the times are relative to
the specified departure time.
Returns:
The start time, or null if not available
See also:
public Maneuver.TrafficDirection getTrafficDirection ()
Return traffic direction.
Returns:
LEFT, if left side traffic, RIGHT if right side traffic.
public RouteOptions.TransportMode getTransportMode ()
Gets the RouteOptions.TransportMode used for the maneuver. This might differ from the
RouteOptions.TransportMode used when calculating the Route with which the particular maneuver
is associated. For example, in the case where a Route is calculated using PUBLIC_TRANSPORT,
the overall route is a public transport route, but some individual maneuvers may be pedestrian (for
example, walking to a bus stop, or transfers which involve walking to a new stop).
Returns:
HERE SDK for Android Developer's Guide
► API Reference
The RouteOptions.TransportMode
public Maneuver.Turn getTurn ()
Gets the Maneuver.Turn required to complete the maneuver.
Returns:
The Maneuver.Turn
Action
The enumeration Action is a member of com.here.android.mpa.routing.Maneuver .
Enumeration Summary
public static final enumeration Maneuver.Action
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing the possible actions of a Maneuver.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 245: Enum Constants in Action
Fields
public static final Maneuver.Action
UNDEFINED
An undefined action (the default), avoided for real maneuvers.
public static final Maneuver.Action
NO_ACTION
An indication that there is no action associated with the maneuver.
public static final Maneuver.Action
END
An action that indicates the end of a route.
public static final Maneuver.Action
STOPOVER
An action that indicates a stopover.
public static final Maneuver.Action
JUNCTION
582
HERE SDK for Android Developer's Guide
► API Reference
Fields
An action that indicates a junction.
public static final Maneuver.Action
ROUNDABOUT
An action that indicates a roundabout.
public static final Maneuver.Action
UTURN
An action that indicates a u-turn.
public static final Maneuver.Action
ENTER_HIGHWAY_FROM_RIGHT
An action that indicates entering a highway from the right.
public static final Maneuver.Action
ENTER_HIGHWAY_FROM_LEFT
An action that indicates entering a highway from the left.
public static final Maneuver.Action
ENTER_HIGHWAY
An action that indicates entering a highway.
public static final Maneuver.Action
LEAVE_HIGHWAY
An action that indicates leaving a highway.
public static final Maneuver.Action
CHANGE_HIGHWAY
An action that indicates changing from one highway to another.
public static final Maneuver.Action
CONTINUE_HIGHWAY
An action that indicates continuing along a highway.
public static final Maneuver.Action
FERRY
An action that indicates boarding a ferry.
public static final Maneuver.Action
PASS_JUNCTION
An action that indicates passing a junction.
public static final Maneuver.Action
HEAD_TO
An action that indicates heading.
public static final Maneuver.Action
PASS_STATION
An action that indicates passing a station.
public static final Maneuver.Action
CHANGE_LINE
An action that indicates transit line change.
public static final Maneuver.Action
An invalid action.
INVALID
583
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 246: Methods in Action
Methods
public int
value ()
public static Maneuver.Action
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Maneuver.Action[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the possible actions of a Maneuver.
Enum Constant Details
public static final Maneuver.Action UNDEFINED
An undefined action (the default), avoided for real maneuvers.
public static final Maneuver.Action NO_ACTION
An indication that there is no action associated with the maneuver.
public static final Maneuver.Action END
An action that indicates the end of a route.
public static final Maneuver.Action STOPOVER
An action that indicates a stopover.
public static final Maneuver.Action JUNCTION
An action that indicates a junction.
584
HERE SDK for Android Developer's Guide
► API Reference
public static final Maneuver.Action ROUNDABOUT
An action that indicates a roundabout.
public static final Maneuver.Action UTURN
An action that indicates a u-turn.
public static final Maneuver.Action ENTER_HIGHWAY_FROM_RIGHT
An action that indicates entering a highway from the right.
public static final Maneuver.Action ENTER_HIGHWAY_FROM_LEFT
An action that indicates entering a highway from the left.
public static final Maneuver.Action ENTER_HIGHWAY
An action that indicates entering a highway.
public static final Maneuver.Action LEAVE_HIGHWAY
An action that indicates leaving a highway.
public static final Maneuver.Action CHANGE_HIGHWAY
An action that indicates changing from one highway to another.
public static final Maneuver.Action CONTINUE_HIGHWAY
An action that indicates continuing along a highway.
public static final Maneuver.Action FERRY
An action that indicates boarding a ferry.
585
HERE SDK for Android Developer's Guide
► API Reference
586
public static final Maneuver.Action PASS_JUNCTION
An action that indicates passing a junction.
public static final Maneuver.Action HEAD_TO
An action that indicates heading.
public static final Maneuver.Action PASS_STATION
An action that indicates passing a station.
public static final Maneuver.Action CHANGE_LINE
An action that indicates transit line change.
public static final Maneuver.Action INVALID
An invalid action.
Method Details
public int value ()
public static Maneuver.Action valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Maneuver.Action[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
HERE SDK for Android Developer's Guide
► API Reference
Icon
The enumeration Icon is a member of com.here.android.mpa.routing.Maneuver .
Enumeration Summary
public static final enumeration Maneuver.Icon
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing types of Maneuver icons.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 247: Enum Constants in Icon
Fields
public static final Maneuver.Icon
UNDEFINED
An undefined icon.
public static final Maneuver.Icon
GO_STRAIGHT
An icon that indicates a straight course.
public static final Maneuver.Icon
UTURN_RIGHT
An icon that indicates a right u-turn.
public static final Maneuver.Icon
UTURN_LEFT
An icon that indicates a left u-turn.
public static final Maneuver.Icon
KEEP_RIGHT
An icon that indicates keeping to the right.
public static final Maneuver.Icon
LIGHT_RIGHT
An icon that indicates a light right turn.
public static final Maneuver.Icon
QUITE_RIGHT
An icon that indicates a normal right turn.
public static final Maneuver.Icon
An icon that indicates a heavy right turn.
HEAVY_RIGHT
587
HERE SDK for Android Developer's Guide
► API Reference
588
Fields
public static final Maneuver.Icon
KEEP_MIDDLE
Keep middle line.
public static final Maneuver.Icon
KEEP_LEFT
An icon that indicates keeping to the left.
public static final Maneuver.Icon
LIGHT_LEFT
An icon that indicates a light left turn.
public static final Maneuver.Icon
QUITE_LEFT
An icon that indicates a normal left turn.
public static final Maneuver.Icon
HEAVY_LEFT
An icon that indicates a heavy left turn.
public static final Maneuver.Icon
ENTER_HIGHWAY_RIGHT_LANE
An icon that indicates entering a highway into the right lane.
public static final Maneuver.Icon
ENTER_HIGHWAY_LEFT_LANE
An icon that indicates entering a highway into the left lane.
public static final Maneuver.Icon
LEAVE_HIGHWAY_RIGHT_LANE
An icon that indicates leaving a highway from the right lane.
public static final Maneuver.Icon
LEAVE_HIGHWAY_LEFT_LANE
An icon that indicates leaving a highway from the left lane.
public static final Maneuver.Icon
HIGHWAY_KEEP_RIGHT
An icon that indicates keeping to the right-hand lane of a highway.
public static final Maneuver.Icon
HIGHWAY_KEEP_LEFT
An icon that indicates keeping to the left-hand lane of a highway.
public static final Maneuver.Icon
ROUNDABOUT_1
An icon that indicates using the first exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_2
An icon that indicates using the second exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_3
An icon that indicates using the third exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_4
HERE SDK for Android Developer's Guide
► API Reference
589
Fields
An icon that indicates using the fourth exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_5
An icon that indicates using the fifth exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_6
An icon that indicates using the sixth exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_7
An icon that indicates using the seventh exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_8
An icon that indicates using the eighth exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_9
An icon that indicates using the ninth exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_10
An icon that indicates using the tenth exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_11
An icon that indicates using the eleventh exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_12
An icon that indicates using the twelfth exit encountered while navigating a roundabout in a counter-clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_1_LH
An icon that indicates using the first exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_2_LH
An icon that indicates using the second exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_3_LH
An icon that indicates using the third exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_4_LH
An icon that indicates using the fourth exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_5_LH
An icon that indicates using the fifth exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_6_LH
An icon that indicates using the sixth exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_7_LH
HERE SDK for Android Developer's Guide
► API Reference
Fields
An icon that indicates using the seventh exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_8_LH
An icon that indicates using the eighth exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_9_LH
An icon that indicates using the ninth exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_10_LH
An icon that indicates using the tenth exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_11_LH
An icon that indicates using the eleventh exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
ROUNDABOUT_12_LH
An icon that indicates using the twelfth exit encountered while navigating a roundabout in a clockwise direction.
public static final Maneuver.Icon
START
An icon that indicates the start point (displayed when route navigation has not yet begun).
public static final Maneuver.Icon
END
An icon that indicates the destination point.
public static final Maneuver.Icon
FERRY
An icon that indicates boarding a ferry.
public static final Maneuver.Icon
PASS_STATION
An icon that indicates passing a station.
public static final Maneuver.Icon
HEAD_TO
Leaving public transit station.
public static final Maneuver.Icon
CHANGE_LINE
Changing public transit line.
Method Summary
Table 248: Methods in Icon
Methods
public int
value ()
public static Maneuver.Icon
valueOf (String name)
590
HERE SDK for Android Developer's Guide
► API Reference
Methods
This method retrieves the enumeration value that matches the name specified by the caller.
public static Maneuver.Icon[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing types of Maneuver icons.
Enum Constant Details
public static final Maneuver.Icon UNDEFINED
An undefined icon.
public static final Maneuver.Icon GO_STRAIGHT
An icon that indicates a straight course.
public static final Maneuver.Icon UTURN_RIGHT
An icon that indicates a right u-turn.
public static final Maneuver.Icon UTURN_LEFT
An icon that indicates a left u-turn.
public static final Maneuver.Icon KEEP_RIGHT
An icon that indicates keeping to the right.
public static final Maneuver.Icon LIGHT_RIGHT
An icon that indicates a light right turn.
public static final Maneuver.Icon QUITE_RIGHT
591
HERE SDK for Android Developer's Guide
► API Reference
An icon that indicates a normal right turn.
public static final Maneuver.Icon HEAVY_RIGHT
An icon that indicates a heavy right turn.
public static final Maneuver.Icon KEEP_MIDDLE
Keep middle line.
public static final Maneuver.Icon KEEP_LEFT
An icon that indicates keeping to the left.
public static final Maneuver.Icon LIGHT_LEFT
An icon that indicates a light left turn.
public static final Maneuver.Icon QUITE_LEFT
An icon that indicates a normal left turn.
public static final Maneuver.Icon HEAVY_LEFT
An icon that indicates a heavy left turn.
public static final Maneuver.Icon ENTER_HIGHWAY_RIGHT_LANE
An icon that indicates entering a highway into the right lane.
public static final Maneuver.Icon ENTER_HIGHWAY_LEFT_LANE
An icon that indicates entering a highway into the left lane.
public static final Maneuver.Icon LEAVE_HIGHWAY_RIGHT_LANE
592
HERE SDK for Android Developer's Guide
► API Reference
593
An icon that indicates leaving a highway from the right lane.
public static final Maneuver.Icon LEAVE_HIGHWAY_LEFT_LANE
An icon that indicates leaving a highway from the left lane.
public static final Maneuver.Icon HIGHWAY_KEEP_RIGHT
An icon that indicates keeping to the right-hand lane of a highway.
public static final Maneuver.Icon HIGHWAY_KEEP_LEFT
An icon that indicates keeping to the left-hand lane of a highway.
public static final Maneuver.Icon ROUNDABOUT_1
An icon that indicates using the first exit encountered while navigating a roundabout in a counterclockwise direction.
public static final Maneuver.Icon ROUNDABOUT_2
An icon that indicates using the second exit encountered while navigating a roundabout in a counterclockwise direction.
public static final Maneuver.Icon ROUNDABOUT_3
An icon that indicates using the third exit encountered while navigating a roundabout in a counterclockwise direction.
public static final Maneuver.Icon ROUNDABOUT_4
An icon that indicates using the fourth exit encountered while navigating a roundabout in a counterclockwise direction.
public static final Maneuver.Icon ROUNDABOUT_5
HERE SDK for Android Developer's Guide
► API Reference
594
An icon that indicates using the fifth exit encountered while navigating a roundabout in a counterclockwise direction.
public static final Maneuver.Icon ROUNDABOUT_6
An icon that indicates using the sixth exit encountered while navigating a roundabout in a counterclockwise direction.
public static final Maneuver.Icon ROUNDABOUT_7
An icon that indicates using the seventh exit encountered while navigating a roundabout in a counterclockwise direction.
public static final Maneuver.Icon ROUNDABOUT_8
An icon that indicates using the eighth exit encountered while navigating a roundabout in a counterclockwise direction.
public static final Maneuver.Icon ROUNDABOUT_9
An icon that indicates using the ninth exit encountered while navigating a roundabout in a counterclockwise direction.
public static final Maneuver.Icon ROUNDABOUT_10
An icon that indicates using the tenth exit encountered while navigating a roundabout in a counterclockwise direction.
public static final Maneuver.Icon ROUNDABOUT_11
An icon that indicates using the eleventh exit encountered while navigating a roundabout in a
counter-clockwise direction.
public static final Maneuver.Icon ROUNDABOUT_12
An icon that indicates using the twelfth exit encountered while navigating a roundabout in a counterclockwise direction.
HERE SDK for Android Developer's Guide
► API Reference
595
public static final Maneuver.Icon ROUNDABOUT_1_LH
An icon that indicates using the first exit encountered while navigating a roundabout in a clockwise
direction.
public static final Maneuver.Icon ROUNDABOUT_2_LH
An icon that indicates using the second exit encountered while navigating a roundabout in a clockwise
direction.
public static final Maneuver.Icon ROUNDABOUT_3_LH
An icon that indicates using the third exit encountered while navigating a roundabout in a clockwise
direction.
public static final Maneuver.Icon ROUNDABOUT_4_LH
An icon that indicates using the fourth exit encountered while navigating a roundabout in a clockwise
direction.
public static final Maneuver.Icon ROUNDABOUT_5_LH
An icon that indicates using the fifth exit encountered while navigating a roundabout in a clockwise
direction.
public static final Maneuver.Icon ROUNDABOUT_6_LH
An icon that indicates using the sixth exit encountered while navigating a roundabout in a clockwise
direction.
public static final Maneuver.Icon ROUNDABOUT_7_LH
An icon that indicates using the seventh exit encountered while navigating a roundabout in a
clockwise direction.
HERE SDK for Android Developer's Guide
► API Reference
596
public static final Maneuver.Icon ROUNDABOUT_8_LH
An icon that indicates using the eighth exit encountered while navigating a roundabout in a clockwise
direction.
public static final Maneuver.Icon ROUNDABOUT_9_LH
An icon that indicates using the ninth exit encountered while navigating a roundabout in a clockwise
direction.
public static final Maneuver.Icon ROUNDABOUT_10_LH
An icon that indicates using the tenth exit encountered while navigating a roundabout in a clockwise
direction.
public static final Maneuver.Icon ROUNDABOUT_11_LH
An icon that indicates using the eleventh exit encountered while navigating a roundabout in a
clockwise direction.
public static final Maneuver.Icon ROUNDABOUT_12_LH
An icon that indicates using the twelfth exit encountered while navigating a roundabout in a clockwise
direction.
public static final Maneuver.Icon START
An icon that indicates the start point (displayed when route navigation has not yet begun).
public static final Maneuver.Icon END
An icon that indicates the destination point.
public static final Maneuver.Icon FERRY
An icon that indicates boarding a ferry.
HERE SDK for Android Developer's Guide
► API Reference
597
public static final Maneuver.Icon PASS_STATION
An icon that indicates passing a station.
public static final Maneuver.Icon HEAD_TO
Leaving public transit station.
public static final Maneuver.Icon CHANGE_LINE
Changing public transit line.
Method Details
public int value ()
public static Maneuver.Icon valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Maneuver.Icon[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
TrafficDirection
The enumeration TrafficDirection is a member of com.here.android.mpa.routing.Maneuver .
HERE SDK for Android Developer's Guide
► API Reference
598
Enumeration Summary
public static final enumeration Maneuver.TrafficDirection
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing possible traffic directions, the side of road on which one must drive.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 249: Enum Constants in TrafficDirection
Fields
public static final Maneuver.TrafficDirection
LEFT
Traffic flows on the left side of the road, as in the UK.
public static final Maneuver.TrafficDirection
RIGHT
Traffic flows on the right side of the road, as in the USA.
Method Summary
Table 250: Methods in TrafficDirection
Methods
public int
value ()
public static Maneuver.TrafficDirection
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Maneuver.TrafficDirection[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing possible traffic directions, the side of road on which one must drive.
Enum Constant Details
public static final Maneuver.TrafficDirection LEFT
Traffic flows on the left side of the road, as in the UK.
HERE SDK for Android Developer's Guide
► API Reference
599
public static final Maneuver.TrafficDirection RIGHT
Traffic flows on the right side of the road, as in the USA.
Method Details
public int value ()
public static Maneuver.TrafficDirection valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Maneuver.TrafficDirection[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Turn
The enumeration Turn is a member of com.here.android.mpa.routing.Maneuver .
Enumeration Summary
public static final enumeration Maneuver.Turn
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing possible turns within a Maneuver.
[For complete information, see the section Enumeration Details]
HERE SDK for Android Developer's Guide
► API Reference
Enum Constant Summary
Table 251: Enum Constants in Turn
Fields
public static final Maneuver.Turn
UNDEFINED
An undefined turn.
public static final Maneuver.Turn
NO_TURN
Indicates that no turn is necessary.
public static final Maneuver.Turn
KEEP_MIDDLE
A turn that indicates keeping to the middle when a road forks.
public static final Maneuver.Turn
KEEP_RIGHT
A turn that indicates keeping to the right when a road forks.
public static final Maneuver.Turn
LIGHT_RIGHT
A turn that indicates making a light right turn.
public static final Maneuver.Turn
QUITE_RIGHT
A turn that indicates making a normal right turn.
public static final Maneuver.Turn
HEAVY_RIGHT
A turn that indicates making a heavy right turn.
public static final Maneuver.Turn
KEEP_LEFT
A turn that indicates keeping to the left when a road forks.
public static final Maneuver.Turn
LIGHT_LEFT
A turn that indicates making a light left turn.
public static final Maneuver.Turn
QUITE_LEFT
A turn that indicates making a normal left turn.
public static final Maneuver.Turn
HEAVY_LEFT
A turn that indicates making a heavy left turn.
public static final Maneuver.Turn
RETURN
A turn that indicates turning around or making a U-turn.
public static final Maneuver.Turn
ROUNDABOUT_1
A turn that indicates taking the first exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_2
600
HERE SDK for Android Developer's Guide
► API Reference
Fields
A turn that indicates taking the second exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_3
A turn that indicates taking the third exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_4
A turn that indicates taking the fourth exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_5
A turn that indicates taking the fifth exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_6
A turn that indicates taking the sixth exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_7
A turn that indicates taking the seventh exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_8
A turn that indicates taking the eighth exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_9
A turn that indicates taking the ninth exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_10
A turn that indicates taking the tenth exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_11
A turn that indicates taking the eleventh exit in a roundabout.
public static final Maneuver.Turn
ROUNDABOUT_12
A turn that indicates taking the twelfth exit in a roundabout.
Method Summary
Table 252: Methods in Turn
Methods
public int
value ()
public static Maneuver.Turn
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Maneuver.Turn[]
values ()
601
HERE SDK for Android Developer's Guide
► API Reference
Methods
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing possible turns within a Maneuver.
Enum Constant Details
public static final Maneuver.Turn UNDEFINED
An undefined turn.
public static final Maneuver.Turn NO_TURN
Indicates that no turn is necessary.
public static final Maneuver.Turn KEEP_MIDDLE
A turn that indicates keeping to the middle when a road forks.
public static final Maneuver.Turn KEEP_RIGHT
A turn that indicates keeping to the right when a road forks.
public static final Maneuver.Turn LIGHT_RIGHT
A turn that indicates making a light right turn.
public static final Maneuver.Turn QUITE_RIGHT
A turn that indicates making a normal right turn.
public static final Maneuver.Turn HEAVY_RIGHT
A turn that indicates making a heavy right turn.
602
HERE SDK for Android Developer's Guide
► API Reference
public static final Maneuver.Turn KEEP_LEFT
A turn that indicates keeping to the left when a road forks.
public static final Maneuver.Turn LIGHT_LEFT
A turn that indicates making a light left turn.
public static final Maneuver.Turn QUITE_LEFT
A turn that indicates making a normal left turn.
public static final Maneuver.Turn HEAVY_LEFT
A turn that indicates making a heavy left turn.
public static final Maneuver.Turn RETURN
A turn that indicates turning around or making a U-turn.
public static final Maneuver.Turn ROUNDABOUT_1
A turn that indicates taking the first exit in a roundabout.
public static final Maneuver.Turn ROUNDABOUT_2
A turn that indicates taking the second exit in a roundabout.
public static final Maneuver.Turn ROUNDABOUT_3
A turn that indicates taking the third exit in a roundabout.
public static final Maneuver.Turn ROUNDABOUT_4
A turn that indicates taking the fourth exit in a roundabout.
603
HERE SDK for Android Developer's Guide
► API Reference
public static final Maneuver.Turn ROUNDABOUT_5
A turn that indicates taking the fifth exit in a roundabout.
public static final Maneuver.Turn ROUNDABOUT_6
A turn that indicates taking the sixth exit in a roundabout.
public static final Maneuver.Turn ROUNDABOUT_7
A turn that indicates taking the seventh exit in a roundabout.
public static final Maneuver.Turn ROUNDABOUT_8
A turn that indicates taking the eighth exit in a roundabout.
public static final Maneuver.Turn ROUNDABOUT_9
A turn that indicates taking the ninth exit in a roundabout.
public static final Maneuver.Turn ROUNDABOUT_10
A turn that indicates taking the tenth exit in a roundabout.
public static final Maneuver.Turn ROUNDABOUT_11
A turn that indicates taking the eleventh exit in a roundabout.
public static final Maneuver.Turn ROUNDABOUT_12
A turn that indicates taking the twelfth exit in a roundabout.
Method Details
public int value ()
604
HERE SDK for Android Developer's Guide
► API Reference
605
public static Maneuver.Turn valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Maneuver.Turn[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Route
The class Route is a member of com.here.android.mpa.routing .
Class Summary
public final class Route
extends java.lang.Object
Represents a distinct path connecting two or more waypoints GeoCoordinate .
[For complete information, see the section Class Details]
See also:
Nested Class Summary
Table 253: Nested Classes in Route
Nested Classes
public static final enumeration
Enumeration for calculating route duration.
Route.SpeedType
HERE SDK for Android Developer's Guide
606
► API Reference
Nested Classes
public static final enumeration
Route.TrafficPenaltyMode
Enumeration for calculating route duration.
Field Summary
Table 254: Fields in Route
Fields
public static final int
WHOLE_ROUTE
See getTta(SpeedType, int) and getTta(TrafficPenaltyMode, int).
Method Summary
Table 255: Methods in Route
Methods
public boolean
equals (Object obj)
Compare with other Route using hash code
public GeoBoundingBox
getBoundingBox ()
Gets the smallest GeoBoundingBox that contains the entire route.
public GeoCoordinate
getDestination ()
Gets the destination coordinate for the route.
public Maneuver
getFirstManeuver ()
Returns the first Maneuver.
public int
getLength ()
Gets the length of the route, in meters.
public java.util.List <com.here.android.mpa.routing.Maneuver>
getManeuvers ()
Gets the list of all maneuvers that travelers will encounter along the route.
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
Gets the list of all GeoCoordinate values representing, in order, the polyline of the route.
public RoutePlan
getRoutePlan ()
Returns the route plan for defining a route with one or more route legs.
public GeoCoordinate
getStart ()
getRouteGeometry ()
HERE SDK for Android Developer's Guide
607
► API Reference
Methods
Gets the starting coordinate for the route.
public int
getSublegCount ()
Returns the number of sub-legs the route has.
public RouteTta
getTta (Route.SpeedType type, int subleg)
Deprecated: As of SDK 2.1.
Gets the estimated time to arrival of a subleg of a Route with a given Route.SpeedType.
public RouteTta
getTta (Route.TrafficPenaltyMode mode, int subleg)
Gets the estimated time to arrival with current traffic conditions.
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
getWaypoints ()
Gets the list of all waypoints for the route.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents a distinct path connecting two or more waypoints GeoCoordinate . A Route consists of
a list of maneuvers and route links.
See also:
Field Details
public static final int WHOLE_ROUTE
See getTta(SpeedType, int) and getTta(TrafficPenaltyMode, int).
Method Details
public boolean equals (Object obj)
Compare with other Route using hash code
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
obj
608
public GeoBoundingBox getBoundingBox ()
Gets the smallest GeoBoundingBox that contains the entire route.
Returns:
The GeoBoundingBox
public GeoCoordinate getDestination ()
Gets the destination coordinate for the route.
Returns:
The destination GeoCoordinate
public Maneuver getFirstManeuver ()
Returns the first Maneuver.
Returns:
the first Maneuver, null if there are no maneuvers
public int getLength ()
Gets the length of the route, in meters.
Returns:
The route length in meters
public java.util.List <com.here.android.mpa.routing.Maneuver> getManeuvers
()
Gets the list of all maneuvers that travelers will encounter along the route. If the
RouteOptions.TransportMode of the route is PUBLIC_TRANSPORT.
Returns:
HERE SDK for Android Developer's Guide
► API Reference
609
The list of Maneuver objects
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
getRouteGeometry ()
Gets the list of all GeoCoordinate values representing, in order, the polyline of the route.
Returns:
A list of GeoCoordinate values
See also:
public RoutePlan getRoutePlan ()
Returns the route plan for defining a route with one or more route legs. Route legs are formed by a
list of stop overs in the route plan. Each route leg has it's own route options.
Returns:
RoutePlan
public GeoCoordinate getStart ()
Gets the starting coordinate for the route.
Returns:
The starting GeoCoordinate
public int getSublegCount ()
HERE SDK for Android Developer's Guide
► API Reference
610
Returns the number of sub-legs the route has. A sub leg is the part of a route between two stop
waypoints
Returns:
number of sublegs
public RouteTta getTta (Route.SpeedType type, int subleg)
Deprecated: As of SDK 2.1.
Instead always use getTta(TrafficPenaltyMode, int).
Gets the estimated time to arrival of a subleg of a Route with a given Route.SpeedType.
Parameters:
type
The SpeedType to use for the calculation.
subleg
The subleg to calculate the time to arrival for. Typically there is a subleg between each waypoint. Use WHOLE_ROUTE to calculate time to arrival for
the whole route.
Returns:
The RouteTta of the subleg.
public RouteTta getTta (Route.TrafficPenaltyMode mode, int subleg)
Gets the estimated time to arrival with current traffic conditions.
Parameters:
mode
The Route.TrafficPenaltyMode to be used for this calculation. Must not be
AVOID_CONGESTION.
subleg
The subleg number to use or WHOLE_ROUTE for the whole route.
Returns:
The RouteTta of the subleg.
HERE SDK for Android Developer's Guide
► API Reference
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
getWaypoints ()
Gets the list of all waypoints for the route.
Returns:
The list of GeoCoordinate objects
public int hashCode ()
For documentation, see java.lang.Object
SpeedType
The enumeration SpeedType is a member of com.here.android.mpa.routing.Route .
Enumeration Summary
public static final enumeration Route.SpeedType
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Enumeration for calculating route duration.
Deprecated: As of SDK 2.1.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 256: Enum Constants in SpeedType
Fields
public static final Route.SpeedType
DEFAULT
Use the same speeds used during routing.
public static final Route.SpeedType
STATIC
Uses static speed information based on the map data.
public static final Route.SpeedType
HISTORICAL
Use historical speeds, where available; otherwise equivalent to STATIC
611
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 257: Methods in SpeedType
Methods
public int
value ()
public static Route.SpeedType
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Route.SpeedType[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Deprecated: As of SDK 2.1.
Use Route.TrafficPenaltyMode instead.
Enumeration for calculating route duration. See getTta(SpeedType, int) .
Enum Constant Details
public static final Route.SpeedType DEFAULT
Use the same speeds used during routing. Includes dynamic events, e.g. traffic if enabled
public static final Route.SpeedType STATIC
Uses static speed information based on the map data.
public static final Route.SpeedType HISTORICAL
Use historical speeds, where available; otherwise equivalent to STATIC
Method Details
public int value ()
public static Route.SpeedType valueOf (String name)
612
HERE SDK for Android Developer's Guide
► API Reference
613
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Route.SpeedType[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
TrafficPenaltyMode
The enumeration TrafficPenaltyMode is a member of com.here.android.mpa.routing.Route .
Enumeration Summary
public static final enumeration Route.TrafficPenaltyMode
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Enumeration for calculating route duration.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 258: Enum Constants in TrafficPenaltyMode
Fields
public static final Route.TrafficPenaltyMode
DISABLED
Default mode.
public static final Route.TrafficPenaltyMode
OPTIMAL
Use speed informations to compute a time optimized route.
public static final Route.TrafficPenaltyMode
Avoid road closed and severe congestion.
AVOID_CONGESTION
HERE SDK for Android Developer's Guide
► API Reference
614
Method Summary
Table 259: Methods in TrafficPenaltyMode
Methods
public int
value ()
public static Route.TrafficPenaltyMode
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Route.TrafficPenaltyMode[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Enumeration for calculating route duration. This is the mode used for traffic events handling. See
getTta(TrafficPenaltyMode, int) .
Enum Constant Details
public static final Route.TrafficPenaltyMode DISABLED
Default mode. Route duration calculation will not take any traffic penalty into consideration
public static final Route.TrafficPenaltyMode OPTIMAL
Use speed informations to compute a time optimized route.
public static final Route.TrafficPenaltyMode AVOID_CONGESTION
Avoid road closed and severe congestion.
Method Details
public int value ()
public static Route.TrafficPenaltyMode valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
HERE SDK for Android Developer's Guide
► API Reference
615
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Route.TrafficPenaltyMode[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
RouteElement
The class RouteElement is a member of com.here.android.mpa.routing .
Class Summary
public final class RouteElement
extends java.lang.Object
Represents an element within a Route.
[For complete information, see the section Class Details]
See also:
Nested Class Summary
Table 260: Nested Classes in RouteElement
Nested Classes
public static final enumeration
RouteElement.Type
Represents values describing the possible types of a RouteElement.
HERE SDK for Android Developer's Guide
616
► API Reference
Method Summary
Table 261: Methods in RouteElement
Methods
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
getGeometry ()
Returns the geometry of the route element.
public RoadElement
getRoadElement ()
Returns the RoadElement associated with this RouteElement.
public RouteElement.Type
getType ()
Gets the type of the RouteElement
Class Details
Represents an element within a Route. Please note that RouteElements are also associated with
Maneuver instances within a Route .
See also:
Method Details
public java.util.List <com.here.android.mpa.common.GeoCoordinate>
getGeometry ()
Returns the geometry of the route element. The geometry is a returned as a list of GeoCoordinate
that can be used to create a polyline.
Returns:
a list of GeoCoordinate
public RoadElement getRoadElement ()
Returns the RoadElement associated with this RouteElement. Each route element has an associated
road element.
Returns:
the associated RoadElement.
HERE SDK for Android Developer's Guide
► API Reference
public RouteElement.Type getType ()
Gets the type of the RouteElement
Returns:
type of the RouteElement
Type
The enumeration Type is a member of com.here.android.mpa.routing.RouteElement .
Enumeration Summary
public static final enumeration RouteElement.Type
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing the possible types of a RouteElement.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 262: Enum Constants in Type
Fields
public static final RouteElement.Type
TRANSIT
Type of RouteElement is transit.
public static final RouteElement.Type
ROAD
Type of RouteElement is road.
public static final RouteElement.Type
Type of RouteElement is invalid.
INVALID
617
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 263: Methods in Type
Methods
public int
value ()
public static RouteElement.Type
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RouteElement.Type[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing the possible types of a RouteElement.
Enum Constant Details
public static final RouteElement.Type TRANSIT
Type of RouteElement is transit.
public static final RouteElement.Type ROAD
Type of RouteElement is road.
public static final RouteElement.Type INVALID
Type of RouteElement is invalid.
Method Details
public int value ()
public static RouteElement.Type valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
618
HERE SDK for Android Developer's Guide
► API Reference
619
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RouteElement.Type[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
RouteManager
The class RouteManager is a member of com.here.android.mpa.routing .
Class Summary
public class RouteManager
extends java.lang.Object
Represents a manager responsible for calculating a Route from a RoutePlan, with a
RouteManager.Listener to monitor calculation progress and trigger appropriate callback methods
upon completion.
[For complete information, see the section Class Details]
Nested Class Summary
Table 264: Nested Classes in RouteManager
Nested Classes
public static final enumeration
RouteManager.Error
Represents values describing possible route calculation errors.
public static abstract interface
RouteManager.Listener
Represents a listener to provide information about RouteManager events.\
HERE SDK for Android Developer's Guide
► API Reference
620
Constructor Summary
Table 265: Constructors in RouteManager
Constructors
RouteManager ()
Default constructor.
Method Summary
Table 266: Methods in RouteManager
Methods
public RouteManager.Error
listener)
calculateRoute (RoutePlan routePlan, RouteManager.Listener
Invokes an asynchronous route calculation.
public void
cancel ()
Cancels the current route calculation.
public static RouteManager
getInstance ()
Deprecated: As of SDK 2.1.1.
Get access to the RouteManager Singleton
public boolean
isBusy ()
Query whether the RouteManager is currently busy computing a route.
Class Details
Represents a manager responsible for calculating a Route from a RoutePlan, with a
RouteManager.Listener to monitor calculation progress and trigger appropriate callback methods
upon completion.
Before using a RouteManager , an application must set appropriate the HERE developer credentials.
Constructor Details
RouteManager ()
Default constructor.
HERE SDK for Android Developer's Guide
► API Reference
621
Method Details
public RouteManager.Error calculateRoute (RoutePlan routePlan,
RouteManager.Listener listener)
Invokes an asynchronous route calculation. Upon completion of the request, the Listener will be
invoked regardless if the request is completed successfully or not.
Parameters:
routePlan
A RoutePlan used to calculate the route
listener
A Listener for the RouteManager
Returns:
The RouteManager.Error error code, one of:
•
•
•
•
RouteManager.Error#NONE if route calculation is started
RouteManager.Error#INVALID_OPERATION if a route calculation could not be started
because a calculation is already in progress
RouteManager.Error#INVALID_PARAMETERS if any of the input parameters is null
All other errors also indicate route calculation could not be started
public void cancel ()
Cancels the current route calculation. Note that this API is asynchronous as it takes some time cancel
all underlying operations. {Please use RouteManager#isBusy() to check when the RouteManager
is free again.
public static RouteManager getInstance ()
Deprecated: As of SDK 2.1.1.
Use RouteManager() instead.
Get access to the RouteManager Singleton
Returns:
RouteManager instance
HERE SDK for Android Developer's Guide
► API Reference
public boolean isBusy ()
Query whether the RouteManager is currently busy computing a route.
Returns:
true if a route calculation is ongoing, false otherwise.
Error
The enumeration Error is a member of com.here.android.mpa.routing.RouteManager .
Enumeration Summary
public static final enumeration RouteManager.Error
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing possible route calculation errors.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 267: Enum Constants in Error
Fields
public static final RouteManager.Error
NONE
There was no calculation error.
public static final RouteManager.Error
UNKNOWN
There was an unknown error preventing calculation.
public static final RouteManager.Error
OUT_OF_MEMORY
An out-of-memory error prevented calculation.
public static final RouteManager.Error
INVALID_PARAMETERS
Parameters passed to calculateRoute(RoutePlan, Listener) were invalid.
public static final RouteManager.Error
INVALID_OPERATION
622
HERE SDK for Android Developer's Guide
► API Reference
Fields
The operation is not allowed at this time because another request is in progress.
public static final RouteManager.Error
GRAPH_DISCONNECTED
No route was found.
public static final RouteManager.Error
GRAPH_DISCONNECTED_CHECK_OPTIONS
No route was found, one of the RouteOptions might be preventing calculation.
public static final RouteManager.Error
NO_START_POINT
No start point was found.
public static final RouteManager.Error
NO_END_POINT
No end point was found.
public static final RouteManager.Error
NO_END_POINT_CHECK_OPTIONS
The end point is unreachable, possibly due to one of the RouteOptions.
public static final RouteManager.Error
CANNOT_DO_PEDESTRIAN
A PEDESTRIAN transport mode was set but was not practical (possibly the route is too long).
public static final RouteManager.Error
ROUTING_CANCELLED
An application user cancelled the calculation.
public static final RouteManager.Error
VIOLATES_OPTIONS
A route was found but is invalid because it makes use of roads that were disabled by RouteOptions.
public static final RouteManager.Error
ROUTE_CORRUPTED
Could not decode the route as received from the server.
public static final RouteManager.Error
INVALID_CREDENTIALS
The route cannot be calculated because the HERE Developer credentials are invalid or were not provided.
public static final RouteManager.Error
REQUEST_TIMEOUT
The online route calculation request has timed out.
public static final RouteManager.Error
PT_ROUTING_UNAVAILABLE
The route cannot be calculated using PUBLIC_TRANSPORT.
public static final RouteManager.Error
OPERATION_NOT_ALLOWED
Caller do not have enough permission to execute the operation
public static final RouteManager.Error
No internet connection is available.
NO_CONNECTIVITY
623
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 268: Methods in Error
Methods
public int
value ()
public static RouteManager.Error
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RouteManager.Error[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing possible route calculation errors.
Enum Constant Details
public static final RouteManager.Error NONE
There was no calculation error.
public static final RouteManager.Error UNKNOWN
There was an unknown error preventing calculation.
public static final RouteManager.Error OUT_OF_MEMORY
An out-of-memory error prevented calculation.
public static final RouteManager.Error INVALID_PARAMETERS
Parameters passed to calculateRoute(RoutePlan, Listener) were invalid.
public static final RouteManager.Error INVALID_OPERATION
The operation is not allowed at this time because another request is in progress.
624
HERE SDK for Android Developer's Guide
► API Reference
625
public static final RouteManager.Error GRAPH_DISCONNECTED
No route was found.
public static final RouteManager.Error GRAPH_DISCONNECTED_CHECK_OPTIONS
No route was found, one of the RouteOptions might be preventing calculation.
public static final RouteManager.Error NO_START_POINT
No start point was found.
public static final RouteManager.Error NO_END_POINT
No end point was found.
public static final RouteManager.Error NO_END_POINT_CHECK_OPTIONS
The end point is unreachable, possibly due to one of the RouteOptions.
public static final RouteManager.Error CANNOT_DO_PEDESTRIAN
A PEDESTRIAN transport mode was set but was not practical (possibly the route is too long).
public static final RouteManager.Error ROUTING_CANCELLED
An application user cancelled the calculation.
public static final RouteManager.Error VIOLATES_OPTIONS
A route was found but is invalid because it makes use of roads that were disabled by RouteOptions.
public static final RouteManager.Error ROUTE_CORRUPTED
Could not decode the route as received from the server.
HERE SDK for Android Developer's Guide
► API Reference
626
public static final RouteManager.Error INVALID_CREDENTIALS
The route cannot be calculated because the HERE Developer credentials are invalid or were not
provided.
public static final RouteManager.Error REQUEST_TIMEOUT
The online route calculation request has timed out.
public static final RouteManager.Error PT_ROUTING_UNAVAILABLE
The route cannot be calculated using PUBLIC_TRANSPORT.
public static final RouteManager.Error OPERATION_NOT_ALLOWED
Caller do not have enough permission to execute the operation
public static final RouteManager.Error NO_CONNECTIVITY
No internet connection is available.
Method Details
public int value ()
public static RouteManager.Error valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RouteManager.Error[] values ()
HERE SDK for Android Developer's Guide
► API Reference
627
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Listener
The interface Listener is a member of com.here.android.mpa.routing.RouteManager .
Interface Summary
public static abstract interface RouteManager.Listener
Represents a listener to provide information about RouteManager events.\
[For complete information, see the section Interface Details]
See also:
Method Summary
Table 269: Methods in Listener
Methods
public abstract void onCalculateRouteFinished (RouteManager.Error errorCode, java.util.List
<com.here.android.mpa.routing.RouteResult> routeResults)
A callback indicating that a route calculation operation has finished.
public abstract void
onProgress (int percentage)
A callback indicating the progress level of the current route calculation operation, a percentage value within the range of
[0..100].
Interface Details
Represents a listener to provide information about RouteManager events.\
See also:
HERE SDK for Android Developer's Guide
► API Reference
628
Method Details
public abstract void onCalculateRouteFinished (RouteManager.Error errorCode,
java.util.List <com.here.android.mpa.routing.RouteResult> routeResults)
A callback indicating that a route calculation operation has finished. In the case of
VIOLATES_OPTIONS, one or more RouteResult in the returned list contains a list of violated
RouteOptions . For other java.lang.Error , the list size of RouteResult will be 0.
Parameters:
errorCode
A java.lang.Error indicating the error code for the route calculation
(could be NONE)
routeResults
A List of RouteResult
See also:
routing.RouteResult.getViolatedOptions ()
public abstract void onProgress (int percentage)
A callback indicating the progress level of the current route calculation operation, a percentage value
within the range of [0..100]. Note that in certain circumstances a recalculation is required and this
percentage will go from 100 to 0.
Parameters:
percentage
Progress completion percentage
RouteOptions
The class RouteOptions is a member of com.here.android.mpa.routing .
Class Summary
public final class RouteOptions
extends java.lang.Object
This is the definition of the RouteOptions class.
HERE SDK for Android Developer's Guide
► API Reference
[For complete information, see the section Class Details]
Nested Class Summary
Table 270: Nested Classes in RouteOptions
Nested Classes
public static final enumeration
RouteOptions.TimeType
Ways that the time can be specified.
public static final enumeration
RouteOptions.TransportMode
Represents values describing different mode of transportation a person will be using.
public static final enumeration
RouteOptions.Type
Represents different types of routing, such as by speed or by distance.
Constructor Summary
Table 271: Constructors in RouteOptions
Constructors
RouteOptions ()
Public Constructor
Method Summary
Table 272: Methods in RouteOptions
Methods
public boolean
areCarShuttleTrainsAllowed ()
Checks whether Car Shuttle Trains are allowed.
public boolean
areDirtRoadsAllowed ()
Checks whether Dirt Roads are allowed.
public boolean
areFerriesAllowed ()
Checks whether Ferries are allowed.
public boolean
areHighwaysAllowed ()
Checks whether Highways are allowed.
public boolean
areParksAllowed ()
629
HERE SDK for Android Developer's Guide
► API Reference
Methods
Checks whether Parks are allowed.
public boolean
areTollRoadsAllowed ()
Checks whether Toll Roads are allowed.
public boolean
areTunnelsAllowed ()
Checks whether Tunnels are allowed.
public int
getRouteCount ()
Gets the current desired number of route
public RouteOptions.Type
getRouteType ()
Gets the Route Type, see RouteOptions.Type for valid values
public int
getStartDirection ()
Returns the start direction.
public RouteOptions.TimeType
getTime (Date date)
Gets the arrival or departure time that has been set.
public RouteOptions.TransportMode
getTransportMode ()
Gets the Transport Mode, see RouteOptions.TransportMode for valid values
public boolean
isCarpoolAllowed ()
Check if usage of HOV/Carpool roads is allowed.
public RouteOptions
setCarShuttleTrainsAllowed (boolean value)
Sets whether Car Shuttle Trains are allowed.
public RouteOptions
setCarpoolAllowed (boolean value)
Allow or disallow usage of HOV/Carpool roads.
public RouteOptions
setDirtRoadsAllowed (boolean value)
Sets whether Dirt Roads are allowed.
public RouteOptions
setFerriesAllowed (boolean value)
Sets whether Ferries are allowed.
public RouteOptions
setHighwaysAllowed (boolean value)
Sets whether Highways are allowed.
public RouteOptions
setParksAllowed (boolean value)
Sets whether Parks are allowed.
public RouteOptions
setRouteCount (int count)
630
HERE SDK for Android Developer's Guide
► API Reference
Methods
Sets the desired number of route.
public RouteOptions
setRouteType (RouteOptions.Type routeType)
Sets the Route Type, see RouteOptions.Type for valid values
public RouteOptions
setStartDirection (int dirInDegrees)
Start direction.
public RouteOptions
setTime (Date time, RouteOptions.TimeType type)
Sets the arrival or departure time.
public RouteOptions
setTollRoadsAllowed (boolean value)
Sets whether Toll Roads are allowed.
public RouteOptions
setTransportMode (RouteOptions.TransportMode mode)
Sets the Transport Mode.
public RouteOptions
setTunnelsAllowed (boolean value)
Sets whether Tunnels are allowed.
Class Details
This is the definition of the RouteOptions class. The class contains options for route calculation.
Constructor Details
RouteOptions ()
Public Constructor
Method Details
public boolean areCarShuttleTrainsAllowed ()
Checks whether Car Shuttle Trains are allowed.
Returns:
true if allowed otherwise false.
public boolean areDirtRoadsAllowed ()
631
HERE SDK for Android Developer's Guide
► API Reference
Checks whether Dirt Roads are allowed.
Returns:
true if allowed otherwise false.
public boolean areFerriesAllowed ()
Checks whether Ferries are allowed.
Returns:
true if allowed otherwise false.
public boolean areHighwaysAllowed ()
Checks whether Highways are allowed.
Returns:
true if allowed otherwise false.
public boolean areParksAllowed ()
Checks whether Parks are allowed.
Returns:
true if allowed otherwise false.
public boolean areTollRoadsAllowed ()
Checks whether Toll Roads are allowed.
Returns:
true if allowed otherwise false.
public boolean areTunnelsAllowed ()
Checks whether Tunnels are allowed.
Returns:
632
HERE SDK for Android Developer's Guide
► API Reference
633
true if allowed otherwise false.
public int getRouteCount ()
Gets the current desired number of route
Returns:
current desired number of route
public RouteOptions.Type getRouteType ()
Gets the Route Type, see RouteOptions.Type for valid values
Returns:
The current Type.
public int getStartDirection ()
Returns the start direction.
Returns:
The start direction in degrees. Value is between 0-359.
public RouteOptions.TimeType getTime (Date date)
Gets the arrival or departure time that has been set.
Parameters:
date
Output parameter where the date will be set. This may be null if the caller is
only interested in the RouteOptions.TimeType.
Returns:
The TimeType of the parameter upon completion.
HERE SDK for Android Developer's Guide
► API Reference
public RouteOptions.TransportMode getTransportMode ()
Gets the Transport Mode, see RouteOptions.TransportMode for valid values
Returns:
The {code TransportMode} to be used for this RouteOptions.
public boolean isCarpoolAllowed ()
Check if usage of HOV/Carpool roads is allowed.
Returns:
true if allowed, otherwise false.
public RouteOptions setCarShuttleTrainsAllowed (boolean value)
Sets whether Car Shuttle Trains are allowed.
Parameters:
value
true if allowed otherwise false.
634
HERE SDK for Android Developer's Guide
► API Reference
Returns:
The modified RouteOptions itself.
public RouteOptions setCarpoolAllowed (boolean value)
Allow or disallow usage of HOV/Carpool roads.
Parameters:
value
Use true if allowed, otherwise false.
Returns:
The modified RouteOptions itself.
public RouteOptions setDirtRoadsAllowed (boolean value)
Sets whether Dirt Roads are allowed.
Parameters:
value
true if allowed otherwise false.
Returns:
The modified RouteOptions itself.
public RouteOptions setFerriesAllowed (boolean value)
Sets whether Ferries are allowed.
Parameters:
value
true if allowed otherwise false.
Returns:
The modified RouteOptions itself.
public RouteOptions setHighwaysAllowed (boolean value)
Sets whether Highways are allowed.
635
HERE SDK for Android Developer's Guide
► API Reference
Parameters:
value
true if allowed otherwise false.
Returns:
The modified RouteOptions itself.
public RouteOptions setParksAllowed (boolean value)
Sets whether Parks are allowed.
Parameters:
value
Use true if allowed, otherwise false.
Returns:
The modified RouteOptions itself.
public RouteOptions setRouteCount (int count)
Sets the desired number of route.
Values greater than 10 are ignored if RouteOptions.TransportMode is set to public transport and
online timetables are enabled.
Parameters:
count
route count
Returns:
The modified RouteOptions itself.
public RouteOptions setRouteType (RouteOptions.Type routeType)
Sets the Route Type, see RouteOptions.Type for valid values
Parameters:
636
HERE SDK for Android Developer's Guide
► API Reference
routeType
637
Type
Returns:
The modified RouteOptions itself.
public RouteOptions setStartDirection (int dirInDegrees)
Start direction. The direction routing should start. Used for example not to route against one way
streets. The direction is disregarded, if RouteOptions.TransportMode is pedestrian. Use values
between 0-359. If greater value than 359 is specified, modulo of 360 is used.
Parameters:
dirInDegrees
Start direction in degrees. 0 is north, increases clockwise (ie. 90 is east).
Returns:
The modified RouteOptions itself.
public RouteOptions setTime (Date time, RouteOptions.TimeType type)
Sets the arrival or departure time.
Parameters:
time
The time to set.
type
The type of time to set.
Returns:
The modified RouteOptions itself.
public RouteOptions setTollRoadsAllowed (boolean value)
Sets whether Toll Roads are allowed.
Parameters:
value
Returns:
true if allowed otherwise false.
HERE SDK for Android Developer's Guide
► API Reference
The modified RouteOptions itself.
public RouteOptions setTransportMode (RouteOptions.TransportMode mode)
Sets the Transport Mode.
Parameters:
mode
The desired RouteOptions.TransportMode to use.
Returns:
The modified RouteOptions itself.
public RouteOptions setTunnelsAllowed (boolean value)
Sets whether Tunnels are allowed.
Parameters:
value
Returns:
true if allowed otherwise false.
638
HERE SDK for Android Developer's Guide
► API Reference
The modified RouteOptions itself.
TimeType
The enumeration TimeType is a member of com.here.android.mpa.routing.RouteOptions .
Enumeration Summary
public static final enumeration RouteOptions.TimeType
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Ways that the time can be specified.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 273: Enum Constants in TimeType
Fields
public static final RouteOptions.TimeType
DEPARTURE
Departure time.
public static final RouteOptions.TimeType
ARRIVAL
Arrival time.
Method Summary
Table 274: Methods in TimeType
Methods
public int
value ()
public static RouteOptions.TimeType
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RouteOptions.TimeType[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
639
HERE SDK for Android Developer's Guide
► API Reference
640
Enumeration Details
Ways that the time can be specified.
Enum Constant Details
public static final RouteOptions.TimeType DEPARTURE
Departure time.
public static final RouteOptions.TimeType ARRIVAL
Arrival time. NOTE: ARRIVAL time type option is currently unsupported. Using this value in
setTime(Date, TimeType) will result in an IllegalArgumentException to be thrown.
Method Details
public int value ()
public static RouteOptions.TimeType valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RouteOptions.TimeType[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
TransportMode
The enumeration TransportMode is a member of com.here.android.mpa.routing.RouteOptions .
HERE SDK for Android Developer's Guide
► API Reference
Enumeration Summary
public static final enumeration RouteOptions.TransportMode
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing different mode of transportation a person will be using.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 275: Enum Constants in TransportMode
Fields
public static final RouteOptions.TransportMode
CAR
A car is being used as the mode of transportation.
public static final RouteOptions.TransportMode
PEDESTRIAN
Walking is being used as the mode of transportation.
public static final RouteOptions.TransportMode
PUBLIC_TRANSPORT
(Available only for HybridPlus SDKs)
public static final RouteOptions.TransportMode
TRACK
Reserved for future usage.
public static final RouteOptions.TransportMode
TRUCK
Enterprise truck routing mode
public static final RouteOptions.TransportMode
UNDEFINED
Routing mode unknown or unsupported
Method Summary
Table 276: Methods in TransportMode
Methods
public int
value ()
public static RouteOptions.TransportMode
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RouteOptions.TransportMode[]
values ()
641
HERE SDK for Android Developer's Guide
► API Reference
642
Methods
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing different mode of transportation a person will be using. (for example,
Car, or Public Transit).
Enum Constant Details
public static final RouteOptions.TransportMode CAR
A car is being used as the mode of transportation.
public static final RouteOptions.TransportMode PEDESTRIAN
Walking is being used as the mode of transportation.
public static final RouteOptions.TransportMode PUBLIC_TRANSPORT
(Available only for HybridPlus SDKs)
Public transport is being used as the mode of transportation.
Note: a transit route may not be found if the walking distance from the start to the first transit
station, or from the final transit station to the end, is greater than 3 kilometers.
public static final RouteOptions.TransportMode TRACK
Reserved for future usage.
public static final RouteOptions.TransportMode TRUCK
Enterprise truck routing mode
public static final RouteOptions.TransportMode UNDEFINED
Routing mode unknown or unsupported
HERE SDK for Android Developer's Guide
► API Reference
643
Method Details
public int value ()
public static RouteOptions.TransportMode valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RouteOptions.TransportMode[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Type
The enumeration Type is a member of com.here.android.mpa.routing.RouteOptions .
Enumeration Summary
public static final enumeration RouteOptions.Type
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents different types of routing, such as by speed or by distance.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 277: Enum Constants in Type
Fields
public static final RouteOptions.Type
Search for the fastest route (minimizes travel time).
FASTEST
HERE SDK for Android Developer's Guide
► API Reference
644
Fields
public static final RouteOptions.Type
SHORTEST
Search for the shortest route (minimizes travel distance).
public static final RouteOptions.Type
ECONOMIC
Search for economic route.
Method Summary
Table 278: Methods in Type
Methods
public int
value ()
public static RouteOptions.Type
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RouteOptions.Type[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents different types of routing, such as by speed or by distance.
Note: a Type has no effect on PEDESTRIAN or PUBLIC_TRANSPORT transport modes, since they
always use FASTEST (if SHORTEST is set as the Type when one of these TransportMode types is
selected, it will be reset to FASTEST when a Route is calculated).
Enum Constant Details
public static final RouteOptions.Type FASTEST
Search for the fastest route (minimizes travel time).
public static final RouteOptions.Type SHORTEST
Search for the shortest route (minimizes travel distance). Car Mode Only
public static final RouteOptions.Type ECONOMIC
Search for economic route. Car Mode Only
HERE SDK for Android Developer's Guide
► API Reference
645
Method Details
public int value ()
public static RouteOptions.Type valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RouteOptions.Type[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
RoutePlan
The class RoutePlan is a member of com.here.android.mpa.routing .
Class Summary
public final class RoutePlan
extends java.lang.Object
This is the definition of the RoutePlan class.
[For complete information, see the section Class Details]
Constructor Summary
Table 279: Constructors in RoutePlan
Constructors
RoutePlan ()
HERE SDK for Android Developer's Guide
► API Reference
646
Constructors
Public Constructor
Method Summary
Table 280: Methods in RoutePlan
Methods
public RoutePlan
addWaypoint (GeoCoordinate point)
Adds a waypoint to the plan.
public RouteOptions
getRouteOptions ()
Gets the route options.
public GeoCoordinate
getWaypointAt (int index)
Gets a waypoint at a specified index.
public int
getWaypointCount ()
Gets the number of waypoints of the route plan.
public RoutePlan
insertWaypoint (GeoCoordinate point, int index)
Inserts a waypoint into a list of existing waypoints.
public RoutePlan
removeAllWaypoints ()
Removes all waypoints of the route plan.
public RoutePlan
removeWaypoint (int index)
Removes a waypoint at a specified index.
public RoutePlan
setRouteOptions (RouteOptions options)
Sets the route options.
Class Details
This is the definition of the RoutePlan class. A RoutePlan contains all information needed to calculate
a route. It can carry a number of way points GeoCoordinate.
Constructor Details
RoutePlan ()
Public Constructor
HERE SDK for Android Developer's Guide
► API Reference
Method Details
public RoutePlan addWaypoint (GeoCoordinate point)
Adds a waypoint to the plan.
Parameters:
point
The GeoCoordinate waypoint to add.
Returns:
This RoutePlan object
public RouteOptions getRouteOptions ()
Gets the route options.
Returns:
RouteOptions options associated with this plan.
public GeoCoordinate getWaypointAt (int index)
Gets a waypoint at a specified index.
Parameters:
index
The zero-based index.
Returns:
the waypoint, NULL if the index submitted is out of bounds.
public int getWaypointCount ()
Gets the number of waypoints of the route plan.
Returns:
the number of waypoints.
647
HERE SDK for Android Developer's Guide
► API Reference
648
public RoutePlan insertWaypoint (GeoCoordinate point, int index)
Inserts a waypoint into a list of existing waypoints. The position of the new waypoint is according to
the specified index.
Parameters:
point
The waypoint to insert
index
The index in the range from 0 to the number of already existing waypoints.
Returns:
This RoutePlan object
public RoutePlan removeAllWaypoints ()
Removes all waypoints of the route plan.
Returns:
This RoutePlan object
public RoutePlan removeWaypoint (int index)
Removes a waypoint at a specified index.
Parameters:
index
The zero-based index.
Returns:
This RoutePlan object
public RoutePlan setRouteOptions (RouteOptions options)
Sets the route options. This method does not retain a reference to options . If the options object
is updated, then this method must be called again for the changes to be in effect.
Parameters:
options
The RouteOptions to set.
HERE SDK for Android Developer's Guide
► API Reference
649
RouteResult
The class RouteResult is a member of com.here.android.mpa.routing .
Class Summary
public final class RouteResult
extends java.lang.Object
This is the definition of the RouteResult class.
[For complete information, see the section Class Details]
Nested Class Summary
Table 281: Nested Classes in RouteResult
Nested Classes
public static final enumeration
RouteResult.ViolatedOption
These are options which may be ignored by the routing engine; in such cases a list of violated options is returned in the
listener's on_end() method.
Method Summary
Table 282: Methods in RouteResult
Methods
public Route
getRoute ()
Returns the Route in the RouteResult.
public java.util.EnumSet <com.here.android.mpa.routing.RouteResult.ViolatedOption>
getViolatedOptions ()
Gets the violated options.
Class Details
This is the definition of the RouteResult class. It contains a Route as a result of route calculation and
a list of possible RouteResult.ViolatedOption
HERE SDK for Android Developer's Guide
► API Reference
650
Method Details
public Route getRoute ()
Returns the Route in the RouteResult.
Returns:
The Route
public java.util.EnumSet
<com.here.android.mpa.routing.RouteResult.ViolatedOption> getViolatedOptions
()
Gets the violated options.
Returns:
Set of RouteResult.ViolatedOption
ViolatedOption
The enumeration ViolatedOption is a member of com.here.android.mpa.routing.RouteResult .
Enumeration Summary
public static final enumeration RouteResult.ViolatedOption
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
These are options which may be ignored by the routing engine; in such cases a list of violated options
is returned in the listener's on_end() method.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 283: Enum Constants in ViolatedOption
Fields
public static final RouteResult.ViolatedOption
The route uses highways although ALLOW_HIGHWAYS was false.
AVOID_HIGHWAYS
HERE SDK for Android Developer's Guide
► API Reference
Fields
public static final RouteResult.ViolatedOption
AVOID_TOLL_ROADS
The route uses toll roads although ALLOW_TOLLROADS was false.
public static final RouteResult.ViolatedOption
AVOID_FERRIES
The route uses ferries although ALLOW_FERRIES was false.
public static final RouteResult.ViolatedOption
AVOID_TUNNELS
The route uses tunnels although ALLOW_TUNNELS was false.
public static final RouteResult.ViolatedOption
AVOID_DIRT_ROADS
The route uses dirt roads although ALLOW_DIRTROADS was false.
public static final RouteResult.ViolatedOption
AVOID_CAR_SHUTTLE_TRAINS
The route uses rail ferries although AVOID_CARSHUTTLETRAINS was false.
public static final RouteResult.ViolatedOption
AVOID_PARKS
The route uses paths through parks although ALLOW_PARKS was false.
public static final RouteResult.ViolatedOption
BLOCKED_ROADS
The route uses roads which were blocked by dynamic penalties.
public static final RouteResult.ViolatedOption
START_DIRECTION
The route's start direction is not as requested.
public static final RouteResult.ViolatedOption
CARPOOL
The route uses CARPOOL streets even though it is disabled in the options
public static final RouteResult.ViolatedOption
TIME_RESTRICTED_TURN
The route uses a time-restricted turn
Method Summary
Table 284: Methods in ViolatedOption
Methods
public int
value ()
public static RouteResult.ViolatedOption
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RouteResult.ViolatedOption[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
651
HERE SDK for Android Developer's Guide
► API Reference
652
Enumeration Details
These are options which may be ignored by the routing engine; in such cases a list of violated options
is returned in the listener's on_end() method.
Enum Constant Details
public static final RouteResult.ViolatedOption AVOID_HIGHWAYS
The route uses highways although ALLOW_HIGHWAYS was false.
public static final RouteResult.ViolatedOption AVOID_TOLL_ROADS
The route uses toll roads although ALLOW_TOLLROADS was false.
public static final RouteResult.ViolatedOption AVOID_FERRIES
The route uses ferries although ALLOW_FERRIES was false.
public static final RouteResult.ViolatedOption AVOID_TUNNELS
The route uses tunnels although ALLOW_TUNNELS was false.
public static final RouteResult.ViolatedOption AVOID_DIRT_ROADS
The route uses dirt roads although ALLOW_DIRTROADS was false.
public static final RouteResult.ViolatedOption AVOID_CAR_SHUTTLE_TRAINS
The route uses rail ferries although AVOID_CARSHUTTLETRAINS was false.
public static final RouteResult.ViolatedOption AVOID_PARKS
The route uses paths through parks although ALLOW_PARKS was false.
public static final RouteResult.ViolatedOption BLOCKED_ROADS
The route uses roads which were blocked by dynamic penalties.
HERE SDK for Android Developer's Guide
► API Reference
653
public static final RouteResult.ViolatedOption START_DIRECTION
The route's start direction is not as requested.
public static final RouteResult.ViolatedOption CARPOOL
The route uses CARPOOL streets even though it is disabled in the options
public static final RouteResult.ViolatedOption TIME_RESTRICTED_TURN
The route uses a time-restricted turn
Method Details
public int value ()
public static RouteResult.ViolatedOption valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RouteResult.ViolatedOption[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
RouteTta
The class RouteTta is a member of com.here.android.mpa.routing .
HERE SDK for Android Developer's Guide
654
► API Reference
Class Summary
public final class RouteTta
extends java.lang.Object
Describes Time To Arrival details for a given route.
[For complete information, see the section Class Details]
Nested Class Summary
Table 285: Nested Classes in RouteTta
Nested Classes
public static final enumeration
RouteTta.Detail
Additional Time To Arrival Details
Method Summary
Table 286: Methods in RouteTta
Methods
public java.util.EnumSet <com.here.android.mpa.routing.RouteTta.Detail>
getDetails ()
Details of the blockage (if any).
public int
getDuration ()
Gets the duration in seconds.
public boolean
isBlocked ()
Whether this time to arrival is blocked.
Class Details
Describes Time To Arrival details for a given route.
Method Details
public java.util.EnumSet <com.here.android.mpa.routing.RouteTta.Detail>
getDetails ()
Details of the blockage (if any).
Returns:
HERE SDK for Android Developer's Guide
► API Reference
655
The set of all blockage details.
public int getDuration ()
Gets the duration in seconds.
Returns:
The duration in seconds.
public boolean isBlocked ()
Whether this time to arrival is blocked. Note that it is possible to get a valid duration when the route
is blocked. See getDetails() for more information.
Returns:
Whether this time to arrival is blocked.
Detail
The enumeration Detail is a member of com.here.android.mpa.routing.RouteTta .
Enumeration Summary
public static final enumeration RouteTta.Detail
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Additional Time To Arrival Details
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 287: Enum Constants in Detail
Fields
public static final RouteTta.Detail
BLOCKED_ROAD
A blocked road is present.
public static final RouteTta.Detail
CARPOOL
HERE SDK for Android Developer's Guide
► API Reference
Fields
A carpool restricted lane is present.
public static final RouteTta.Detail
RESTRICTED_TURN
A restricted turn is present.
Method Summary
Table 288: Methods in Detail
Methods
public int
getValue ()
public static RouteTta.Detail
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RouteTta.Detail[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Additional Time To Arrival Details
Enum Constant Details
public static final RouteTta.Detail BLOCKED_ROAD
A blocked road is present.
public static final RouteTta.Detail CARPOOL
A carpool restricted lane is present.
public static final RouteTta.Detail RESTRICTED_TURN
A restricted turn is present.
656
HERE SDK for Android Developer's Guide
► API Reference
657
Method Details
public int getValue ()
public static RouteTta.Detail valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RouteTta.Detail[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
Signpost
The class Signpost is a member of com.here.android.mpa.routing .
Class Summary
public final class Signpost
extends java.lang.Object
This class stores signpost information along the Route.
[For complete information, see the section Class Details]
See also:
HERE SDK for Android Developer's Guide
► API Reference
Nested Class Summary
Table 289: Nested Classes in Signpost
Nested Classes
public static final class
Signpost.LocalizedLabel
Signpost information can be used for navigation (both audible and graphical/textual navigation) and map display.
Method Summary
Table 290: Methods in Signpost
Methods
public int
getBackgroundColor ()
Return the background color of this signpost using ARGB (Alpha/Red/Green/Blue)
public java.util.List <com.here.android.mpa.routing.Signpost.LocalizedLabel>
getExitDirections ()
Returns the directions on the Signpost.
public Image
getExitIcon ()
Returns the exit Signpost icon.
public String
getExitNumber ()
Returns the exit number on the Signpost
public String
getExitText ()
Returns the exit text on the Signpost
public int
getForegroundColor ()
Return the foreground/text color of this signpost using ARGB (Alpha/Red/Green/Blue)
Class Details
This class stores signpost information along the Route.
See also:
Method Details
public int getBackgroundColor ()
658
HERE SDK for Android Developer's Guide
► API Reference
659
Return the background color of this signpost using ARGB (Alpha/Red/Green/Blue)
Returns:
The background color of this signpost
See also:
android.graphics.Color
public java.util.List <com.here.android.mpa.routing.Signpost.LocalizedLabel>
getExitDirections ()
Returns the directions on the Signpost.
Returns:
a list of directions (empty list if none available).
public Image getExitIcon ()
Returns the exit Signpost icon.
Returns:
Image
public String getExitNumber ()
Returns the exit number on the Signpost
Returns:
string presentation of the exit number
public String getExitText ()
Returns the exit text on the Signpost
Returns:
exit text
public int getForegroundColor ()
HERE SDK for Android Developer's Guide
► API Reference
660
Return the foreground/text color of this signpost using ARGB (Alpha/Red/Green/Blue)
Returns:
The foreground/text color of this signpost
See also:
android.graphics.Color
LocalizedLabel
The class LocalizedLabel is a member of com.here.android.mpa.routing.Signpost .
Class Summary
public static final class Signpost.LocalizedLabel
extends java.lang.Object
Signpost information can be used for navigation (both audible and graphical/textual navigation) and
map display.
[For complete information, see the section Class Details]
Method Summary
Table 291: Methods in LocalizedLabel
Methods
public String
getLanguage ()
Three letter MARC language tag.
public String
getRouteDirection ()
Contains the cardinal direction.
public String
getRouteName ()
Contains the route name/route number of the label.
public String
getText ()
Usually it contains auxiliary information like city name or characteristic place (for example: "airport").
public String
toString ()
For documentation, see java.lang.Object
HERE SDK for Android Developer's Guide
► API Reference
661
Class Details
Signpost information can be used for navigation (both audible and graphical/textual navigation) and
map display. In Europe, the label Text is most relevant for guidance, while in the North America, both
Route Name and Direction information are most relevant.
Method Details
public String getLanguage ()
Three letter MARC language tag.
Returns:
A string representing the language.
public String getRouteDirection ()
Contains the cardinal direction.
Returns:
String with the direction.
public String getRouteName ()
Contains the route name/route number of the label. Since the origin data is not always consistent it
is advisable to concatenate the route name and route direction fields There are for example cases in
which the direction is already contained in the route name.
Returns:
String with the route name.
See also:
routing.Signpost.LocalizedLabel.getRouteName ()
routing.Signpost.LocalizedLabel.getRouteDirection ()
public String getText ()
Usually it contains auxiliary information like city name or characteristic place (for example: "airport").
Returns:
HERE SDK for Android Developer's Guide
► API Reference
662
String with auxilary information.
public String toString ()
For documentation, see java.lang.Object
search
The package search is a member of com.here.android.mpa.
Package Summary
search
The search package provides classes for performing places and geocoder searches.
Package Details
The search package provides classes for performing places and geocoder searches.
•
•
com.here.android.mpa.search.RequestCreator.Places provides methods to create
new requests to search and explore places near a given position.
com.here.android.mpa.search.RequestCreator.Geocoder provides methods to
create new requests to perform address and reverse geocode searches.
The typical steps when perform a search are:
•
•
•
•
Implement the ResultListener interface to handle the completion of the search
Create a request using RequestCreator.Places or RequestCreator.Geocoder
Start the search by invoking execute(ResultListener)
When the search completes, the data returned in the ResultListener.onCompleted()
callback is triggered
For more details on performing searches, please consult the "Places" section in the HERE SDK for
Android Developer's Guide.
Address
The class Address is a member of com.here.android.mpa.search .
HERE SDK for Android Developer's Guide
► API Reference
Class Summary
public class Address
extends java.lang.Object
Provides textual address information for a Location.
[For complete information, see the section Class Details]
Constructor Summary
Table 292: Constructors in Address
Constructors
Address ()
Default constructor.
Address (Address other)
Copy constructor.
Method Summary
Table 293: Methods in Address
Methods
public void
addAdditionalData (String key, String value)
Adds additional address data, one key-value pair per call.
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public Map<java.lang.String, java.lang.String>
getAdditionalData ()
Gets additional address data.
public String
getCity ()
Gets the current city name for the Address .
public String
getCountryCode ()
Gets the current ISO 3166-1 (3-letter) country code for the Address .
public String
getCountryName ()
Gets the current country name for the Address .
public String
getCounty ()
663
HERE SDK for Android Developer's Guide
► API Reference
Methods
Gets the current county name for the Address .
public String
getDistrict ()
Gets the current district name for the Address .
public String
getFloorNumber ()
Gets the current floor number (in a multi-story building) for the Address .
public String
getHouseNumber ()
Gets the current house number for the Address .
public String
getPostalCode ()
Gets the current postal code for the Address .
public String
getState ()
Gets the current state name for the Address .
public String
getStateCode ()
Gets the current state code (state abbreviation) for the Address .
public String
getStreet ()
Gets the current street name for the Address .
public String
getSuiteNumberOrName ()
Gets the current suite number or suite name for the Address .
public String
getText ()
Gets the current text for the Address .
public int
hashCode ()
For documentation, see java.lang.Object
public Address
setCity (String city)
Sets a city name for the Address .
public Address
setCountryCode (String countryCode)
Sets an ISO 3166-1 (3-letter) country code for the Address .
public Address
setCountryName (String countryName)
Sets a country name for the Address .
public Address
setCounty (String county)
Sets a county name for the Address .
public Address
setDistrict (String district)
664
HERE SDK for Android Developer's Guide
► API Reference
665
Methods
Sets a district name for the Address .
public Address
setFloorNumber (String floorNumber)
Sets a floor number (in a multi-story building) for the Address .
public Address
setHouseNumber (String houseNumber)
Sets a house number for the Address .
public Address
setPostalCode (String postalCode)
Sets a postal code for the Address .
public Address
setState (String state)
Sets a state name for the Address .
public Address
setStateCode (String state)
Sets a state code (abbreviation) for the Address .
public Address
setStreet (String street)
Sets a street name for the Address .
public Address
setSuiteNumberOrName (String suiteNumberOrName)
Sets a suite number or suite name for the Address .
public Address
setText (String text)
Sets text for the Address .
public String
toString ()
For documentation, see java.lang.Object
Class Details
Provides textual address information for a Location. The information is divided among fields such as
country, street, etc.
Constructor Details
Address ()
Default constructor.
Address (Address other)
HERE SDK for Android Developer's Guide
► API Reference
Copy constructor.
Parameters:
other
The other Address to copy.
Method Details
public void addAdditionalData (String key, String value)
Adds additional address data, one key-value pair per call.
Parameters:
key
The key for additional data (key-value pair).
value
The value for additional data (key-value pair).
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public Map<java.lang.String, java.lang.String> getAdditionalData ()
Gets additional address data.
Returns:
The java.util.Map of the additional data in key-value notation.
public String getCity ()
Gets the current city name for the Address .
Returns:
The current city name (could be empty)
666
HERE SDK for Android Developer's Guide
► API Reference
public String getCountryCode ()
Gets the current ISO 3166-1 (3-letter) country code for the Address .
Returns:
The current country code (could be empty)
public String getCountryName ()
Gets the current country name for the Address .
Returns:
The current country name (could be empty)
public String getCounty ()
Gets the current county name for the Address .
Returns:
The current county name (could be empty)
public String getDistrict ()
Gets the current district name for the Address .
Returns:
The current district name (could be empty)
public String getFloorNumber ()
Gets the current floor number (in a multi-story building) for the Address .
Returns:
The current floor number (could be empty)
public String getHouseNumber ()
667
HERE SDK for Android Developer's Guide
► API Reference
Gets the current house number for the Address .
Returns:
The current house number (could be empty)
public String getPostalCode ()
Gets the current postal code for the Address .
Returns:
The current postal code (could be empty)
public String getState ()
Gets the current state name for the Address .
Returns:
The current state name or abbreviation (could be empty)
public String getStateCode ()
Gets the current state code (state abbreviation) for the Address .
Returns:
The current state name or abbreviation (could be empty)
public String getStreet ()
Gets the current street name for the Address .
Returns:
The current street name (could be empty)
public String getSuiteNumberOrName ()
Gets the current suite number or suite name for the Address .
Returns:
668
HERE SDK for Android Developer's Guide
► API Reference
The current suite number or name (could be empty)
public String getText ()
Gets the current text for the Address .
Returns:
The current text (could be empty)
public int hashCode ()
For documentation, see java.lang.Object
public Address setCity (String city)
Sets a city name for the Address .
Parameters:
city
Desired city name
public Address setCountryCode (String countryCode)
Sets an ISO 3166-1 (3-letter) country code for the Address .
Parameters:
countryCode
Desired ISO 3166-1 country code
public Address setCountryName (String countryName)
Sets a country name for the Address .
Parameters:
countryName
Desired country name
public Address setCounty (String county)
669
HERE SDK for Android Developer's Guide
► API Reference
Sets a county name for the Address .
Parameters:
county
Desired county name
public Address setDistrict (String district)
Sets a district name for the Address .
Parameters:
district
Desired district name
public Address setFloorNumber (String floorNumber)
Sets a floor number (in a multi-story building) for the Address .
Parameters:
floorNumber
Desired floor number
public Address setHouseNumber (String houseNumber)
Sets a house number for the Address .
Parameters:
houseNumber
Desired house number
public Address setPostalCode (String postalCode)
Sets a postal code for the Address .
Parameters:
postalCode
Desired postal code
public Address setState (String state)
670
HERE SDK for Android Developer's Guide
► API Reference
Sets a state name for the Address .
Parameters:
state
Desired state name
public Address setStateCode (String state)
Sets a state code (abbreviation) for the Address .
Parameters:
state
Desired state name or abbreviation
public Address setStreet (String street)
Sets a street name for the Address .
Parameters:
street
Desired street name
public Address setSuiteNumberOrName (String suiteNumberOrName)
Sets a suite number or suite name for the Address .
Parameters:
suiteNumberOrName Desired suite number or name
public Address setText (String text)
Sets text for the Address .
Parameters:
text
Desired text for the address
671
HERE SDK for Android Developer's Guide
► API Reference
public String toString ()
For documentation, see java.lang.Object
Category
The class Category is a member of com.here.android.mpa.search .
Class Summary
public class Category
extends java.lang.Object
Represents a category with which a Place can be associated.
[For complete information, see the section Class Details]
Nested Class Summary
Table 294: Nested Classes in Category
Nested Classes
public static final enumeration
Category.Global
Represents a set of fixed category filters on the resources of the Places search service.
Constructor Summary
Table 295: Constructors in Category
Constructors
Category ()
Deprecated: A useful Category is created from a request response.
Default constructor.
672
HERE SDK for Android Developer's Guide
673
► API Reference
Method Summary
Table 296: Methods in Category
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getIconUrl ()
Gets the URL to retrieve the icon for the Category .
public String
getId ()
Gets the unique identifier for the Category .
public String
getName ()
Gets the localized display name for the Category .
public Category
getParent ()
Gets the parent Category for the Category .
public java.util.List <com.here.android.mpa.search.Category>
Gets the list of subcategories for the Category .
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents a category with which a Place can be associated.
Constructor Details
Category ()
Deprecated: A useful Category is created from a request response.
Default constructor.
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
getSubCategories ()
HERE SDK for Android Developer's Guide
► API Reference
674
Parameters:
obj
public String getIconUrl ()
Gets the URL to retrieve the icon for the Category .
Returns:
The icon URL
public String getId ()
Gets the unique identifier for the Category .
Returns:
The unique ID
public String getName ()
Gets the localized display name for the Category .
Returns:
Localized display name
public Category getParent ()
Gets the parent Category for the Category .
Note: The category can already be a parent Category , in which case this method would return itself.
Returns:
Parent Category
public java.util.List <com.here.android.mpa.search.Category>
getSubCategories ()
Gets the list of subcategories for the Category .
HERE SDK for Android Developer's Guide
► API Reference
Note: a Category might have no subcategories, in which case this method would return empty .
Returns:
The list of Category objects representing the subcategories (could be empty)
public int hashCode ()
For documentation, see java.lang.Object
Global
The enumeration Global is a member of com.here.android.mpa.search.Category .
Enumeration Summary
public static final enumeration Category.Global
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents a set of fixed category filters on the resources of the Places search service.
[For complete information, see the section Enumeration Details]
See also:
search.CategoryFilter.add (Category.Global)
Enum Constant Summary
Table 297: Enum Constants in Global
Fields
public static final Category.Global
ACCOMMODATION
The accommodation category.
public static final Category.Global
ADMINISTRATIVE_AREAS_BUILDINGS
The administrative-areas-buildings category.
public static final Category.Global
BUSINESS_SERVICES
The business-services category.
public static final Category.Global
EAT_DRINK
675
HERE SDK for Android Developer's Guide
► API Reference
Fields
The eat-drink category.
public static final Category.Global
FACILITIES
The facilities category.
public static final Category.Global
GOING_OUT
The going-out category.
public static final Category.Global
LEISURE_OUTDOOR
The leisure-outdoor category.
public static final Category.Global
NATURAL_GEOGRAPHICAL
The natural-geographical category.
public static final Category.Global
SHOPPING
The shopping category.
public static final Category.Global
SIGHTS_MUSEUMS
The sights-museums category.
public static final Category.Global
TRANSPORT
The transport category.
Method Summary
Table 298: Methods in Global
Methods
public String
toString ()
Returns a stringified Category .
public static Category.Global
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Category.Global[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents a set of fixed category filters on the resources of the Places search service.
See also:
676
HERE SDK for Android Developer's Guide
► API Reference
search.CategoryFilter.add (Category.Global)
Enum Constant Details
public static final Category.Global ACCOMMODATION
The accommodation category.
public static final Category.Global ADMINISTRATIVE_AREAS_BUILDINGS
The administrative-areas-buildings category.
public static final Category.Global BUSINESS_SERVICES
The business-services category.
public static final Category.Global EAT_DRINK
The eat-drink category.
public static final Category.Global FACILITIES
The facilities category.
public static final Category.Global GOING_OUT
The going-out category.
public static final Category.Global LEISURE_OUTDOOR
The leisure-outdoor category.
public static final Category.Global NATURAL_GEOGRAPHICAL
The natural-geographical category.
677
HERE SDK for Android Developer's Guide
► API Reference
678
public static final Category.Global SHOPPING
The shopping category.
public static final Category.Global SIGHTS_MUSEUMS
The sights-museums category.
public static final Category.Global TRANSPORT
The transport category.
Method Details
public String toString ()
Returns a stringified Category .
Returns:
The stringified Category
public static Category.Global valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Category.Global[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
HERE SDK for Android Developer's Guide
► API Reference
679
CategoryFilter
The class CategoryFilter is a member of com.here.android.mpa.search .
Class Summary
public class CategoryFilter
extends java.lang.Object
Represents a filter used when performing a search for popular places within a specific geographic
area.
[For complete information, see the section Class Details]
See also:
Constructor Summary
Table 299: Constructors in CategoryFilter
Constructors
CategoryFilter ()
Default constructor.
Method Summary
Table 300: Methods in CategoryFilter
Methods
public CategoryFilter
add (Category.Global filter)
Adds a Category.Global to the CategoryFilter .
public CategoryFilter
add (Category filter)
Adds a Category (retrieved from the results of a previous request) to the CategoryFilter .
public CategoryFilter
add (String filter)
Adds a known category to the CategoryFilter as a String .
HERE SDK for Android Developer's Guide
► API Reference
680
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public int
hashCode ()
For documentation, see java.lang.Object
public String
toString ()
Returns a stringified CategoryFilter , within which individual categories are separated by commas.
Class Details
Represents a filter used when performing a search for popular places within a specific geographic
area. (This type of search is otherwise known as "explore".) The filter limits search results to the
specified categories.
A filter can include one or more of:
•
A Category
•
•
A Category.Global
A String indicating a known category
See also:
Constructor Details
CategoryFilter ()
Default constructor.
Method Details
public CategoryFilter add (Category.Global filter)
Adds a Category.Global to the CategoryFilter .
Parameters:
filter
A Category.Global filter
HERE SDK for Android Developer's Guide
► API Reference
681
public CategoryFilter add (Category filter)
Adds a Category (retrieved from the results of a previous request) to the CategoryFilter .
Parameters:
filter
A Category filter
public CategoryFilter add (String filter)
Adds a known category to the CategoryFilter as a String .
Parameters:
filter
A String filter
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public int hashCode ()
For documentation, see java.lang.Object
public String toString ()
Returns a stringified CategoryFilter , within which individual categories are separated by commas.
Returns:
The stringified CategoryFilter
HERE SDK for Android Developer's Guide
► API Reference
682
ContactDetail
The class ContactDetail is a member of com.here.android.mpa.search .
Class Summary
public class ContactDetail
extends java.lang.Object
Represents detailed information about a contact for a Place.
[For complete information, see the section Class Details]
Method Summary
Table 301: Methods in ContactDetail
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getLabel ()
Gets the localized label for the ContactDetail , describing the mechanism by which application users can contact the
Place (e.g.
public String
getType ()
Gets the type (email, fax, phone, website, etc.) for the ContactDetail .
public String
getValue ()
Gets the value corresponding to an associated contact mechanism label for the ContactDetail .
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents detailed information about a contact for a Place.
For example, if a Place has among its known contacts the phone number 555-1234, use this class to
access details about that particular contact's type ("phone") and value ("555-1234").
HERE SDK for Android Developer's Guide
► API Reference
683
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getLabel ()
Gets the localized label for the ContactDetail , describing the mechanism by which application
users can contact the Place (e.g. "Phone").
Returns:
The label
See also:
search.ContactDetail.getValue ()
public String getType ()
Gets the type (email, fax, phone, website, etc.) for the ContactDetail .
Returns:
The type
public String getValue ()
Gets the value corresponding to an associated contact mechanism label for the ContactDetail .
For example, if the mechanism for contacting a Place is "phone" then a call to this method might
return "555-1234" as the corresponding value.
Returns:
The value
See also:
search.ContactDetail.getLabel ()
HERE SDK for Android Developer's Guide
► API Reference
public int hashCode ()
For documentation, see java.lang.Object
DiscoveryLink
The class DiscoveryLink is a member of com.here.android.mpa.search .
Class Summary
public class DiscoveryLink
extends com.here.android.mpa.search.DiscoveryResult, com.here.android.mpa.search.Link,
java.lang.Object
Represents a discovery-related API link, used to retrieve a DiscoveryResultPage .
[For complete information, see the section Class Details]
Method Summary
Table 302: Methods in DiscoveryLink
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getIconUrl ()
Gets the URL to retrieve the icon for the resource to which the Link refers.
public String
getId ()
Gets the unique identifier for the resource to which the Link refers.
public DiscoveryRequest
getRequest ()
Gets the DiscoveryRequest to perform the next discovery search.
public String
getTitle ()
Gets the localized title for the resource to which the Link refers.
public int
hashCode ()
For documentation, see java.lang.Object
684
HERE SDK for Android Developer's Guide
► API Reference
Class Details
Represents a discovery-related API link, used to retrieve a DiscoveryResultPage .
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getIconUrl ()
Gets the URL to retrieve the icon for the resource to which the Link refers.
Note: an icon URL for a linked object is optional, so a call to this method could return empty .
Returns:
The icon URL (could be empty)
public String getId ()
Gets the unique identifier for the resource to which the Link refers.
Note: an ID for a linked object is optional, so a call to this method could return empty .
Returns:
The ID (could be empty)
public DiscoveryRequest getRequest ()
Gets the DiscoveryRequest to perform the next discovery search.
Returns:
The DiscoveryRequest
public String getTitle ()
685
HERE SDK for Android Developer's Guide
► API Reference
686
Gets the localized title for the resource to which the Link refers. Client devices can display this title
within an application.
Note: a title for a linked object is optional, so a call to this method could return empty .
Returns:
The title (could be empty)
public int hashCode ()
For documentation, see java.lang.Object
DiscoveryRequest
The class DiscoveryRequest is a member of com.here.android.mpa.search .
Class Summary
public class DiscoveryRequest
extends java.lang.Object
Represents an extended Request used to retrieve a DiscoveryResultPage object by way of
Places search services.
[For complete information, see the section Class Details]
See also:
Constructor Summary
Table 303: Constructors in DiscoveryRequest
Constructors
DiscoveryRequest ()
DiscoveryRequest (PlacesDiscoveryRequest impl)
HERE SDK for Android Developer's Guide
► API Reference
Field Summary
Table 304: Fields in DiscoveryRequest
Fields
protected CategoryFilter
m_categoryFilter
protected GeoBoundingBox
m_searchArea
protected GeoCoordinate
protected int
m_searchCenter
m_searchRadius
Method Summary
Table 305: Methods in DiscoveryRequest
Methods
public ErrorCode
execute (ResultListener eventListener)
Executes an asynchronous request.
This method overrides search.Request<T>.execute(ResultListener)
protected DiscoveryRequest
setCategoryFilter (CategoryFilter filter)
protected DiscoveryRequest
setSearchArea (GeoCoordinate coordinate, int radius)
protected DiscoveryRequest
setSearchArea (GeoBoundingBox area)
protected DiscoveryRequest
setSearchCenter (GeoCoordinate coordinate)
Class Details
Represents an extended Request used to retrieve a DiscoveryResultPage object by way of
Places search services.
See also:
Constructor Details
DiscoveryRequest ()
687
HERE SDK for Android Developer's Guide
► API Reference
DiscoveryRequest (PlacesDiscoveryRequest impl)
Parameters:
impl
Field Details
protected CategoryFilter m_categoryFilter
protected GeoBoundingBox m_searchArea
protected GeoCoordinate m_searchCenter
protected int m_searchRadius
Method Details
public ErrorCode execute (ResultListener eventListener)
Executes an asynchronous request.
This method overrides search.Request<T>.execute(ResultListener)
Parameters:
eventListener
protected DiscoveryRequest setCategoryFilter (CategoryFilter filter)
Parameters:
filter
688
HERE SDK for Android Developer's Guide
► API Reference
protected DiscoveryRequest setSearchArea (GeoCoordinate coordinate, int
radius)
Parameters:
coordinate
radius
protected DiscoveryRequest setSearchArea (GeoBoundingBox area)
Parameters:
area
protected DiscoveryRequest setSearchCenter (GeoCoordinate coordinate)
Parameters:
coordinate
DiscoveryResult
The class DiscoveryResult is a member of com.here.android.mpa.search .
Class Summary
public class DiscoveryResult
extends com.here.android.mpa.search.Link, java.lang.Object
Represents a base class for a DiscoveryResult found in a DiscoveryResultPage.
[For complete information, see the section Class Details]
See also:
689
HERE SDK for Android Developer's Guide
► API Reference
Nested Class Summary
Table 306: Nested Classes in DiscoveryResult
Nested Classes
public static final enumeration
DiscoveryResult.ResultType
Represents values describing possible DiscoveryResult types.
Constructor Summary
Table 307: Constructors in DiscoveryResult
Constructors
DiscoveryResult (PlacesLink impl)
Method Summary
Table 308: Methods in DiscoveryResult
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getIconUrl ()
Gets the URL to retrieve the icon for the resource to which the Link refers.
public String
getId ()
Gets the unique identifier for the resource to which the Link refers.
public DiscoveryResult.ResultType
getResultType ()
Gets the ResultType for the DiscoveryResult .
public String
getTitle ()
Gets the localized title for the resource to which the Link refers.
public String
getUrl ()
Gets the String representation of the URL to the user's profile
public String
getVicinity ()
Gets the String description for the vicinity of the Place.
public int
hashCode ()
690
HERE SDK for Android Developer's Guide
► API Reference
Methods
For documentation, see java.lang.Object
Class Details
Represents a base class for a DiscoveryResult found in a DiscoveryResultPage.
See also:
Constructor Details
DiscoveryResult (PlacesLink impl)
Parameters:
impl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getIconUrl ()
Gets the URL to retrieve the icon for the resource to which the Link refers.
Note: an icon URL for a linked object is optional, so a call to this method could return empty .
Returns:
The icon URL (could be empty)
public String getId ()
691
HERE SDK for Android Developer's Guide
► API Reference
692
Gets the unique identifier for the resource to which the Link refers.
Note: an ID for a linked object is optional, so a call to this method could return empty .
Returns:
The ID (could be empty)
public DiscoveryResult.ResultType getResultType ()
Gets the ResultType for the DiscoveryResult .
Returns:
The ResultType
public String getTitle ()
Gets the localized title for the resource to which the Link refers. Client devices can display this title
within an application.
Note: a title for a linked object is optional, so a call to this method could return empty .
Returns:
The title (could be empty)
public String getUrl ()
Gets the String representation of the URL to the user's profile
Returns:
The URL (could be empty)
public String getVicinity ()
Gets the String description for the vicinity of the Place. Typically, this description is derived from
the Address, but could also contain any other description that helps a user understand where the
Place is located.
Returns:
The vicinity description (could be empty)
HERE SDK for Android Developer's Guide
► API Reference
public int hashCode ()
For documentation, see java.lang.Object
ResultType
The enumeration ResultType is a member of com.here.android.mpa.search.DiscoveryResult .
Enumeration Summary
public static final enumeration DiscoveryResult.ResultType
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing possible DiscoveryResult types.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 309: Enum Constants in ResultType
Fields
public static final DiscoveryResult.ResultType
UNKNOWN
The result type is unknown.
public static final DiscoveryResult.ResultType
PLACE
The DiscoveryResult represents a PlaceLink.
public static final DiscoveryResult.ResultType
DISCOVERY
The DiscoveryResult represents a DiscoveryLink.
Method Summary
Table 310: Methods in ResultType
Methods
public static DiscoveryResult.ResultType
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
693
HERE SDK for Android Developer's Guide
► API Reference
694
Methods
public static DiscoveryResult.ResultType[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing possible DiscoveryResult types.
Enum Constant Details
public static final DiscoveryResult.ResultType UNKNOWN
The result type is unknown. The DiscoveryResult does not represent a specialized result.
public static final DiscoveryResult.ResultType PLACE
The DiscoveryResult represents a PlaceLink.
public static final DiscoveryResult.ResultType DISCOVERY
The DiscoveryResult represents a DiscoveryLink.
Method Details
public static DiscoveryResult.ResultType valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static DiscoveryResult.ResultType[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
HERE SDK for Android Developer's Guide
695
► API Reference
DiscoveryResultPage
The class DiscoveryResultPage is a member of com.here.android.mpa.search .
Class Summary
public class DiscoveryResultPage
extends java.lang.Object
Represents a paginated collection of results from a RequestCreator.Places search, explore, or here
request.
[For complete information, see the section Class Details]
See also:
Method Summary
Table 311: Methods in DiscoveryResultPage
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public java.util.List <com.here.android.mpa.search.DiscoveryLink>
getDiscoveryLinks ()
Gets the list of DiscoveryLink items for the DiscoveryResultPage .
public java.util.List <com.here.android.mpa.search.DiscoveryResult>
getItems ()
Gets the list of DiscoveryResult items for the DiscoveryResultPage .
public DiscoveryRequest
getNextPageRequest ()
Gets the DiscoveryRequest for requesting the next page of the DiscoveryResultPage .
public int
getOffsetCount ()
Gets the result offset count for the current page of the DiscoveryResultPage .
public java.util.List <com.here.android.mpa.search.PlaceLink>
Gets the list of PlaceLink items for the DiscoveryResultPage .
getPlaceLinks ()
HERE SDK for Android Developer's Guide
► API Reference
696
Methods
public DiscoveryRequest
getPreviousPageRequest ()
Gets the DiscoveryRequest for requesting the previous page of the DiscoveryResultPage .
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents a paginated collection of results from a RequestCreator.Places search, explore, or here
request. The collection contains DiscoveryResult objects, each of which represents either a PlaceLink
or another DiscoveryLink.
See also:
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public java.util.List <com.here.android.mpa.search.DiscoveryLink>
getDiscoveryLinks ()
Gets the list of DiscoveryLink items for the DiscoveryResultPage .
Returns:
The list of DiscoveryLink objects (could be empty)
public java.util.List <com.here.android.mpa.search.DiscoveryResult> getItems
()
HERE SDK for Android Developer's Guide
► API Reference
697
Gets the list of DiscoveryResult items for the DiscoveryResultPage .
Returns:
The list of DiscoveryResult objects (could be empty)
public DiscoveryRequest getNextPageRequest ()
Gets the DiscoveryRequest for requesting the next page of the DiscoveryResultPage .
Returns:
The DiscoveryRequest
public int getOffsetCount ()
Gets the result offset count for the current page of the DiscoveryResultPage .
For the first page of results, the offset count is 0. Following any call to getNextPageRequest(), the
offset count will be greater than 0.
Returns:
The result offset count
public java.util.List <com.here.android.mpa.search.PlaceLink> getPlaceLinks
()
Gets the list of PlaceLink items for the DiscoveryResultPage .
Returns:
The list of PlaceLink objects (could be empty)
public DiscoveryRequest getPreviousPageRequest ()
Gets the DiscoveryRequest for requesting the previous page of the DiscoveryResultPage .
Returns:
The DiscoveryRequest
public int hashCode ()
HERE SDK for Android Developer's Guide
► API Reference
For documentation, see java.lang.Object
EditorialMedia
The class EditorialMedia is a member of com.here.android.mpa.search .
Class Summary
public class EditorialMedia
extends com.here.android.mpa.search.Media, java.lang.Object
Represents editorial content about a Place.
[For complete information, see the section Class Details]
See also:
search.Place.getEditorials ()
Method Summary
Table 312: Methods in EditorialMedia
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getDescription ()
Gets the String representation of the description for the editorial.
public String
getIsoLanguageCode ()
Gets the ISO language code for the editorial content.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents editorial content about a Place.
See also:
search.Place.getEditorials ()
698
HERE SDK for Android Developer's Guide
► API Reference
699
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getDescription ()
Gets the String representation of the description for the editorial.
Returns:
The description
public String getIsoLanguageCode ()
Gets the ISO language code for the editorial content.
Note: a language code for an editorial content type is optional, so a call to this method could return
empty .
Returns:
The language code (could be empty)
public int hashCode ()
For documentation, see java.lang.Object
ErrorCode
The enumeration ErrorCode is a member of com.here.android.mpa.search .
Enumeration Summary
public final enumeration ErrorCode
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
HERE SDK for Android Developer's Guide
► API Reference
Represents values describing possible search request errors.
[For complete information, see the section Enumeration Details]
Enum Constant Summary
Table 313: Enum Constants in ErrorCode
Fields
public static final ErrorCode
NONE
No error was encountered.
public static final ErrorCode
GENERAL
There was a general error.
public static final ErrorCode
NOT_FOUND
No appropriate response to the query request could be found.
public static final ErrorCode
NOT_INITIALIZED
The search service was not properly initialized.
public static final ErrorCode
INCOMPLETE
The results of the query request were incomplete.
public static final ErrorCode
NETWORK_REQUIRED
The query request could not be completed while offline.
public static final ErrorCode
OUT_OF_MEMORY
There was insufficient memory to complete the query request.
public static final ErrorCode
UNKNOWN
There was an unknown error.
public static final ErrorCode
INVALID_PARAMETERS
Deprecated: Since 2.1.
The application ID and/or token were missing or invalid.
public static final ErrorCode
CANCEL
The query request was cancelled.
public static final ErrorCode
BUSY
The search service was busy with another request.
public static final ErrorCode
INVALID_STATE
700
HERE SDK for Android Developer's Guide
► API Reference
Fields
The search service was in an invalid state.
public static final ErrorCode
SERVER_CONNECTION
There was a problem with the server connection.
public static final ErrorCode
INVALID_OPERATION
The query request triggered an invalid operation.
public static final ErrorCode
BAD_LOCATION
The query request contained bad location data.
public static final ErrorCode
INDEX_FAILURE
There was an search service index failure.
public static final ErrorCode
CANCELLED
The query request was cancelled.
public static final ErrorCode
CREATED
The response to the query request was created.
public static final ErrorCode
ACCEPTED
The query request was accepted, though not yet processed.
public static final ErrorCode
NO_CONTENT
The response to the query request contained no content.
public static final ErrorCode
SERVER_INTERNAL
There was an internal server error.
public static final ErrorCode
SERVICE_UNAVAILABLE
The search service was unavailable.
public static final ErrorCode
MOVED_PERMANENTLY
The requested resource has moved permanently.
public static final ErrorCode
BAD_REQUEST
The query request was malformed and will not be processed.
public static final ErrorCode
UNAUTHORIZED
The query request did not contain necessary authentication information.
public static final ErrorCode
FORBIDDEN
Access to the requested resource was forbidden.
public static final ErrorCode
NOT_ACCEPTABLE
701
HERE SDK for Android Developer's Guide
► API Reference
Fields
The response to the query request was not in a format that is acceptable to the client.
public static final ErrorCode
RESOURCE_GONE
The resource no longer exists at the requested server location.
public static final ErrorCode
QUERY_ADDRESS_MISSING
The query request was missing an address parameter.
public static final ErrorCode
QUERY_LOCATION_CONTEXT_INVALID
The query location context was invalid.
public static final ErrorCode
QUERY_LOCATION_CONTEXT_MISSING
The query request was missing a location context parameter.
public static final ErrorCode
QUERY_NO_NEXT_PAGE
No further paginated results exist.
public static final ErrorCode
QUERY_TEXT_MISSING
The query request was missing a search text parameter.
public static final ErrorCode
QUERY_URI_MISSING
The query request was missing a link URI.
public static final ErrorCode
SEARCH_RESULT_ITEM_MISSING
The place details query was missing a search result item parameter.
public static final ErrorCode
INVALID_PARAMETER
A query request parameter was invalid.
public static final ErrorCode
NETWORK_COMMUNICATION
There was a network communications error.
public static final ErrorCode
NETWORK_BAD_URI
The HTTP request URI was invalid or malformed.
public static final ErrorCode
NETWORK_SERVER
The backend server was unreachable.
public static final ErrorCode
NETWORK_REQUEST_CONTENT
The query request content was invalid.
public static final ErrorCode
NETWORK_EMPTY_INPUT
The query request input was missing.
public static final ErrorCode
INVALID_CREDENTIALS
702
HERE SDK for Android Developer's Guide
► API Reference
Fields
The application ID and/or token were missing or invalid.
public static final ErrorCode
HTTP
The query request failed due to an HTTP error.
public static final ErrorCode
NETWORK_UNKNOWN
There was an unknown network error.
Method Summary
Table 314: Methods in ErrorCode
Methods
public static ErrorCode
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static ErrorCode[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing possible search request errors.
Enum Constant Details
public static final ErrorCode NONE
No error was encountered.
public static final ErrorCode GENERAL
There was a general error.
public static final ErrorCode NOT_FOUND
No appropriate response to the query request could be found.
public static final ErrorCode NOT_INITIALIZED
703
HERE SDK for Android Developer's Guide
► API Reference
The search service was not properly initialized.
public static final ErrorCode INCOMPLETE
The results of the query request were incomplete.
public static final ErrorCode NETWORK_REQUIRED
The query request could not be completed while offline.
public static final ErrorCode OUT_OF_MEMORY
There was insufficient memory to complete the query request.
public static final ErrorCode UNKNOWN
There was an unknown error.
public static final ErrorCode INVALID_PARAMETERS
Deprecated: Since 2.1.
The application ID and/or token were missing or invalid.
public static final ErrorCode CANCEL
The query request was cancelled.
public static final ErrorCode BUSY
The search service was busy with another request.
public static final ErrorCode INVALID_STATE
The search service was in an invalid state.
704
HERE SDK for Android Developer's Guide
► API Reference
public static final ErrorCode SERVER_CONNECTION
There was a problem with the server connection.
public static final ErrorCode INVALID_OPERATION
The query request triggered an invalid operation.
public static final ErrorCode BAD_LOCATION
The query request contained bad location data.
public static final ErrorCode INDEX_FAILURE
There was an search service index failure.
public static final ErrorCode CANCELLED
The query request was cancelled.
public static final ErrorCode CREATED
The response to the query request was created.
public static final ErrorCode ACCEPTED
The query request was accepted, though not yet processed.
public static final ErrorCode NO_CONTENT
The response to the query request contained no content.
public static final ErrorCode SERVER_INTERNAL
There was an internal server error.
705
HERE SDK for Android Developer's Guide
► API Reference
public static final ErrorCode SERVICE_UNAVAILABLE
The search service was unavailable.
public static final ErrorCode MOVED_PERMANENTLY
The requested resource has moved permanently.
public static final ErrorCode BAD_REQUEST
The query request was malformed and will not be processed.
public static final ErrorCode UNAUTHORIZED
The query request did not contain necessary authentication information.
public static final ErrorCode FORBIDDEN
Access to the requested resource was forbidden.
public static final ErrorCode NOT_ACCEPTABLE
The response to the query request was not in a format that is acceptable to the client.
public static final ErrorCode RESOURCE_GONE
The resource no longer exists at the requested server location.
public static final ErrorCode QUERY_ADDRESS_MISSING
The query request was missing an address parameter.
public static final ErrorCode QUERY_LOCATION_CONTEXT_INVALID
The query location context was invalid.
706
HERE SDK for Android Developer's Guide
► API Reference
public static final ErrorCode QUERY_LOCATION_CONTEXT_MISSING
The query request was missing a location context parameter.
public static final ErrorCode QUERY_NO_NEXT_PAGE
No further paginated results exist.
public static final ErrorCode QUERY_TEXT_MISSING
The query request was missing a search text parameter.
public static final ErrorCode QUERY_URI_MISSING
The query request was missing a link URI.
public static final ErrorCode SEARCH_RESULT_ITEM_MISSING
The place details query was missing a search result item parameter.
public static final ErrorCode INVALID_PARAMETER
A query request parameter was invalid.
public static final ErrorCode NETWORK_COMMUNICATION
There was a network communications error.
public static final ErrorCode NETWORK_BAD_URI
The HTTP request URI was invalid or malformed.
public static final ErrorCode NETWORK_SERVER
The backend server was unreachable.
707
HERE SDK for Android Developer's Guide
► API Reference
708
public static final ErrorCode NETWORK_REQUEST_CONTENT
The query request content was invalid.
public static final ErrorCode NETWORK_EMPTY_INPUT
The query request input was missing.
public static final ErrorCode INVALID_CREDENTIALS
The application ID and/or token were missing or invalid.
public static final ErrorCode HTTP
The query request failed due to an HTTP error.
public static final ErrorCode NETWORK_UNKNOWN
There was an unknown network error.
Method Details
public static ErrorCode valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static ErrorCode[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
HERE SDK for Android Developer's Guide
► API Reference
ExploreRequest
The class ExploreRequest is a member of com.here.android.mpa.search .
Class Summary
public class ExploreRequest
extends com.here.android.mpa.search.DiscoveryRequest, java.lang.Object
Creates a ExploreRequest using a specified location context and category filter.
[For complete information, see the section Class Details]
Constructor Summary
Table 315: Constructors in ExploreRequest
Constructors
ExploreRequest ()
Default constructor.
Method Summary
Table 316: Methods in ExploreRequest
Methods
public ErrorCode
execute (ResultListener listener)
Executes an asynchronous request.
public ExploreRequest
setCategoryFilter (CategoryFilter filter)
Sets a search filter based on categories.
public ExploreRequest
setSearchArea (GeoCoordinate center, int radius)
Sets the search area using a center location and radius.
public ExploreRequest
setSearchArea (GeoBoundingBox boundingArea)
Sets the search area using a GeoBoundingBox .
public ExploreRequest
Sets the search center.
setSearchCenter (GeoCoordinate center)
709
HERE SDK for Android Developer's Guide
► API Reference
710
Class Details
Creates a ExploreRequest using a specified location context and category filter. An explore request is
used for retrieving a list of nearby relevant places for a given position. It answers the question "What
interesting places are near a location?" The results returned are confined to those located in the
current search area and are ordered by popularity. If a category filter is provided, the created request
will limit results to include only items with the specified categories.
A search location context must be provided by setting either a search center using
setSearchCenter(GeoCoordinate), a search area using setSearchArea(GeoCoordinate,
int) or setSearchArea(GeoBoundingBox) or a bounding map viewport using
setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an
INVALID_PARAMETER when executing the request.
Constructor Details
ExploreRequest ()
Default constructor.
A search location context must be provided by setting either a search center using
setSearchCenter(GeoCoordinate), a search area using setSearchArea(GeoCoordinate,
int) or setSearchArea(GeoBoundingBox) or a bounding map viewport using
setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an
INVALID_PARAMETER when executing the request.
Method Details
public ErrorCode execute (ResultListener listener)
Executes an asynchronous request.
Parameters:
listener
A ResultListener passed along with the request to monitor progress
Returns:
The ErrorCode representing an appropriate result
public ExploreRequest setCategoryFilter (CategoryFilter filter)
HERE SDK for Android Developer's Guide
► API Reference
711
Sets a search filter based on categories.
Parameters:
filter
A CategoryFilter representing the category filter. When a CategoryFilter is specified, the result items will be limited to the categories defined in the filter.
Returns:
The ExploreRequest.
public ExploreRequest setSearchArea (GeoCoordinate center, int radius)
Sets the search area using a center location and radius.
Parameters:
center
The GeoCoordinate representing the search area center location.
radius
The search area circle radius in meters.
Returns:
The ExploreRequest.
public ExploreRequest setSearchArea (GeoBoundingBox boundingArea)
Sets the search area using a GeoBoundingBox .
Parameters:
boundingArea
The GeoBoundingBox representing the search area.
Returns:
The ExploreRequest.
public ExploreRequest setSearchCenter (GeoCoordinate center)
Sets the search center.
Parameters:
HERE SDK for Android Developer's Guide
► API Reference
center
712
The GeoCoordinate representing the location context used to search for
nearby places.
Returns:
The ExploreRequest.
ExtendedAttribute
The class ExtendedAttribute is a member of com.here.android.mpa.search .
Class Summary
public class ExtendedAttribute
extends java.lang.Object
Represents additional detailed information about a Place.
[For complete information, see the section Class Details]
Constructor Summary
Table 317: Constructors in ExtendedAttribute
Constructors
ExtendedAttribute (PlacesAttribute impl)
Field Summary
Table 318: Fields in ExtendedAttribute
Fields
public static final String
TRANSIT_DEPARTURES_EXTENDED_ATTRIBUTE_ID
Constant that defines the public transit departures extended identifier.
public static final String
TRANSIT_LINES_EXTENDED_ATTRIBUTE_ID
Constant that defines the public transit lines extended identifier.
protected PlacesAttribute
m_pimpl
HERE SDK for Android Developer's Guide
► API Reference
713
Method Summary
Table 319: Methods in ExtendedAttribute
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getAttribution ()
Gets a ready-to-display (HTML formatted) string containing the source attribution text for this place.
public String
getId ()
Gets the identifier for the ExtendedAttribute .
public String
getLabel ()
Gets the localized display label for the ExtendedAttribute .
public String
getText ()
Gets the String representation of ExtendedAttribute information, which can be displayed directly on the client device.
public Link
getVia ()
Gets a Link object to the external website of the supplier of the information.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents additional detailed information about a Place.
This extensible collection of attributes that can include the following items with these identifier
values:
•
•
•
•
•
•
•
•
•
•
payment - A list of available payment methods (such as cash, credit card, direct debit, etc.)
openingHours - A list of hours during which the place is open for business
annualClosings - A description of annual closing dates such as holidays or other special occasions
price - A price list
nearestLandmark - A description of the nearest landmark
languagesSpoken - A list of the languages that are spoken at the place
availableParking - A list of parking options available nearby
smoking - Whether smoking is allowed
disabledAccess - Whether disabled access is available
transitLines - A list of available public transport transit lines
HERE SDK for Android Developer's Guide
► API Reference
•
•
departures - A list of next departures for available public transport transit lines
blindGuide - Whether a public transport stop has blind guides ('tactile paving').
•
•
elevator - Whether a public transport stop has elevator
escalator - Whether a public transport stop has escalator
714
Constructor Details
ExtendedAttribute (PlacesAttribute impl)
Parameters:
impl
Field Details
public static final String TRANSIT_DEPARTURES_EXTENDED_ATTRIBUTE_ID
Constant that defines the public transit departures extended identifier.
public static final String TRANSIT_LINES_EXTENDED_ATTRIBUTE_ID
Constant that defines the public transit lines extended identifier.
protected PlacesAttribute m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getAttribution ()
Gets a ready-to-display (HTML formatted) string containing the source attribution text for this place.
HERE SDK for Android Developer's Guide
► API Reference
715
The Places API gives access to content that is provided by a number of sources. Client applications
must display the source attribution next to the content. This requirement forms part of the terms
and conditions of the API.
The code snippet below demonstrates how to display the string in an Android TextView
TextView textView = (TextView) findViewById(R.id.attributionText);
textView.setText((Html.fromHtml(
route.getTransitRouteSourceAttribution().getAttribution())));
textView.setMovementMethod(LinkMovementMethod.getInstance());
Returns:
The HTML formatted attribution string
public String getId ()
Gets the identifier for the ExtendedAttribute .
Returns:
The attribute identifier
public String getLabel ()
Gets the localized display label for the ExtendedAttribute .
Returns:
The display label
public String getText ()
Gets the String representation of ExtendedAttribute information, which can be displayed
directly on the client device.
Note: if the text represents a list of items, the items are separated by a line break entity ( <br/> if the
text format is HTML-encoded or newline if the text format is plain).
Returns:
The RichText display text
HERE SDK for Android Developer's Guide
► API Reference
716
public Link getVia ()
Gets a Link object to the external website of the supplier of the information. This link must be used
for attribution when rich text attribution is not being used.
Returns:
The Link object to the external website of the supplier of the information
public int hashCode ()
For documentation, see java.lang.Object
GeocodeRequest
The class GeocodeRequest is a member of com.here.android.mpa.search .
Class Summary
public class GeocodeRequest
extends java.lang.Object
The GeocodeRequest represents an extended Request used to retrieve Location data by way of
Geocoder search services.
[For complete information, see the section Class Details]
Constructor Summary
Table 320: Constructors in GeocodeRequest
Constructors
GeocodeRequest (String query)
Creates a geocoder request that resolves a free text query into a Location.
GeocodeRequest (Address address)
Creates a geocoder request that resolves a structured Address into a Location
HERE SDK for Android Developer's Guide
► API Reference
717
Method Summary
Table 321: Methods in GeocodeRequest
Methods
public ErrorCode
execute (ResultListener listener)
Executes an asynchronous request.
public GeocodeRequest
setSearchArea (GeoCoordinate center, int radius)
Sets the search area using a center location and radius.
public GeocodeRequest
setSearchArea (GeoBoundingBox boundingArea)
Sets the search area using a GeoBoundingBox .
Class Details
The GeocodeRequest represents an extended Request used to retrieve Location data by way of
Geocoder search services.
Note: the response to a GeocodeRequest is a list of Location objects.
Constructor Details
GeocodeRequest (String query)
Creates a geocoder request that resolves a free text query into a Location.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
query
Query text specifying the address to locate
GeocodeRequest (Address address)
Creates a geocoder request that resolves a structured Address into a Location
Throws:
HERE SDK for Android Developer's Guide
► API Reference
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
address
A structured query Address
Method Details
public ErrorCode execute (ResultListener listener)
Executes an asynchronous request.
Parameters:
listener
A ResultListener passed along with the request to monitor progress
Returns:
The ErrorCode representing an appropriate result
public GeocodeRequest setSearchArea (GeoCoordinate center, int radius)
Sets the search area using a center location and radius.
Parameters:
center
The GeoCoordinate representing the search area center location.
radius
The search area circle radius in meters.
Returns:
The GeocodeRequest.
public GeocodeRequest setSearchArea (GeoBoundingBox boundingArea)
Sets the search area using a GeoBoundingBox .
Parameters:
718
HERE SDK for Android Developer's Guide
► API Reference
719
The GeoBoundingBox representing the search area.
boundingArea
Returns:
The GeocodeRequest.
HereRequest
The class HereRequest is a member of com.here.android.mpa.search .
Class Summary
public class HereRequest
extends com.here.android.mpa.search.DiscoveryRequest, java.lang.Object
The HereRequest answers the questions "Where am I?" and "What's right here where I am standing?"
The search results consist of a list of places with addresses that lie within the vicinity of the search
location.
[For complete information, see the section Class Details]
Constructor Summary
Table 322: Constructors in HereRequest
Constructors
HereRequest ()
Default constructor.
Method Summary
Table 323: Methods in HereRequest
Methods
public ErrorCode
execute (ResultListener listener)
Executes an asynchronous request.
public HereRequest
setCategoryFilter (CategoryFilter filter)
Sets a search filter based on categories.
HERE SDK for Android Developer's Guide
► API Reference
720
Methods
public HereRequest
setSearchCenter (GeoCoordinate center)
Sets the search center.
Class Details
The HereRequest answers the questions "Where am I?" and "What's right here where I am standing?"
The search results consist of a list of places with addresses that lie within the vicinity of the search
location. The feature is typically used by applications that include "check-in" or "click on map to get
more information" options.
A search location context must be provided by setting either a search center
using setSearchCenter(GeoCoordinate) or a bounding map viewport using
setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an
INVALID_PARAMETER when executing the request.
Constructor Details
HereRequest ()
Default constructor.
A search location context must be provided by setting either a search center
using setSearchCenter(GeoCoordinate) or a bounding map viewport using
setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an
INVALID_PARAMETER when executing the request.
Method Details
public ErrorCode execute (ResultListener listener)
Executes an asynchronous request.
Parameters:
listener
A ResultListener passed along with the request to monitor progress
Returns:
The ErrorCode representing an appropriate result
HERE SDK for Android Developer's Guide
► API Reference
721
public HereRequest setCategoryFilter (CategoryFilter filter)
Sets a search filter based on categories.
Parameters:
filter
A CategoryFilter representing the category filter. When a CategoryFilter is specified, the result items will be limited to the categories defined in the filter.
Returns:
The HereRequest.
public HereRequest setSearchCenter (GeoCoordinate center)
Sets the search center.
Parameters:
center
The GeoCoordinate representing the location context used to search for
nearby places.
Returns:
The HereRequest.
ImageMedia
The class ImageMedia is a member of com.here.android.mpa.search .
Class Summary
public final class ImageMedia
extends com.here.android.mpa.search.Media, java.lang.Object
Represents image content related to a Place.
[For complete information, see the section Class Details]
See also:
HERE SDK for Android Developer's Guide
► API Reference
722
search.Place.getImages ()
Method Summary
Table 324: Methods in ImageMedia
Methods
public boolean
public String
equals (Object obj)
getDimensionHref (int width, int height)
Get the HREF to retrieve an image with specific width-height dimensions.
public String
getId ()
Gets the unique identifier for the Image .
public String
getUrl ()
Gets the String representation of the URL for the source of the image file.
public UserLink
getUser ()
Gets the details of the User who contributed the Image .
public int
hashCode ()
Class Details
Represents image content related to a Place.
See also:
search.Place.getImages ()
Method Details
public boolean equals (Object obj)
Parameters:
obj
public String getDimensionHref (int width, int height)
Get the HREF to retrieve an image with specific width-height dimensions. A HTTP request using this
HREF will return the image data.
HERE SDK for Android Developer's Guide
► API Reference
723
Parameters:
width
The image width.
height
The image height.
Returns:
The HREF to retrieve the image with the specified width-height dimensions. Can be null if an image
with the specified dimensions is unavailable.
See also:
search.PlaceRequest.addImageDimensions (int, int)
public String getId ()
Gets the unique identifier for the Image .
Note: an ID for an Image is optional, so a call to this method could return null .
Returns:
The ID (could be null)
public String getUrl ()
Gets the String representation of the URL for the source of the image file.
Returns:
The URL
public UserLink getUser ()
Gets the details of the User who contributed the Image .
Note: user contribution for an Image is optional, so a call to this method could return null .
Returns:
The User who contributed the Image (could be null)
public int hashCode ()
HERE SDK for Android Developer's Guide
► API Reference
724
Link
The class Link is a member of com.here.android.mpa.search .
Class Summary
public class Link
extends java.lang.Object
Represents a Link indicating that the application must make another request to retrieve the desired
resource.
[For complete information, see the section Class Details]
Constructor Summary
Table 325: Constructors in Link
Constructors
Link (PlacesLink impl)
Field Summary
Table 326: Fields in Link
Fields
protected PlacesLink
m_pimpl
Method Summary
Table 327: Methods in Link
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getIconUrl ()
Gets the URL to retrieve the icon for the resource to which the Link refers.
HERE SDK for Android Developer's Guide
► API Reference
725
Methods
public String
getId ()
Gets the unique identifier for the resource to which the Link refers.
public String
getTitle ()
Gets the localized title for the resource to which the Link refers.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents a Link indicating that the application must make another request to retrieve the desired
resource.
Note: a Link contains metadata about the linked resource.
Constructor Details
Link (PlacesLink impl)
Parameters:
impl
Field Details
protected PlacesLink m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
HERE SDK for Android Developer's Guide
► API Reference
726
public String getIconUrl ()
Gets the URL to retrieve the icon for the resource to which the Link refers.
Note: an icon URL for a linked object is optional, so a call to this method could return empty .
Returns:
The icon URL (could be empty)
public String getId ()
Gets the unique identifier for the resource to which the Link refers.
Note: an ID for a linked object is optional, so a call to this method could return empty .
Returns:
The ID (could be empty)
public String getTitle ()
Gets the localized title for the resource to which the Link refers. Client devices can display this title
within an application.
Note: a title for a linked object is optional, so a call to this method could return empty .
Returns:
The title (could be empty)
public int hashCode ()
For documentation, see java.lang.Object
Location
The class Location is a member of com.here.android.mpa.search .
Class Summary
public class Location
HERE SDK for Android Developer's Guide
► API Reference
extends java.lang.Object
Represents the physical location of a Place.
[For complete information, see the section Class Details]
Constructor Summary
Table 328: Constructors in Location
Constructors
Location ()
Deprecated: A useful Location is created from a request response.
Default constructor.
Location (GeoCoordinate coordinate)
Construct a Location with a initial GeoCoordinate .
Method Summary
Table 329: Methods in Location
Methods
public boolean
equals (Object obj)
public Address
getAddress ()
Gets the Address for the Location .
public GeoBoundingBox
getBoundingBox ()
Gets the GeoBoundingBox representing the map view bounding box for the Location.
public GeoCoordinate
getCoordinate ()
Gets the GeoCoordinate indicating where the map marker for the Location is rendered.
public String
getId ()
Gets the java.lang.String representation of the unique ID for the Location.
public NavigationPosition
getNavigationPosition ()
Gets the driving coordinates to access the location.
public String
getReference (String name)
Get the reference identifier for a specific domain.
public int
hashCode ()
727
HERE SDK for Android Developer's Guide
► API Reference
Methods
For documentation, see java.lang.Object
public String
toString ()
Class Details
Represents the physical location of a Place.
Constructor Details
Location ()
Deprecated: A useful Location is created from a request response.
Default constructor.
Location (GeoCoordinate coordinate)
Construct a Location with a initial GeoCoordinate .
Parameters:
coordinate
Initial location coordinate.
Method Details
public boolean equals (Object obj)
Parameters:
obj
public Address getAddress ()
Gets the Address for the Location .
Returns:
The Address, or null if unavailable
728
HERE SDK for Android Developer's Guide
► API Reference
729
public GeoBoundingBox getBoundingBox ()
Gets the GeoBoundingBox representing the map view bounding box for the Location.
Returns:
The GeoBoundingBox, or null if unavailable
public GeoCoordinate getCoordinate ()
Gets the GeoCoordinate indicating where the map marker for the Location is rendered.
Returns:
The GeoCoordinate, or null if unavailable
public String getId ()
Gets the java.lang.String representation of the unique ID for the Location.
Returns:
The ID
public NavigationPosition getNavigationPosition ()
Gets the driving coordinates to access the location.
public String getReference (String name)
Get the reference identifier for a specific domain. For example, a place can have a reference to an
extruded building object in the map. The reference identifier can be retrieved by calling this method
with name BUILDING_ID_REFERENCE_NAME . NOTE: A reference will not be returned if it has not
been added to the request using Request<T>#addReference .
Parameters:
name
The reference name.
Returns:
The reference identifier. If the reference identifier does not exist, an empty String is returned.
HERE SDK for Android Developer's Guide
► API Reference
public int hashCode ()
For documentation, see java.lang.Object
public String toString ()
Media
The class Media is a member of com.here.android.mpa.search .
Class Summary
public abstract class Media
extends java.lang.Object
Represents the base class for additional rich content about a Place.
[For complete information, see the section Class Details]
Nested Class Summary
Table 330: Nested Classes in Media
Nested Classes
public static final enumeration
Media.Type
Represents values describing supported Media types for a Place.
Constructor Summary
Table 331: Constructors in Media
Constructors
Media (<any> impl)
730
HERE SDK for Android Developer's Guide
► API Reference
Field Summary
Table 332: Fields in Media
Fields
protected <any>
m_pimpl
Method Summary
Table 333: Methods in Media
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getAttributionText ()
Gets the String representation of the attribution text for the Media , according to the terms and conditions of the
originating source.
public SupplierLink
getSupplier ()
Gets the Link to a resource representing the supplier of the Media (the object provides details about the origin of the
information).
public Media.Type
getType ()
Gets the specialized MediaType for the Media .
protected String
public ViaLink
getUrl ()
getVia ()
Gets the Link to the origin of the Media , typically a website of the supplier.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents the base class for additional rich content about a Place.
The following specialized content types might be available:
•
•
•
Editorial content
Image content
Review content
731
HERE SDK for Android Developer's Guide
► API Reference
732
Constructor Details
Media (<any> impl)
Parameters:
impl
Field Details
protected <any> m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getAttributionText ()
Gets the String representation of the attribution text for the Media , according to the terms and
conditions of the originating source.
Returns:
The attribution text
public SupplierLink getSupplier ()
Gets the Link to a resource representing the supplier of the Media (the object provides details
about the origin of the information).
Returns:
The supplier Link
HERE SDK for Android Developer's Guide
► API Reference
public Media.Type getType ()
Gets the specialized MediaType for the Media .
Returns:
The MediaType
protected String getUrl ()
public ViaLink getVia ()
Gets the Link to the origin of the Media , typically a website of the supplier.
Returns:
The via Link
public int hashCode ()
For documentation, see java.lang.Object
Type
The enumeration Type is a member of com.here.android.mpa.search.Media .
Enumeration Summary
public static final enumeration Media.Type
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing supported Media types for a Place.
[For complete information, see the section Enumeration Details]
733
HERE SDK for Android Developer's Guide
► API Reference
Enum Constant Summary
Table 334: Enum Constants in Type
Fields
public static final Media.Type
UNKNOWN
Unknown content.
public static final Media.Type
EDITORIAL
Editorial content.
public static final Media.Type
IMAGE
Image content.
public static final Media.Type
RATING
Rating content.
public static final Media.Type
REVIEW
Review content.
Method Summary
Table 335: Methods in Type
Methods
public static Media.Type
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static Media.Type[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing supported Media types for a Place.
Enum Constant Details
public static final Media.Type UNKNOWN
Unknown content.
734
HERE SDK for Android Developer's Guide
► API Reference
735
public static final Media.Type EDITORIAL
Editorial content.
public static final Media.Type IMAGE
Image content.
public static final Media.Type RATING
Rating content.
public static final Media.Type REVIEW
Review content.
Method Details
public static Media.Type valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static Media.Type[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
MediaCollectionPage<T>
The class MediaCollectionPage<T> is a member of com.here.android.mpa.search .
Type Parameters:
HERE SDK for Android Developer's Guide
736
► API Reference
T – an object that extends this class
Class Summary
public final class MediaCollectionPage<T>
extends java.lang.Object
Represents a base class for a paginateable collection of Media objects of a specific type.
[For complete information, see the section Class Details]
Method Summary
Table 336: Methods in MediaCollectionPage<T>
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public int
getAvailable ()
Gets the total number of available Media items within the MediaCollectionPage .
public java.util.List <com.here.android.mpa.search.Media>
getItems ()
Gets the list of Media items from the current page of the collection.
public MediaCollectionPageRequest<T>
getNextPageRequest ()
Gets the MediaCollectionPageRequest for requesting the next page of the MediaCollectionPage .
public int
getOffsetCount ()
Gets the collection offset count for the current page of the MediaCollectionPage .
public Media.Type
getType ()
Gets the specialized Media.Type for the Media objects contained within the MediaCollectionPage .
public int
hashCode ()
For documentation, see java.lang.Object
public boolean
removeItem (Media item)
Remove Media items from the current page of the collection.
Class Details
Represents a base class for a paginateable collection of Media objects of a specific type.
HERE SDK for Android Developer's Guide
► API Reference
737
Note: each collection contains objects of one Media.Type.
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public int getAvailable ()
Gets the total number of available Media items within the MediaCollectionPage .
Returns:
The number of available items
public java.util.List <com.here.android.mpa.search.Media> getItems ()
Gets the list of Media items from the current page of the collection. The type of each object in the list
depends on the MediaCollectionPage .
Note: if a collection is empty, the items attribute is not present and this method will return empty .
Returns:
The list of Media objects (could be empty)
public MediaCollectionPageRequest<T> getNextPageRequest ()
Gets the MediaCollectionPageRequest for requesting the next page of the MediaCollectionPage .
Returns:
The MediaCollectionPageRequest
public int getOffsetCount ()
Gets the collection offset count for the current page of the MediaCollectionPage .
HERE SDK for Android Developer's Guide
► API Reference
738
For the first page of results, the offset count is 0. Following any call to getNextPageRequest(), the
offset count will be greater than 0.
Returns:
The collection offset count
public Media.Type getType ()
Gets the specialized Media.Type for the Media objects contained within the MediaCollectionPage
.
Returns:
The Media.Type
public int hashCode ()
For documentation, see java.lang.Object
public boolean removeItem (Media item)
Remove Media items from the current page of the collection.
Parameters:
item
The Media item to be removed from the current collection page.
Returns:
Returns true if the Media object is successfully removed from the page.
MediaCollectionPageRequest<T>
The class MediaCollectionPageRequest<T> is a member of com.here.android.mpa.search .
Type Parameters:
T – an object that extends this class
HERE SDK for Android Developer's Guide
► API Reference
Class Summary
public class MediaCollectionPageRequest<T>
extends java.lang.Object
Represents an extended Request used to retrieve MediaCollectionPage information for a
specific type of Media associated with a Place, by way of Places search services.
[For complete information, see the section Class Details]
Constructor Summary
Table 337: Constructors in MediaCollectionPageRequest<T>
Constructors
MediaCollectionPageRequest (<any> impl)
Method Summary
Table 338: Methods in MediaCollectionPageRequest<T>
Methods
public ErrorCode
execute (ResultListener eventListener)
Executes an asynchronous request.
This method overrides search.Request<T>.execute(ResultListener)
Class Details
Represents an extended Request used to retrieve MediaCollectionPage information for a
specific type of Media associated with a Place, by way of Places search services.
Note: the response to a MediaCollectionPageRequest is a MediaCollectionPage object.
Constructor Details
MediaCollectionPageRequest (<any> impl)
Parameters:
impl
739
HERE SDK for Android Developer's Guide
► API Reference
Method Details
public ErrorCode execute (ResultListener eventListener)
Executes an asynchronous request.
This method overrides search.Request<T>.execute(ResultListener)
Parameters:
eventListener
NavigationPosition
The class NavigationPosition is a member of com.here.android.mpa.search .
Class Summary
public class NavigationPosition
extends java.lang.Object
Represents driving directions to access the location.
[For complete information, see the section Class Details]
Method Summary
Table 339: Methods in NavigationPosition
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getAccessType ()
Returns the type of access as a String .
public GeoCoordinate
getCoordinate ()
Returns the GeoCoordinate of the location
public int
hashCode ()
For documentation, see java.lang.Object
740
HERE SDK for Android Developer's Guide
► API Reference
Class Details
Represents driving directions to access the location.
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getAccessType ()
Returns the type of access as a String .
public GeoCoordinate getCoordinate ()
Returns the GeoCoordinate of the location
public int hashCode ()
For documentation, see java.lang.Object
Place
The class Place is a member of com.here.android.mpa.search .
Class Summary
public class Place
extends java.lang.Object
Represents a set of data about a physical place.
[For complete information, see the section Class Details]
See also:
741
HERE SDK for Android Developer's Guide
742
► API Reference
Field Summary
Table 340: Fields in Place
Fields
public static final String
PUBLIC_TRANSPORT_RELATED_LINK_NAME
Key name to get the public-transport DiscoveryLink (from the related attributes) for this Place .
public static final String
RECOMMENDED_RELATED_LINK_NAME
Key name to get the recommended DiscoveryLink (from the related attributes) for this Place .
Method Summary
Table 341: Methods in Place
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public Map<java.lang.String, java.util.List<java.lang.String>>
getAlternativeNames ()
Gets the alternative names for the Place .
public String
getAttributionText ()
Gets the String representation of the attribution text for the Place .
public java.util.List <com.here.android.mpa.search.Category>
getCategories ()
Gets the list of Category objects assigned to the Place .
public java.util.List <com.here.android.mpa.search.ContactDetail>
getContacts ()
Gets the list of Contact objects for the Place .
public MediaCollectionPage<com.here.android.mpa.search.EditorialMedia>
getEditorials ()
Gets the MediaCollectionPage containing EditorialMedia content for the Place .
public java.util.List <com.here.android.mpa.search.ExtendedAttribute>
()
getExtendedAttributes
Gets additional information about a Place , a list of ExtendedAttribute objects that can include information such as:
•
payment - A list of available payment methods (such as cash, credit card, direct debit, etc.)
•
openingHours - A list of hours during which the place is open for business
•
annualClosings - A description of annual closing dates such as holidays or other special occasions
HERE SDK for Android Developer's Guide
743
► API Reference
Methods
•
price - A price list
•
nearestLandmark - A description of the nearest landmark
•
languagesSpoken - A list of the languages that are spoken at the place
•
availableParking - A list of parking options available nearby
•
smoking - Whether smoking is allowed
•
disabledAccess - Whether disabled access is available
•
transitLines - A list of available public transport transit lines
•
departures - A list of next departures for available public transport transit lines
•
blindGuide - Whether a public transport stop has blind guides ('tactile paving').
•
elevator - Whether a public transport stop has elevator
•
escalator - Whether a public transport stop has escalator
public String
getIconUrl ()
Gets the URL to retrieve the icon that best represents the Place .
public String
getId ()
Gets the unique identifier for the Place .
public MediaCollectionPage<com.here.android.mpa.search.ImageMedia>
getImages ()
Gets the MediaCollectionPage containing ImageMedia content for the Place .
public Location
getLocation ()
Gets the physical Location of the Place .
public String
getName ()
Gets the display name for the Place .
public MediaCollectionPage<com.here.android.mpa.search.RatingMedia>
getRatings ()
Gets the MediaCollectionPage containing RatingMedia content for the Place .
public String
getReference (String name)
Get the reference identifier for a specific domain.
public java.util.Map <java.lang.String, com.here.android.mpa.search.DiscoveryLink>
getRelated ()
Gets the related places (where available) that might also interest an application user viewing information for the Place .
public ReportingLink
getReportingLink ()
Gets the link for getting options for reporting an place because, for example, if it contains inappropriate content or the place
does not exists.
public MediaCollectionPage<com.here.android.mpa.search.ReviewMedia>
getReviews ()
HERE SDK for Android Developer's Guide
► API Reference
744
Methods
Gets the MediaCollectionPage containing ReviewMedia content for the Place .
public SupplierLink
getSupplier ()
Gets the Link for the Place supplier.
public Ratings
getUserRatings ()
Gets the HERE.com user-supplied Ratings for the Place .
public String
getViewUri ()
Gets the String representation of the URI for a user-viewable representation of the Place .
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents a set of data about a physical place.
A Place acts as a container for various information about a place, which itself is a point of interest
such as a popular restaurant, a park, or someone's home.
Note: a Place can contain attributes, collections of media about the place, and key-value pairs of
related places.
See also:
Field Details
public static final String PUBLIC_TRANSPORT_RELATED_LINK_NAME
Key name to get the public-transport DiscoveryLink (from the related attributes) for this Place .
public static final String RECOMMENDED_RELATED_LINK_NAME
Key name to get the recommended DiscoveryLink (from the related attributes) for this Place .
Method Details
public boolean equals (Object obj)
HERE SDK for Android Developer's Guide
► API Reference
745
For documentation, see java.lang.Object
Parameters:
obj
public Map<java.lang.String, java.util.List<java.lang.String>>
getAlternativeNames ()
Gets the alternative names for the Place . The returned Map collection is keyed using a language
code (eg. "en").
Note: an alternative name is optional, so a call to this method could return empty .
Returns:
The alternative names (could be empty) collection keyed using a language code (eg. "en").
public String getAttributionText ()
Gets the String representation of the attribution text for the Place .
Note: attribution text for a Place is optional, so a call to this method could return empty .
Returns:
The attribution text (could be empty)
public java.util.List <com.here.android.mpa.search.Category> getCategories
()
Gets the list of Category objects assigned to the Place .
Note: categories maybe optional (especially when offline), so a call to this method could return empty
.
Returns:
The list of Category objects
public java.util.List <com.here.android.mpa.search.ContactDetail>
getContacts ()
HERE SDK for Android Developer's Guide
► API Reference
746
Gets the list of Contact objects for the Place .
Note: contact information for a Place is optional, so a call to this method could return empty .
Returns:
The list of Contact objects (could be empty)
public MediaCollectionPage<com.here.android.mpa.search.EditorialMedia>
getEditorials ()
Gets the MediaCollectionPage containing EditorialMedia content for the Place .
Note: editorial content for a Place is optional, so a call to this method could return null .
Returns:
The MediaCollectionPage (could be null)
public java.util.List <com.here.android.mpa.search.ExtendedAttribute>
getExtendedAttributes ()
Gets additional information about a Place , a list of ExtendedAttribute objects that can include
information such as:
•
•
•
•
•
•
•
•
•
•
•
•
•
•
payment - A list of available payment methods (such as cash, credit card, direct debit, etc.)
openingHours - A list of hours during which the place is open for business
annualClosings - A description of annual closing dates such as holidays or other special occasions
price - A price list
nearestLandmark - A description of the nearest landmark
languagesSpoken - A list of the languages that are spoken at the place
availableParking - A list of parking options available nearby
smoking - Whether smoking is allowed
disabledAccess - Whether disabled access is available
transitLines - A list of available public transport transit lines
departures - A list of next departures for available public transport transit lines
blindGuide - Whether a public transport stop has blind guides ('tactile paving').
elevator - Whether a public transport stop has elevator
escalator - Whether a public transport stop has escalator
For transitLines (@see ExtendedAttribute#TRANSIT_LINES_EXTENDED_ATTRIBUTE_ID) and
departures (@see ExtendedAttribute#TRANSIT_DEPARTURES_EXTENDED_ATTRIBUTE_ID)
attributes, the returned object can be cast to TransitLinesAttribute and
HERE SDK for Android Developer's Guide
► API Reference
747
TransitDeparturesAttribute respectably. Which will allow further related attributes to be
retrieved.
Transit lines and departures information may not always be available in all
transit station/stop locations. However, this information is available using the
PUBLIC_TRANSPORT_RELATED_LINK_NAME DiscoveryLink from getRelated().
Returns:
The list of ExtendedAttribute objects
See also:
public String getIconUrl ()
Gets the URL to retrieve the icon that best represents the Place .
Returns:
The icon URL.
public String getId ()
Gets the unique identifier for the Place . Applications that want to keep a reference to a place
should store the ID for subsequent linking to additional resources.
Returns:
The ID
public MediaCollectionPage<com.here.android.mpa.search.ImageMedia> getImages
()
Gets the MediaCollectionPage containing ImageMedia content for the Place .
Note: image content for a Place is optional, so a call to this method could return null .
Returns:
The MediaCollectionPage (could be null)
HERE SDK for Android Developer's Guide
► API Reference
748
public Location getLocation ()
Gets the physical Location of the Place .
Returns:
The Location
public String getName ()
Gets the display name for the Place .
Returns:
The Place name
public MediaCollectionPage<com.here.android.mpa.search.RatingMedia>
getRatings ()
Gets the MediaCollectionPage containing RatingMedia content for the Place .
Note: rating content for a Place is optional, so a call to this method could return null .
Returns:
The MediaCollectionPage (could be null)
public String getReference (String name)
Get the reference identifier for a specific domain. For example, a place can have a reference to an
extruded building object in the map. The reference identifier can be retrieved by calling this method
with name 'building'. NOTE: A reference will not be returned if it has not been queried with the
PlacesBaseRequest#setReferences function.
Parameters:
name
The reference name.
Returns:
The reference identifier. If the reference identifier does not exist, an empty String is returned.
HERE SDK for Android Developer's Guide
► API Reference
749
public java.util.Map <java.lang.String,
com.here.android.mpa.search.DiscoveryLink> getRelated ()
Gets the related places (where available) that might also interest an application user viewing
information for the Place . The returned Map is keyed by a title for the related places (e.g.
PUBLIC_TRANSPORT_RELATED_LINK_NAME ), while the associated value is a link to a page of
related places.
Note: if there are no related places, the attribute is not present and this method will return null .
Returns:
The java.util.Map of key-value elements representing the collection of links to places related to
the Place (could be empty)
public ReportingLink getReportingLink ()
Gets the link for getting options for reporting an place because, for example, if it contains
inappropriate content or the place does not exists.
Returns:
The report link.
public MediaCollectionPage<com.here.android.mpa.search.ReviewMedia>
getReviews ()
Gets the MediaCollectionPage containing ReviewMedia content for the Place .
Note: review content for a Place is optional, so a call to this method could return null .
Returns:
The MediaCollectionPage (could be null)
public SupplierLink getSupplier ()
Gets the Link for the Place supplier. A supplier link extends the standard link object with an
optional icon link pointing to the supplier's brand icon.
Note: a Link for a Place supplier is optional, so a call to this method could return null .
Returns:
HERE SDK for Android Developer's Guide
► API Reference
The supplier Link (could be null)
public Ratings getUserRatings ()
Gets the HERE.com user-supplied Ratings for the Place .
Returns:
The HERE.com user-supplied Ratings for the Place.
public String getViewUri ()
Gets the String representation of the URI for a user-viewable representation of the Place .
Applications must provide at least one such URI for every Place they fetch.
Returns:
The URI to a viewable site for the Place
public int hashCode ()
For documentation, see java.lang.Object
PlaceLink
The class PlaceLink is a member of com.here.android.mpa.search .
Class Summary
public class PlaceLink
extends com.here.android.mpa.search.DiscoveryResult, com.here.android.mpa.search.Link,
java.lang.Object
Represents discovery information about a Place .
[For complete information, see the section Class Details]
750
HERE SDK for Android Developer's Guide
► API Reference
751
Method Summary
Table 342: Methods in PlaceLink
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public double
getAverageRating ()
Gets the average rating for a Place.
public GeoBoundingBox
getBoundingBox ()
Gets the GeoBoundingBox describing a range of coordinates that correspond to the Place.
public Category
getCategory ()
Gets the Category for the Place.
public PlaceRequest
getDetailsRequest ()
Gets the request to retrieve the Place details.
public double
getDistance ()
Gets the distance to the Place, in meters.
public GeoCoordinate
getPosition ()
Gets the GeoCoordinate representing the geographical position of the Place.
public String
getReference (String name)
Get the reference identifier for a specific domain.
public int
hashCode ()
For documentation, see java.lang.Object
public boolean
isSponsored ()
Determines whether the search result is sponsored.
Class Details
Represents discovery information about a Place .
Note: detailed Place information is retrieved by way of the PlaceRequest returned from a call to the
getDetailsRequest() method.
HERE SDK for Android Developer's Guide
► API Reference
752
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public double getAverageRating ()
Gets the average rating for a Place.
Note: the average rating is set to zero for places with no ratings.
Returns:
The average rating
public GeoBoundingBox getBoundingBox ()
Gets the GeoBoundingBox describing a range of coordinates that correspond to the Place.
Typically, bounding boxes are associated with places such as cities and countries.
Note: bounding box information for a Place is optional, so a call to this method could return null .
Returns:
The GeoBoundingBox containing the Place (could be null)
public Category getCategory ()
Gets the Category for the Place.
Note: a category is optional (especially when offline), so a call to this method could return null .
Returns:
The Category
public PlaceRequest getDetailsRequest ()
HERE SDK for Android Developer's Guide
► API Reference
753
Gets the request to retrieve the Place details.
Returns:
The PlaceRequest to retrieve the Place details
public double getDistance ()
Gets the distance to the Place, in meters.
Returns:
The distance
public GeoCoordinate getPosition ()
Gets the GeoCoordinate representing the geographical position of the Place.
Returns:
The GeoCoordinate
public String getReference (String name)
Get the reference identifier for a specific domain. For example, a place can have a reference to an
extruded building object in the map. The reference identifier can be retrieved by calling this method
with name BUILDING_ID_REFERENCE_NAME . NOTE: A reference will not be returned if it has not
been added to the request using Request<T>#addReference .
Parameters:
name
The reference name.
Returns:
The reference identifier. If the reference identifier does not exist, an empty String is returned.
public int hashCode ()
For documentation, see java.lang.Object
public boolean isSponsored ()
HERE SDK for Android Developer's Guide
► API Reference
754
Determines whether the search result is sponsored. Applications must provide some visual
differentiation between sponsored search results and regular search results.
Returns:
True if the search result is sponsored, false otherwise
PlaceRequest
The class PlaceRequest is a member of com.here.android.mpa.search .
Class Summary
public class PlaceRequest
extends java.lang.Object
Represents an extended Request used to retrieve a Place object by way of Places search services.
[For complete information, see the section Class Details]
See also:
Constructor Summary
Table 343: Constructors in PlaceRequest
Constructors
PlaceRequest (PlaceLink placeLink)
Default constructor.
Method Summary
Table 344: Methods in PlaceRequest
Methods
public void
addImageDimensions (int width, int height)
HERE SDK for Android Developer's Guide
► API Reference
755
Methods
Request Image Media with specific dimensions.
public ErrorCode
execute (ResultListener listener)
Executes an asynchronous request.
Class Details
Represents an extended Request used to retrieve a Place object by way of Places search services.
See also:
Constructor Details
PlaceRequest (PlaceLink placeLink)
Default constructor.
Parameters:
placeLink
A selected PlaceLink found using a discovery request.
Method Details
public void addImageDimensions (int width, int height)
Request Image Media with specific dimensions. At least one of the sizes (width or height) needs to be
valid (greater than 0).
Parameters:
width
Image width (pass 0 for any width)
height
Image height (pass 0 for any height)
public ErrorCode execute (ResultListener listener)
HERE SDK for Android Developer's Guide
► API Reference
Executes an asynchronous request.
Parameters:
A ResultListener passed along with the request to monitor progress
listener
Returns:
The ErrorCode representing an appropriate result
RatingMedia
The class RatingMedia is a member of com.here.android.mpa.search .
Class Summary
public class RatingMedia
extends com.here.android.mpa.search.Media, java.lang.Object
Represents rating content about a Place.
[For complete information, see the section Class Details]
See also:
search.Place.getRatings ()
Method Summary
Table 345: Methods in RatingMedia
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public double
getAverage ()
Gets the average rating for the Place.
public int
getCount ()
Gets the count of individual contributions that users provided for rating the Place.
public int
hashCode ()
For documentation, see java.lang.Object
756
HERE SDK for Android Developer's Guide
► API Reference
757
Class Details
Represents rating content about a Place. Each individual Rating contains information about the
rating itself, the user who contributed the rating, and a rating that the user offered for the place.
See also:
search.Place.getRatings ()
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public double getAverage ()
Gets the average rating for the Place.
Returns:
The average rating
public int getCount ()
Gets the count of individual contributions that users provided for rating the Place.
Returns:
The total ratings count
public int hashCode ()
For documentation, see java.lang.Object
Ratings
The class Ratings is a member of com.here.android.mpa.search .
HERE SDK for Android Developer's Guide
► API Reference
758
Class Summary
public class Ratings
extends java.lang.Object
Represents a summary of user-supplied ratings for a Place.
[For complete information, see the section Class Details]
See also:
search.Place.getUserRatings ()
Method Summary
Table 346: Methods in Ratings
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public double
getAverage ()
Gets the average rating for the Place.
public int
getCount ()
Gets the count of individual contributions that users provided for rating the Place.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents a summary of user-supplied ratings for a Place.
Note: ratings are normalized to values from [0..5], to compensate for potential differences between
supplier ratings systems.
See also:
search.Place.getUserRatings ()
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
HERE SDK for Android Developer's Guide
► API Reference
759
Parameters:
obj
public double getAverage ()
Gets the average rating for the Place.
Returns:
The average rating
public int getCount ()
Gets the count of individual contributions that users provided for rating the Place.
Returns:
The total ratings count
public int hashCode ()
For documentation, see java.lang.Object
ReportingLink
The class ReportingLink is a member of com.here.android.mpa.search .
Class Summary
public class ReportingLink
extends com.here.android.mpa.search.Link, java.lang.Object
Represents a ReportingLink for getting options for reporting on content if it contains inappropriate
content.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
760
Method Summary
Table 347: Methods in ReportingLink
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getTitle ()
Gets the localized title for the resource to which the Link refers.
public String
getUrl ()
Gets the String representation of the reporting URL
public int
hashCode ()
Class Details
Represents a ReportingLink for getting options for reporting on content if it contains inappropriate
content.
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getTitle ()
Gets the localized title for the resource to which the Link refers. Client devices can display this title
within an application.
Note: a title for a linked object is optional, so a call to this method could return empty .
Returns:
The title (could be empty)
public String getUrl ()
HERE SDK for Android Developer's Guide
► API Reference
Gets the String representation of the reporting URL
Returns:
The URL
public int hashCode ()
Request<T>
The class Request<T> is a member of com.here.android.mpa.search .
Type Parameters:
T – an object that extends this class
Class Summary
public abstract class Request<T>
extends java.lang.Object
Represents a base class for a search request.
[For complete information, see the section Class Details]
Constructor Summary
Table 348: Constructors in Request<T>
Constructors
Request ()
Request (<any> impl)
Field Summary
Table 349: Fields in Request<T>
Fields
protected int
m_collectionSize
761
HERE SDK for Android Developer's Guide
► API Reference
Fields
protected ConnectivityMode
protected GeoBoundingBox
protected <any>
m_connectivityMode
m_mapViewport
m_pimpl
protected List<java.lang.String>
protected RichTextFormatting
protected String
m_referenceNames
m_richTextFormatting
m_userAuthToken
Method Summary
Table 350: Methods in Request<T>
Methods
public Request<T>
addReference (String name)
This function adds the name of a requested reference identifiers to be returned in the results.
public boolean
cancel ()
Cancels any pending results from an invoked request.
protected void
determineConnectivityMode ()
public ErrorCode
execute (ResultListener eventListener)
Executes an asynchronous request.
public int
getCollectionSize ()
Gets the current collection size being used for request responses.
public List<java.lang.String>
getReferences ()
This function returns the names of requested reference identifiers to be returned in the results.
public RichTextFormatting
getRichTextFormatting ()
Gets the current RichTextFormatting type being used in request responses.
public Request<T>
setCollectionSize (int value)
Sets a collection size to be used for request responses.
public Request<T>
setMapViewport (GeoBoundingBox mapViewport)
The map viewport is a bounding box of the map area currently visible to the user.
public Request<T>
setRichTextFormatting (RichTextFormatting value)
762
HERE SDK for Android Developer's Guide
► API Reference
Methods
Sets a RichTextFormatting to be used in request responses.
Class Details
Represents a base class for a search request.
Constructor Details
Request ()
Request (<any> impl)
Parameters:
impl
Field Details
protected int m_collectionSize
protected ConnectivityMode m_connectivityMode
protected GeoBoundingBox m_mapViewport
protected <any> m_pimpl
protected List<java.lang.String> m_referenceNames
protected RichTextFormatting m_richTextFormatting
763
HERE SDK for Android Developer's Guide
► API Reference
protected String m_userAuthToken
Method Details
public Request<T> addReference (String name)
This function adds the name of a requested reference identifiers to be returned in
the results. For example, to retrieve an extruded building identifier, set this value to
BUILDING_ID_REFERENCE_NAME .
Parameters:
name
Name of reference identifier to retrieve.
Returns:
True if name added, false otherwise.
public boolean cancel ()
Cancels any pending results from an invoked request.
Returns:
True if the request was canceled successfully, false otherwise
protected void determineConnectivityMode ()
public ErrorCode execute (ResultListener eventListener)
Executes an asynchronous request.
Parameters:
eventListener
A ResultListener passed along with the request to monitor progress
Returns:
The ErrorCode representing an appropriate result
764
HERE SDK for Android Developer's Guide
► API Reference
765
public int getCollectionSize ()
Gets the current collection size being used for request responses.
Returns:
The current response collection size
public List<java.lang.String> getReferences ()
This function returns the names of requested reference identifiers to be returned in the results.
Returns:
List of the names of reference identifiers to be returned in the result.
public RichTextFormatting getRichTextFormatting ()
Gets the current RichTextFormatting type being used in request responses.
Returns:
The current RichTextFormatting type
public Request<T> setCollectionSize (int value)
Sets a collection size to be used for request responses.
Note: a collection size defines the maximum number of items in a given response. If not specified for
a request, each collection may define its own reasonable default.
Parameters:
value
Desired response collection size
Returns:
This Request object
public Request<T> setMapViewport (GeoBoundingBox mapViewport)
HERE SDK for Android Developer's Guide
► API Reference
766
The map viewport is a bounding box of the map area currently visible to the user. The viewport can
act as an implicit location context in the absence of an explicit location context. To ensure you get
the best results possible, you should always set a viewport if there is a map visible to the user.
Parameters:
mapViewport
The bounding box of the map area currently visible.
public Request<T> setRichTextFormatting (RichTextFormatting value)
Sets a RichTextFormatting to be used in request responses.
Parameters:
value
Desired RichTextFormatting
Returns:
This Request object
RequestCreator
The class RequestCreator is a member of com.here.android.mpa.search .
Class Summary
public class RequestCreator
extends java.lang.Object
Represents a factory for instantiating requests.
Deprecated: Since 2.0 use ExploreRequest, HereRequest, SearchRequest, GeocodeRequest and ReverseGeocodeRequest.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
767
Nested Class Summary
Table 351: Nested Classes in RequestCreator
Nested Classes
public static final class
RequestCreator.Geocoder
Represents a factory service used to instantiate geocoder requests.
public static final class
RequestCreator.Places
Represents a factory for instantiating requests for information about places.
Constructor Summary
Table 352: Constructors in RequestCreator
Constructors
RequestCreator ()
Class Details
Deprecated: Since 2.0 use ExploreRequest, HereRequest, SearchRequest, GeocodeRequest and ReverseGeocodeRequest.
Represents a factory for instantiating requests.
Constructor Details
RequestCreator ()
Geocoder
The class Geocoder is a member of com.here.android.mpa.search.RequestCreator .
Class Summary
public static final class RequestCreator.Geocoder
extends java.lang.Object
Represents a factory service used to instantiate geocoder requests.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
768
Constructor Summary
Table 353: Constructors in Geocoder
Constructors
Geocoder ()
Method Summary
Table 354: Methods in Geocoder
Methods
public static GeocodeRequest
createAddressRequest (Address address)
Creates a geocoder request that resolves a structured Address into a Location.
public static GeocodeRequest
createOneBoxRequest (GeoCoordinate location, String query)
Creates a geocoder request that resolves a free text query into a Location.
public static ReverseGeocodeRequest
createReverseGeocodeRequest (GeoCoordinate location)
Creates a reverse geocoder request that resolves a GeoCoordinate into an Address.
Class Details
Represents a factory service used to instantiate geocoder requests.
A Geocoder enables searching for Location data by way of the following search services:
•
•
Structured Address Geocode - matches an Address to its correct Location on the map (its
latitude and longitude).
Reverse Geocode - retrieves an Address based on a given GeoCoordinate.
Note: Geocoder objects can create either a GeocodeRequest or a ReverseGeocodeRequest that
applications use to request an appropriate search result.
Constructor Details
Geocoder ()
Method Details
public static GeocodeRequest createAddressRequest (Address address)
HERE SDK for Android Developer's Guide
► API Reference
769
Creates a geocoder request that resolves a structured Address into a Location.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
address
A structured query Address
Returns:
The GeocodeRequest
public static GeocodeRequest createOneBoxRequest (GeoCoordinate location,
String query)
Creates a geocoder request that resolves a free text query into a Location.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
location
A GeoCoordinate representing the search location context. The one-box
request will resolve the query text to Locations centered around this coordinate.
query
Query text specifying the address to locate
Returns:
The GeocodeRequest
public static ReverseGeocodeRequest createReverseGeocodeRequest
(GeoCoordinate location)
Creates a reverse geocoder request that resolves a GeoCoordinate into an Address.
HERE SDK for Android Developer's Guide
► API Reference
770
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
location
A GeoCoordinate representing the query location context
Returns:
The ReverseGeocodeRequest
Places
The class Places is a member of com.here.android.mpa.search.RequestCreator .
Class Summary
public static final class RequestCreator.Places
extends java.lang.Object
Represents a factory for instantiating requests for information about places.
[For complete information, see the section Class Details]
Constructor Summary
Table 355: Constructors in Places
Constructors
Places ()
Method Summary
Table 356: Methods in Places
Methods
public static DiscoveryRequest
filter)
createExploreRequest (GeoCoordinate location, CategoryFilter
HERE SDK for Android Developer's Guide
► API Reference
771
Methods
Creates a Places Explore request using a specified location context and category filter.
public static DiscoveryRequest createExploreRequest (GeoCoordinate searchCenter, int
searchRadius, CategoryFilter filter)
Creates a Places Explore request using a specified circular area and category filter.
public static DiscoveryRequest
CategoryFilter filter)
createExploreRequest (GeoBoundingBox searchArea,
Creates a Places Explore request using a specified location context and category filter.
public static DiscoveryRequest
createExploreRequest (CategoryFilter filter)
Creates a Places Explore request using an optional category filter.
public static DiscoveryRequest
filter)
createHereRequest (GeoCoordinate location, CategoryFilter
Creates a Places Here request using a specified location context and category filter.
public static DiscoveryRequest
createHereRequest (CategoryFilter filter)
Creates a Places Here request using an optional category filter.
public static PlaceRequest
createPlaceRequest (PlaceLink placeLink)
Creates a places request to return a Place referred by a PlaceLink .
public static DiscoveryRequest
createSearchRequest (GeoCoordinate location, String query)
Creates a Places Search request using a specified location context and query arguments.
public static DiscoveryRequest
createSearchRequest (String query)
Creates a Places Search request using a query argument.
public static TextSuggestionRequest
String partialTerm)
createTextSuggestionRequest (GeoCoordinate location,
Creates a Places request to return a list of suggested search terms that are related to a specified location context and a
partial search term.
public static TextSuggestionRequest
createTextSuggestionRequest (String partialTerm)
Creates a Places request to return a list of suggested search terms that are related to a specified location context and a
partial search term.
Class Details
Represents a factory for instantiating requests for information about places.
The Places service supports a variety of use cases that center around two major features:
•
Place discovery - helps users find places that are relevant to them.
HERE SDK for Android Developer's Guide
► API Reference
•
772
Place information retrieval - provides detailed information about places that interest users.
For place discovery, the Places API supports three use cases from which to choose according to the
requirements for the application:
•
•
•
Search - finds places that match user-provided search terms.
Explore - guides users to places of interest nearby.
Here - guides users to places of interest within close proximity (a closer proximity than an
Explore request).
The Places API defines resources that represent entry points for supported use cases, employing
links to describe the application flow within a selected use case.
For example, a DiscoveryRequest is an entry point to the Places API resource. When a user submits
a discovery request to the search resource, the response contains, among other items, a list of
links to places or to place resources. Each referenced place might have rich content associated
with it, including ratings, images, reviews, editorials, and owner content. Each place also contains
references to related places, which allow users to discover places relevant to or otherwise related to
their original search.
Constructor Details
Places ()
Method Details
public static DiscoveryRequest createExploreRequest (GeoCoordinate location,
CategoryFilter filter)
Creates a Places Explore request using a specified location context and category filter. An explore
request is used for retrieving a list of nearby relevant places for a given position. It answers the
question "What interesting places are near a location?" The results returned are confined to those
located in the current search area and are ordered by popularity. If a category filter is provided, the
created request will limit results to include only items with the specified categories.
A search location must be specified. If no location context is provided, an IllegalArgumentException
will be thrown.
HERE SDK for Android Developer's Guide
► API Reference
773
If a category filter is provided, the created request will limit results to include only items with the
specified categories.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
location
A GeoCoordinate representing the location context used to search for
nearby places.
filter
A CategoryFilter representing the category filter. This is an optional parameter if empty or null is passed. If category/categories are added using
{@code CategoryFilter#add(Category), the result items will be limited to the
categories defined in the filter.
Returns:
The DiscoveryRequest
public static DiscoveryRequest createExploreRequest (GeoCoordinate
searchCenter, int searchRadius, CategoryFilter filter)
Creates a Places Explore request using a specified circular area and category filter. An explore
request is used for retrieving a list of nearby relevant places for a given area. It answers the question
"What interesting places are in the area?" The results returned are confined to those located in the
current search area and are ordered by popularity. If a category filter is provided, the created request
will limit results to include only items with the specified categories. A search center and radius must
be specified. If no location context is provided, an IllegalArgumentException will be thrown.
If a category filter is provided, the created request will limit results to include only items with the
specified categories.
Throws:
IllegalArgumentException
Parameters:
Upon a failure to handle a passed argument
HERE SDK for Android Developer's Guide
► API Reference
774
searchCenter
A GeoCoordinate representing the search area center.
searchRadius
A positive radius value (in metres) representing a search area centered at
the location. Must be greater than zero.
filter
A CategoryFilter representing the category filter. This is an optional parameter if empty or null is passed. If category/categories are added using
{@code CategoryFilter#add(Category), the result items will be limited to the
categories defined in the filter.
Returns:
The DiscoveryRequest
public static DiscoveryRequest createExploreRequest (GeoBoundingBox
searchArea, CategoryFilter filter)
Creates a Places Explore request using a specified location context and category filter. An explore
request is used for retrieving a list of nearby relevant places for a given position or area. It answers
the question "What interesting places are in the map viewport?" The results returned are confined to
those located in the current search area and are ordered by popularity. If a category filter is provided,
the created request will limit results to include only items with the specified categories.
A searchArea must be specified. If no searchArea context is provided, an IllegalArgumentException
will be thrown.
If a category filter is provided, the created request will limit results to include only items with the
specified categories.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
searchArea
A GeoBoundingBox representing the search area (this is an optional parameter and should not be set unless such functionality is explicitly intended in
the application; results may not be bound to this search area).
filter
A CategoryFilter representing the category filter. This is an optional parameter if empty or null is passed. If category/categories are added using
HERE SDK for Android Developer's Guide
► API Reference
775
{@code CategoryFilter#add(Category), the result items will be limited to the
categories defined in the filter.
Returns:
The DiscoveryRequest
public static DiscoveryRequest createExploreRequest (CategoryFilter filter)
Creates a Places Explore request using an optional category filter. An explore request is used for
retrieving a list of nearby relevant places for a given position or area. It answers the question "What
interesting places are in the map viewport?" The results returned are confined to those located in the
current search area and are ordered by popularity. If a category filter is provided, the created request
will limit results to include only items with the specified categories.
A search location context must be provided by setting a bounding map viewport using
setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an
INVALID_PARAMETER when executing the request.
If a category filter is provided, the created request will limit results to include only items with the
specified categories.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
filter
A CategoryFilter representing the category filter. This is an optional parameter if empty or null is passed. If category/categories are added using
{@code CategoryFilter#add(Category), the result items will be limited to the
categories defined in the filter.
Returns:
The DiscoveryRequest
public static DiscoveryRequest createHereRequest (GeoCoordinate location,
CategoryFilter filter)
HERE SDK for Android Developer's Guide
► API Reference
776
Creates a Places Here request using a specified location context and category filter. Here requests
are used for retrieving a list of places that lie within the close vicinity of the search location. It
answers the questions "Where am I?" and "What's right here where I am standing?" The search
results consist of a list of places (with addresses) that lie within the vicinity of the search location.
The feature is typically used by applications that include "check-in" or "tap on map to get more
information" options.
A search location must be specified. If no location context is provided, an IllegalArgumentException
will be thrown.
If a category filter is provided, the created request will limit results to include only items with the
specified categories.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
location
A GeoCoordinate representing the location context used to search for
places within close proximity. Specify a location if results near a specific coordinate is required.
filter
A CategoryFilter representing the category filter. This is an optional parameter if empty or null is passed. If category/categories are added using
{@code CategoryFilter#add(Category), the result items will be limited to the
categories defined in the filter.
Returns:
The DiscoveryRequest
public static DiscoveryRequest createHereRequest (CategoryFilter filter)
Creates a Places Here request using an optional category filter. Here requests are used for
retrieving a list of places that lie within the close vicinity of the search location. It answers the
questions "Where am I?" and "What's right here where I am standing?" The search results consist of a
list of places (with addresses) that lie within the vicinity of the search location. The feature is typically
used by applications that include "check-in" or "tap on map to get more information" options.
HERE SDK for Android Developer's Guide
► API Reference
777
A search location context must be provided by setting a bounding map viewport using
setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an
INVALID_PARAMETER when executing the request.
If a category filter is provided, the created request will limit results to include only items with the
specified categories.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
filter
A CategoryFilter representing the category filter. This parameter
must not be empty/null. If category/categories are added using {@code
CategoryFilter#add(Category), the result items will be limited to the categories defined in the filter.
Returns:
The DiscoveryRequest
public static PlaceRequest createPlaceRequest (PlaceLink placeLink)
Creates a places request to return a Place referred by a PlaceLink .
Parameters:
placeLink
A PlaceLink
Returns:
The PlaceRequest
See also:
search.Place.getId ()
public static DiscoveryRequest createSearchRequest (GeoCoordinate location,
String query)
Creates a Places Search request using a specified location context and query arguments.
HERE SDK for Android Developer's Guide
► API Reference
778
A search location must be specified. If no location context is provided, an IllegalArgumentException
will be thrown.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
location
A GeoCoordinate representing the location context used to search for results that are appropriate to the query parameter.
query
Query text specifying the kind of places to locate
Returns:
The DiscoveryRequest
public static DiscoveryRequest createSearchRequest (String query)
Creates a Places Search request using a query argument.
A search location context must be provided by setting a bounding map viewport using
setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an
INVALID_PARAMETER when executing the request.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
query
Query text specifying the kind of places to locate
Returns:
The DiscoveryRequest
public static TextSuggestionRequest createTextSuggestionRequest
(GeoCoordinate location, String partialTerm)
HERE SDK for Android Developer's Guide
► API Reference
779
Creates a Places request to return a list of suggested search terms that are related to a specified
location context and a partial search term.
A search location must be specified. If no location context is provided, an IllegalArgumentException
will be thrown.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
location
A GeoCoordinate representing the location to search using suggested
terms
partialTerm
A partial search term used to create a list of suggested search terms
Returns:
The TextSuggestionRequest
public static TextSuggestionRequest createTextSuggestionRequest (String
partialTerm)
Creates a Places request to return a list of suggested search terms that are related to a specified
location context and a partial search term.
A search location context must be provided by setting a bounding map viewport using
setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an
INVALID_PARAMETER when executing the request.
Throws:
IllegalArgumentException
Upon a failure to handle a passed argument
Parameters:
partialTerm
Returns:
A partial search term used to create a list of suggested search terms
HERE SDK for Android Developer's Guide
► API Reference
780
The TextSuggestionRequest
ResultListener<T>
The interface ResultListener<T> is a member of com.here.android.mpa.search .
Type Parameters:
T – an object that extends this class
Interface Summary
public abstract interface ResultListener<T>
Represents an event listener that reports information about the completion of a request.
[For complete information, see the section Interface Details]
Method Summary
Table 357: Methods in ResultListener<T>
Methods
public abstract void
onCompleted (T data, ErrorCode error)
A callback indicating that a request operation has completed.
Interface Details
Represents an event listener that reports information about the completion of a request.
Method Details
public abstract void onCompleted (T data, ErrorCode error)
A callback indicating that a request operation has completed.
Parameters:
data
Search results (can be null if no results were found or an error was encountered)
error
An ErrorCode representing an appropriate result
HERE SDK for Android Developer's Guide
► API Reference
781
ReverseGeocodeRequest
The class ReverseGeocodeRequest is a member of com.here.android.mpa.search .
Class Summary
public class ReverseGeocodeRequest
extends java.lang.Object
The ReverseGeocodeRequest represents an extended Request used to retrieve Address data by
way of Geocoder search services.
[For complete information, see the section Class Details]
Constructor Summary
Table 358: Constructors in ReverseGeocodeRequest
Constructors
ReverseGeocodeRequest (GeoCoordinate location)
Creates a reverse geocoder request that resolves a GeoCoordinate into an Address.
Method Summary
Table 359: Methods in ReverseGeocodeRequest
Methods
public ErrorCode
execute (ResultListener listener)
Executes an asynchronous request.
Class Details
The ReverseGeocodeRequest represents an extended Request used to retrieve Address data by
way of Geocoder search services.
Note: the response to a ReverseGeocodeRequest is a single Address object.
HERE SDK for Android Developer's Guide
► API Reference
Constructor Details
ReverseGeocodeRequest (GeoCoordinate location)
Creates a reverse geocoder request that resolves a GeoCoordinate into an Address.
Parameters:
location
A GeoCoordinate representing the query location context
Method Details
public ErrorCode execute (ResultListener listener)
Executes an asynchronous request.
Parameters:
listener
A ResultListener passed along with the request to monitor progress
Returns:
The ErrorCode representing an appropriate result
ReviewMedia
The class ReviewMedia is a member of com.here.android.mpa.search .
Class Summary
public class ReviewMedia
extends com.here.android.mpa.search.Media, java.lang.Object
Represents review content about a Place.
[For complete information, see the section Class Details]
See also:
search.Place.getReviews ()
782
HERE SDK for Android Developer's Guide
► API Reference
783
Method Summary
Table 360: Methods in ReviewMedia
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getDate ()
Gets the date when the user contributed the review.
public String
getDescription ()
Gets the review content for the Place.
public String
getId ()
Get the review identifier.
public String
getIsoLanguageCode ()
Gets the ISO language code identifying the language in which the review is available.
public double
getRating ()
Gets the rating that the contributor of the review gave to the Place.
public String
getTitle ()
Gets the title of the review that the user contributed.
public UserLink
getUser ()
Gets the Link to details about the user who contributed the review.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents review content about a Place. Each individual Review contains information about the
review itself, the user who contributed the review, and a rating that the user offered for the place.
See also:
search.Place.getReviews ()
Method Details
public boolean equals (Object obj)
HERE SDK for Android Developer's Guide
► API Reference
784
For documentation, see java.lang.Object
Parameters:
obj
public String getDate ()
Gets the date when the user contributed the review.
Returns:
The date
public String getDescription ()
Gets the review content for the Place. Depending on the supplier, the full description might not be
displayed and the full review might be available only within the resource to which the optional via
attribute links.
Returns:
The content description
See also:
search.Media.getVia ()
public String getId ()
Get the review identifier.
Returns:
The review identifier.
public String getIsoLanguageCode ()
Gets the ISO language code identifying the language in which the review is available.
Note: a language code for a review is optional, so a call to this method could return null .
Returns:
The language code (could be null).
HERE SDK for Android Developer's Guide
► API Reference
public double getRating ()
Gets the rating that the contributor of the review gave to the Place.
Returns:
The rating as estimated by the review contributor
See also:
public String getTitle ()
Gets the title of the review that the user contributed.
Note: a title for a review is optional, so a call to this method could return null .
Returns:
The title (could be null).
public UserLink getUser ()
Gets the Link to details about the user who contributed the review.
Returns:
The user Link
public int hashCode ()
For documentation, see java.lang.Object
RichTextFormatting
The enumeration RichTextFormatting is a member of com.here.android.mpa.search .
Enumeration Summary
public final enumeration RichTextFormatting
785
HERE SDK for Android Developer's Guide
► API Reference
extends java.lang.Enum<E extends java.lang.Enum<E>>, java.lang.Object
Represents values describing possible formats for rich text content.
[For complete information, see the section Enumeration Details]
See also:
Request <T> #setRichTextFormatting(RichTextFormatting)
Enum Constant Summary
Table 361: Enum Constants in RichTextFormatting
Fields
public static final RichTextFormatting
HTML
HTML-encoded text.
public static final RichTextFormatting
PLAIN
Plain text.
Method Summary
Table 362: Methods in RichTextFormatting
Methods
public static RichTextFormatting
valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
public static RichTextFormatting[]
values ()
This method retrieves an array of constants of the given enum type in the order in which they are declared.
Enumeration Details
Represents values describing possible formats for rich text content.
See also:
Request <T> #setRichTextFormatting(RichTextFormatting)
Enum Constant Details
public static final RichTextFormatting HTML
786
HERE SDK for Android Developer's Guide
► API Reference
787
HTML-encoded text.
public static final RichTextFormatting PLAIN
Plain text.
Method Details
public static RichTextFormatting valueOf (String name)
This method retrieves the enumeration value that matches the name specified by the caller.
Parameters:
name
A string containing the name of the enumeration member whose value is to
be retrieved.
public static RichTextFormatting[] values ()
This method retrieves an array of constants of the given enum type in the order in which they are
declared.
SearchRequest
The class SearchRequest is a member of com.here.android.mpa.search .
Class Summary
public class SearchRequest
extends com.here.android.mpa.search.DiscoveryRequest, java.lang.Object
The SearchRequest processes text string queries based on the user's input to find specific places.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
788
Constructor Summary
Table 363: Constructors in SearchRequest
Constructors
SearchRequest (String query)
SearchRequest constructor
Method Summary
Table 364: Methods in SearchRequest
Methods
public ErrorCode
execute (ResultListener listener)
Executes an asynchronous request.
public SearchRequest
setQueryText (String query)
Set the search query text.
public SearchRequest
setSearchCenter (GeoCoordinate center)
Sets a GeoCoordinate representing the location context used to search for results that are appropriate to the query
parameter.
Class Details
The SearchRequest processes text string queries based on the user's input to find specific places.
It answers questions of "what" and "where" for an online search of POI or address.
The results of the SearchRequest are sets of places that match a user's search term in a specific
location context (such as near a given location, around a user's current position or on the currently
visible map).
A search location context must be provided by setting a search center location
using setSearchCenter(GeoCoordinate) or a bounding map viewport using
setMapViewport(GeoBoundingBox) or both. Failing to set a location context will result in an
INVALID_PARAMETER when executing the request.
Constructor Details
SearchRequest (String query)
SearchRequest constructor
HERE SDK for Android Developer's Guide
► API Reference
789
Parameters:
query
Query text specifying the kind of places to locate
Method Details
public ErrorCode execute (ResultListener listener)
Executes an asynchronous request.
Parameters:
listener
A ResultListener passed along with the request to monitor progress
Returns:
The ErrorCode representing an appropriate result
public SearchRequest setQueryText (String query)
Set the search query text.
Parameters:
query
Query text specifying the kind of places to locate
Returns:
The SearchRequest
public SearchRequest setSearchCenter (GeoCoordinate center)
Sets a GeoCoordinate representing the location context used to search for results that are
appropriate to the query parameter.
Parameters:
center
Returns:
A GeoCoordinate representing the location context used to search for results that are appropriate to the query parameter.
HERE SDK for Android Developer's Guide
► API Reference
The SearchRequest
SupplierLink
The class SupplierLink is a member of com.here.android.mpa.search .
Class Summary
public class SupplierLink
extends com.here.android.mpa.search.Link, java.lang.Object
Represents a SupplierLink which contains meta-information about a supplier.
[For complete information, see the section Class Details]
See also:
search.Place.getSupplier ()
search.Media.getSupplier ()
Method Summary
Table 365: Methods in SupplierLink
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getIconUrl ()
Gets the URL to retrieve the icon for the resource to which the Link refers.
public String
getId ()
Gets the unique identifier for the resource to which the Link refers.
public String
getName ()
Gets the name of the supplier that provided the the Link .
public String
getUrl ()
Gets the String representation of the URL to the supplier's profile
public int
hashCode ()
For documentation, see java.lang.Object
790
HERE SDK for Android Developer's Guide
► API Reference
791
Class Details
Represents a SupplierLink which contains meta-information about a supplier.
See also:
search.Place.getSupplier ()
search.Media.getSupplier ()
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getIconUrl ()
Gets the URL to retrieve the icon for the resource to which the Link refers.
Note: an icon URL for a linked object is optional, so a call to this method could return empty .
Returns:
The icon URL (could be empty)
public String getId ()
Gets the unique identifier for the resource to which the Link refers.
Note: an ID for a linked object is optional, so a call to this method could return empty .
Returns:
The ID (could be empty)
public String getName ()
Gets the name of the supplier that provided the the Link .
Note: a supplier name for a linked object is optional, so a call to this method could return empty .
Returns:
HERE SDK for Android Developer's Guide
► API Reference
792
The icon URL (could be empty)
public String getUrl ()
Gets the String representation of the URL to the supplier's profile
Returns:
The URL
public int hashCode ()
For documentation, see java.lang.Object
TextSuggestionRequest
The class TextSuggestionRequest is a member of com.here.android.mpa.search .
Class Summary
public class TextSuggestionRequest
extends java.lang.Object
Represents an extended Request used to retrieve a List of search terms by way of Places search
services.
[For complete information, see the section Class Details]
Constructor Summary
Table 366: Constructors in TextSuggestionRequest
Constructors
TextSuggestionRequest (String partialTerm)
Default constructor.
HERE SDK for Android Developer's Guide
► API Reference
793
Method Summary
Table 367: Methods in TextSuggestionRequest
Methods
public ErrorCode
execute (ResultListener listener)
Executes an asynchronous request.
public TextSuggestionRequest
setQueryText (String partialTerm)
Set the query partial search term.
public TextSuggestionRequest
setSearchCenter (GeoCoordinate center)
Sets the search center.
Class Details
Represents an extended Request used to retrieve a List of search terms by way of Places search
services.
A search location context must be provided by setting either a search center
using setSearchCenter(GeoCoordinate) or a bounding map viewport using
setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an
INVALID_PARAMETER when executing the request.
Constructor Details
TextSuggestionRequest (String partialTerm)
Default constructor.
Creates a request to return a list of suggested search terms that are related to a specified location
context and a partial search term.
* A search location context must be provided by setting either a search center
using setSearchCenter(GeoCoordinate) or a bounding map viewport using
setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an
INVALID_PARAMETER when executing the request.
Parameters:
partialTerm
HERE SDK for Android Developer's Guide
► API Reference
794
Method Details
public ErrorCode execute (ResultListener listener)
Executes an asynchronous request.
Parameters:
listener
A ResultListener passed along with the request to monitor progress
Returns:
The ErrorCode representing an appropriate result
public TextSuggestionRequest setQueryText (String partialTerm)
Set the query partial search term.
Parameters:
partialTerm
A partial search term used to create a list of suggested search terms.
Returns:
The TextSuggestionRequest.
public TextSuggestionRequest setSearchCenter (GeoCoordinate center)
Sets the search center.
Parameters:
center
The GeoCoordinate representing the location context used to search for
nearby places.
Returns:
The TextSuggestionRequest.
TransitDeparture
The class TransitDeparture is a member of com.here.android.mpa.search .
HERE SDK for Android Developer's Guide
► API Reference
Class Summary
public class TransitDeparture
extends java.lang.Object
Represents information about a single departure.
[For complete information, see the section Class Details]
Field Summary
Table 368: Fields in TransitDeparture
Fields
public static final String
DEPARTURE_PLATFORM_KEY_NAME
Key name to retrieve the departure platform information.
public static final String
DEPARTURE_TIME_KEY_NAME
Key name to retrieve departure time ( http://tools.ietf.org/html/rfc3339#section-5.6 format with timezone offset).
public static final String
EXCEPTION_EVENT_ADDITIONAL
Additional departure information provided.
public static final String
EXCEPTION_EVENT_CANCELLED
Departure has been cancelled.
public static final String
EXCEPTION_EVENT_REDIRECTED
Departure has been redirected.
public static final String
EXCEPTION_EVENT_REPLACED
Departure has been replaced.
protected PlacesTransitDeparture
m_pimpl
Method Summary
Table 369: Methods in TransitDeparture
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getDirection ()
795
HERE SDK for Android Developer's Guide
796
► API Reference
Methods
Gets direction of the departure on the line.
public String
getException ()
An indicator for some exceptional event happened to this departure.
public java.util.List <com.here.android.mpa.search.ExtendedAttribute>
()
getExtendedAttributes
Gets list of ExtendedAttribute features of departure.
public String
getLine ()
Reference to the line in transit lines collection information.
public String
getOperator ()
Gets a reference to the operator in the operators collection information.
public Map<java.lang.String, java.lang.String>
getRealTimeInformation ()
Gets the real (actual) departure time information.
public Map<java.lang.String, java.lang.String>
getScheduledTimeInformation ()
Gets the originally scheduled departure time information.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents information about a single departure. All times use http://tools.ietf.org/html/
rfc3339#section-5.6 format with timezone offset.
Field Details
public static final String DEPARTURE_PLATFORM_KEY_NAME
Key name to retrieve the departure platform information.
public static final String DEPARTURE_TIME_KEY_NAME
Key name to retrieve departure time ( http://tools.ietf.org/html/rfc3339#section-5.6 format with
timezone offset).
public static final String EXCEPTION_EVENT_ADDITIONAL
HERE SDK for Android Developer's Guide
► API Reference
Additional departure information provided.
public static final String EXCEPTION_EVENT_CANCELLED
Departure has been cancelled.
public static final String EXCEPTION_EVENT_REDIRECTED
Departure has been redirected.
public static final String EXCEPTION_EVENT_REPLACED
Departure has been replaced.
protected PlacesTransitDeparture m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getDirection ()
Gets direction of the departure on the line.
Returns:
The departure direction on the line.
public String getException ()
797
HERE SDK for Android Developer's Guide
► API Reference
An indicator for some exceptional event happened to this departure. Possible
values are: EXCEPTION_EVENT_REDIRECTED , EXCEPTION_EVENT_REPLACED ,
EXCEPTION_EVENT_CANCELLED and EXCEPTION_EVENT_ADDITIONAL .
Returns:
Exception event (if any have occurred).
public java.util.List <com.here.android.mpa.search.ExtendedAttribute>
getExtendedAttributes ()
Gets list of ExtendedAttribute features of departure. Supported keys are bikeAllowed and
barrierFree .
Returns:
List of departure ExtendedAttribute.
public String getLine ()
Reference to the line in transit lines collection information.
Returns:
The line name.
public String getOperator ()
Gets a reference to the operator in the operators collection information.
Returns:
The operator name.
public Map<java.lang.String, java.lang.String> getRealTimeInformation ()
Gets the real (actual) departure time information. The departure key represents the departure
time.
Known key identifier values are:
•
•
DEPARTURE_TIME_KEY_NAME - real-time departure time (RFC 3339 date-time)
DEPARTURE_PLATFORM_KEY_NAME - real-time departure platform (optional)
798
HERE SDK for Android Developer's Guide
► API Reference
799
Returns:
The map collection of real (actual) departure time information.
public Map<java.lang.String, java.lang.String> getScheduledTimeInformation
()
Gets the originally scheduled departure time information.
Known key identifier values are:
•
•
DEPARTURE_TIME_KEY_NAME - scheduled departure time ( RFC 3339 date-time)
DEPARTURE_PLATFORM_KEY_NAME - scheduled departure platform (optional)
Returns:
The map collection of originally scheduled departure time information.
public int hashCode ()
For documentation, see java.lang.Object
TransitDeparturesAttribute
The class TransitDeparturesAttribute is a member of com.here.android.mpa.search .
Class Summary
public class TransitDeparturesAttribute
extends com.here.android.mpa.search.ExtendedAttribute, java.lang.Object
Represents a Transit Departures Extended Attribute that is associated with public transport stop/
station and contains information about scheduled departures from the place.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
800
Method Summary
Table 370: Methods in TransitDeparturesAttribute
Methods
public TransitSchedulePage
getSchedule ()
Gets a paged collection of scheduled departure information.
Class Details
Represents a Transit Departures Extended Attribute that is associated with public transport stop/
station and contains information about scheduled departures from the place.
Method Details
public TransitSchedulePage getSchedule ()
Gets a paged collection of scheduled departure information.
Returns:
TransitSchedulePage representing a paged collection of scheduled departure information.
TransitDestination
The class TransitDestination is a member of com.here.android.mpa.search .
Class Summary
public class TransitDestination
extends java.lang.Object
Represents a destination served from station/stop.
[For complete information, see the section Class Details]
HERE SDK for Android Developer's Guide
► API Reference
Field Summary
Table 371: Fields in TransitDestination
Fields
protected PlacesTransitDestination
m_pimpl
Method Summary
Table 372: Methods in TransitDestination
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getDestination ()
Gets the name of the destination.
public String
getLine ()
Gets the name of the line serving the destination.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents a destination served from station/stop.
Field Details
protected PlacesTransitDestination m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
801
HERE SDK for Android Developer's Guide
► API Reference
public String getDestination ()
Gets the name of the destination.
Returns:
The destination name.
public String getLine ()
Gets the name of the line serving the destination.
Returns:
The line name.
public int hashCode ()
For documentation, see java.lang.Object
TransitLine
The class TransitLine is a member of com.here.android.mpa.search .
Class Summary
public class TransitLine
extends java.lang.Object
Represents a public transport line.
[For complete information, see the section Class Details]
Field Summary
Table 373: Fields in TransitLine
Fields
protected PlacesTransitLine
m_pimpl
802
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 374: Methods in TransitLine
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getDestination ()
Gets the line destination.
public TransitLineCategory
getLineCategory ()
Gets the category information for the line.
public String
getName ()
Gets the line name.
public String
getOperator ()
Gets the operator serving the line.
public TransitLineStyle
getStyle ()
Gets the style guideline information for the line.
public int
hashCode ()
Class Details
Represents a public transport line.
Field Details
protected PlacesTransitLine m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
803
HERE SDK for Android Developer's Guide
► API Reference
public String getDestination ()
Gets the line destination.
Returns:
The line destination.
public TransitLineCategory getLineCategory ()
Gets the category information for the line.
Returns:
The TransitLineCategory information.
public String getName ()
Gets the line name.
Returns:
The line name
public String getOperator ()
Gets the operator serving the line.
Returns:
The line operator.
public TransitLineStyle getStyle ()
Gets the style guideline information for the line.
Returns:
The TransitLineStyle information.
public int hashCode ()
804
HERE SDK for Android Developer's Guide
► API Reference
TransitLineCategory
The class TransitLineCategory is a member of com.here.android.mpa.search .
Class Summary
public class TransitLineCategory
extends java.lang.Object
Represents the category information for the public transport line.
[For complete information, see the section Class Details]
Field Summary
Table 375: Fields in TransitLineCategory
Fields
protected PlacesTransitLineCategory
Method Summary
Table 376: Methods in TransitLineCategory
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getIcon ()
Gets the icon for the category.
public String
getId ()
Gets the category unique identifier.
public String
getLocalName ()
Gets the locally used name for the category.
public String
getTitle ()
Gets the localized name of the category.
public int
hashCode ()
m_pimpl
805
HERE SDK for Android Developer's Guide
► API Reference
Methods
For documentation, see java.lang.Object
Class Details
Represents the category information for the public transport line.
Field Details
protected PlacesTransitLineCategory m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getIcon ()
Gets the icon for the category.
Returns:
The category icon.
public String getId ()
Gets the category unique identifier.
Returns:
The category identifier.
public String getLocalName ()
Gets the locally used name for the category.
806
HERE SDK for Android Developer's Guide
► API Reference
Returns:
The locally used category name.
public String getTitle ()
Gets the localized name of the category.
Returns:
The localized category name.
public int hashCode ()
For documentation, see java.lang.Object
TransitLineStyle
The class TransitLineStyle is a member of com.here.android.mpa.search .
Class Summary
public class TransitLineStyle
extends java.lang.Object
Represents the styling guideline information for the public transport line.
[For complete information, see the section Class Details]
Field Summary
Table 377: Fields in TransitLineStyle
Fields
protected PlacesTransitLineStyle
m_pimpl
807
HERE SDK for Android Developer's Guide
► API Reference
808
Method Summary
Table 378: Methods in TransitLineStyle
Methods
public boolean
public String
equals (Object obj)
getColor ()
Gets the color value assigned to a line.
public String
getIconShape ()
Gets the shape style identifying the icon for the line.
public String
getOutlineColor ()
Gets the color of the border around the line name.
public String
getTextColor ()
Gets the text color that should get used when the line color is used as background color.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents the styling guideline information for the public transport line. All colors are in hex format.
Field Details
protected PlacesTransitLineStyle m_pimpl
Method Details
public boolean equals (Object obj)
Parameters:
obj
public String getColor ()
Gets the color value assigned to a line.
HERE SDK for Android Developer's Guide
► API Reference
Returns:
The line color value (hex format).
public String getIconShape ()
Gets the shape style identifying the icon for the line.
Returns:
The icon shape.
public String getOutlineColor ()
Gets the color of the border around the line name.
Returns:
The line border color value (hex format).
public String getTextColor ()
Gets the text color that should get used when the line color is used as background color.
Returns:
The text color value (hex format).
public int hashCode ()
For documentation, see java.lang.Object
TransitLinesAttribute
The class TransitLinesAttribute is a member of com.here.android.mpa.search .
Class Summary
public class TransitLinesAttribute
extends com.here.android.mpa.search.ExtendedAttribute, java.lang.Object
809
HERE SDK for Android Developer's Guide
810
► API Reference
Represents a Transit Lines Extended Attribute that is associated with public transport stop/station
and contains information about the lines and destinations.
[For complete information, see the section Class Details]
Method Summary
Table 379: Methods in TransitLinesAttribute
Methods
public java.util.List <com.here.android.mpa.search.TransitDestination>
getDestinations ()
Gets list of destinations served from this stop/station.
public java.util.Map <java.lang.String, com.here.android.mpa.search.TransitLine>
getLines ()
Gets collection of public transport lines using this stop/station.
Class Details
Represents a Transit Lines Extended Attribute that is associated with public transport stop/station
and contains information about the lines and destinations.
Method Details
public java.util.List <com.here.android.mpa.search.TransitDestination>
getDestinations ()
Gets list of destinations served from this stop/station.
Returns:
List of TransitDesitnation information.
public java.util.Map <java.lang.String,
com.here.android.mpa.search.TransitLine> getLines ()
Gets collection of public transport lines using this stop/station.
Returns:
Map collection of transport line stop/station name to TransitLine information.
HERE SDK for Android Developer's Guide
► API Reference
TransitOperator
The class TransitOperator is a member of com.here.android.mpa.search .
Class Summary
public class TransitOperator
extends java.lang.Object
Represents a public transport operator.
[For complete information, see the section Class Details]
Field Summary
Table 380: Fields in TransitOperator
Fields
protected PlacesTransitOperator
m_pimpl
Method Summary
Table 381: Methods in TransitOperator
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getId ()
Gets the operator identifier.
public java.util.Map <java.lang.String, com.here.android.mpa.search.TransitOperatorLink>
getLinks ()
Gets the map collection of additional links to be displayed next to the departure information of the operator.
public TransitOperatorSupplier
getSupplier ()
Gets the supplier of the operator's schedule information.
public String
getTitle ()
Gets the name of the operator.
public int
hashCode ()
811
HERE SDK for Android Developer's Guide
► API Reference
812
Methods
For documentation, see java.lang.Object
Class Details
Represents a public transport operator.
Field Details
protected PlacesTransitOperator m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getId ()
Gets the operator identifier.
Returns:
The operator identifier.
public java.util.Map <java.lang.String,
com.here.android.mpa.search.TransitOperatorLink> getLinks ()
Gets the map collection of additional links to be displayed next to the departure information of the
operator.
Returns:
Map collection of operator's names to TransitOperatorLink information.
public TransitOperatorSupplier getSupplier ()
HERE SDK for Android Developer's Guide
► API Reference
Gets the supplier of the operator's schedule information.
Returns:
The TransitOperatorSupplier information.
public String getTitle ()
Gets the name of the operator.
Returns:
The operator name.
public int hashCode ()
For documentation, see java.lang.Object
TransitOperatorLink
The class TransitOperatorLink is a member of com.here.android.mpa.search .
Class Summary
public class TransitOperatorLink
extends java.lang.Object
Represents an additional link associated with transit operator.
[For complete information, see the section Class Details]
Field Summary
Table 382: Fields in TransitOperatorLink
Fields
protected PlacesTransitOperatorLink
m_pimpl
813
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 383: Methods in TransitOperatorLink
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getText ()
Gets the operator link text.
public Link
getUrl ()
Gets the Link to the operator information.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents an additional link associated with transit operator.
Field Details
protected PlacesTransitOperatorLink m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getText ()
Gets the operator link text.
Returns:
The operator link text.
814
HERE SDK for Android Developer's Guide
► API Reference
public Link getUrl ()
Gets the Link to the operator information.
Returns:
The Link to the operator information.
public int hashCode ()
For documentation, see java.lang.Object
TransitOperatorSupplier
The class TransitOperatorSupplier is a member of com.here.android.mpa.search .
Class Summary
public class TransitOperatorSupplier
extends java.lang.Object
Represents a supplier of the public transport operator's schedule.
[For complete information, see the section Class Details]
Field Summary
Table 384: Fields in TransitOperatorSupplier
Fields
protected PlacesTransitOperatorSupplier
Method Summary
Table 385: Methods in TransitOperatorSupplier
Methods
public boolean
equals (Object obj)
m_pimpl
815
HERE SDK for Android Developer's Guide
► API Reference
Methods
For documentation, see java.lang.Object
public String
getTitle ()
Gets the supplier title.
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents a supplier of the public transport operator's schedule.
Field Details
protected PlacesTransitOperatorSupplier m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getTitle ()
Gets the supplier title.
Returns:
The supplier title.
public int hashCode ()
For documentation, see java.lang.Object
816
HERE SDK for Android Developer's Guide
817
► API Reference
TransitSchedulePage
The class TransitSchedulePage is a member of com.here.android.mpa.search .
Class Summary
public class TransitSchedulePage
extends java.lang.Object
Represents departure information for a public transport stop/station.
[For complete information, see the section Class Details]
Field Summary
Table 386: Fields in TransitSchedulePage
Fields
protected PlacesTransitSchedulePage
m_pimpl
Method Summary
Table 387: Methods in TransitSchedulePage
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public java.util.List <com.here.android.mpa.search.TransitDeparture>
getItems ()
Gets the list of departures.
public java.util.Map <java.lang.String, com.here.android.mpa.search.TransitLine>
getLines ()
Gets the map collection of transit line names to TransitLine information.
public TransitSchedulePageRequest
getNextPageRequest ()
Gets the TransitSchedulePageRequest for requesting the next page of the TransitSchedulePage .
public int
getOffsetCount ()
Gets the collection offset count for the current page of the TransitSchedulePage .
public java.util.Map <java.lang.String, com.here.android.mpa.search.TransitOperator>
getOperators ()
HERE SDK for Android Developer's Guide
► API Reference
818
Methods
Gets the map collection of transit line operators to TransitOperator information.
public TransitSchedulePageRequest
getPreviousPageRequest ()
Gets the TransitSchedulePageRequest for requesting the previous page of the TransitSchedulePage .
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents departure information for a public transport stop/station. Departure items are paginated
based on page size parameter.
Field Details
protected PlacesTransitSchedulePage m_pimpl
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public java.util.List <com.here.android.mpa.search.TransitDeparture>
getItems ()
Gets the list of departures.
Returns:
The list of TransitDeparture
public java.util.Map <java.lang.String,
com.here.android.mpa.search.TransitLine> getLines ()
Gets the map collection of transit line names to TransitLine information.
HERE SDK for Android Developer's Guide
► API Reference
819
Returns:
The map collection of lines serving departures shown in current departure item list using line name as
a key
public TransitSchedulePageRequest getNextPageRequest ()
Gets the TransitSchedulePageRequest for requesting the next page of the
TransitSchedulePage .
Returns:
The TransitSchedulePageRequest
public int getOffsetCount ()
Gets the collection offset count for the current page of the TransitSchedulePage .
For the first page of results, the offset count is 0. Following any call to getNextPageRequest(), the
offset count will be greater than 0.
Returns:
The collection offset count
public java.util.Map <java.lang.String,
com.here.android.mpa.search.TransitOperator> getOperators ()
Gets the map collection of transit line operators to TransitOperator information.
Returns:
The map collection of operators operating on this stop/station using operator ID as a key
public TransitSchedulePageRequest getPreviousPageRequest ()
Gets the TransitSchedulePageRequest for requesting the previous page of the
TransitSchedulePage .
Returns:
The TransitSchedulePageRequest
HERE SDK for Android Developer's Guide
► API Reference
820
public int hashCode ()
For documentation, see java.lang.Object
TransitSchedulePageRequest
The class TransitSchedulePageRequest is a member of com.here.android.mpa.search .
Class Summary
public class TransitSchedulePageRequest
extends java.lang.Object
Represents an extended Request used to retrieve TransitSchedulePage information associated
with a Place, by way of Places search services.
[For complete information, see the section Class Details]
Method Summary
Table 388: Methods in TransitSchedulePageRequest
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public ErrorCode
execute (ResultListener eventListener)
Executes an asynchronous request.
This method overrides search.Request<T>.execute(ResultListener)
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents an extended Request used to retrieve TransitSchedulePage information associated
with a Place, by way of Places search services.
Note: the response to a TransitSchedulePageRequest is a TransitSchedulePage object.
HERE SDK for Android Developer's Guide
► API Reference
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public ErrorCode execute (ResultListener eventListener)
Executes an asynchronous request.
This method overrides search.Request<T>.execute(ResultListener)
Parameters:
eventListener
public int hashCode ()
For documentation, see java.lang.Object
UserLink
The class UserLink is a member of com.here.android.mpa.search .
Class Summary
public class UserLink
extends com.here.android.mpa.search.Link, java.lang.Object
Represents a UserLink which contains additional attributes to describe a user.
[For complete information, see the section Class Details]
See also:
search.ImageMedia.getUser ()
search.ReviewMedia.getUser ()
821
HERE SDK for Android Developer's Guide
► API Reference
Method Summary
Table 389: Methods in UserLink
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getName ()
Gets the name of the user that provided the the Link .
public String
getUrl ()
Gets the String representation of the URL to the user's profile
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents a UserLink which contains additional attributes to describe a user.
See also:
search.ImageMedia.getUser ()
search.ReviewMedia.getUser ()
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getName ()
Gets the name of the user that provided the the Link .
Note: a user name for a linked object is optional, so a call to this method could return empty .
Returns:
822
HERE SDK for Android Developer's Guide
► API Reference
The icon URL (could be empty)
public String getUrl ()
Gets the String representation of the URL to the user's profile
Returns:
The URL
public int hashCode ()
For documentation, see java.lang.Object
ViaLink
The class ViaLink is a member of com.here.android.mpa.search .
Class Summary
public class ViaLink
extends com.here.android.mpa.search.Link, java.lang.Object
Represents a ViaLink to an external website of the supplier of content.
[For complete information, see the section Class Details]
See also:
search.Media.getVia ()
Method Summary
Table 390: Methods in ViaLink
Methods
public boolean
equals (Object obj)
For documentation, see java.lang.Object
public String
getUrl ()
Gets the String representation of the URL to an external website
823
HERE SDK for Android Developer's Guide
► API Reference
Methods
public int
hashCode ()
For documentation, see java.lang.Object
Class Details
Represents a ViaLink to an external website of the supplier of content.
See also:
search.Media.getVia ()
Method Details
public boolean equals (Object obj)
For documentation, see java.lang.Object
Parameters:
obj
public String getUrl ()
Gets the String representation of the URL to an external website
Returns:
The URL
public int hashCode ()
For documentation, see java.lang.Object
824
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising