To get started with the Location Library, follow the steps below.
For instructions on how to authenticate with the platform, see the Get Your Credentials section of the SDK for Java & Scala.
For instructions about how to configure your environment, see the Configure Your Environment section of the SDK for Java & Scala.
To run the code snippets in this document using Maven, make sure you follow the instructions on how to manage dependencies in the Include the SDK in Your Project section of the SDK for Java & Scala.
Several code snippets in this document load data from catalogs. To refer to a catalog, these code snippets must provide the HRN and the version of this catalog. Instead of using hard-coded values for HRNs and versions of catalogs, the code snippets use constants defined as follows:
import com.here.platform.location.integration.heremapcontent.HereMapContent import com.here.platform.location.integration.optimizedmap.OptimizedMap // Optimized Map For Location Library val optimizedMapHRN = OptimizedMap.v2.HRN val optimizedMapVersion = 1138L // HERE Map Content val hereMapContentHRN = HereMapContent.v2.HRN val hereMapContentVersion = 1187L
import com.here.hrn.HRN; import com.here.platform.location.inmemory.graph.Edge; import com.here.platform.location.integration.heremapcontent.HereMapContent; import com.here.platform.location.integration.optimizedmap.OptimizedMap; // Optimized Map for Location Library final HRN optimizedMapHRN = OptimizedMap.v2.HRN; final long optimizedMapVersion = 1138L; // HERE Map Content final HRN hereMapContentHRN = HereMapContent.v2.HRN; final long hereMapContentVersion = 1187L;
You can find the HRN and the latest version of catalogs such as the Optimized Map for Location Library in the
Overview of the Catalog.
Before you run the Location Library examples, download the SDK zip file at https://platform.here.com/sdk. The
examples/location directory contains the examples. For instructions on how to run them, see