Qt Location HERE Plugin

Overview

Included with Qt Location is a geo services plugin which accesses the relevant HERE services provided by HERE/Nokia. The use of these services is governed by the terms and conditions available at https://developer.here.com/terms-conditions.

Note that accepting the terms and conditions only applies those terms and conditions to the use of the HERE geo services plugin and does not limit the use of the other geo services plugins that may be included with Qt.

The HERE geo services plugin can be loaded by using the plugin key "here".

The online plugin uses the tiled map classes, which caches tile data in heap memory and texture memory.

Parameters

Mandatory parameters

The following table lists mandatory parameters that must be passed to the HERE plugin.

ParameterDescription
here.app_idClient app_id part of the app_id/token pair used for authentication by all managers.
here.tokenClient token part of the app_id/token pair for the service used for authentication by all managers.

The HERE geo services plugin requires an application id and token pair to authenticate the application with the HERE services. To obtain an application id and token pair visit https://developer.here.com/

Optional parameters

The following table lists optional parameters that can be passed to the HERE plugin.

Note: Since Qt 5.5 all parameters below must be prefixed with here. Previous versions did not require a prefix.

ParameterDescription
here.proxyProxy server URL used by all managers. For usage of the system proxy just pass "system" as value.

Note: See the notes in QNetworkProxyFactory::systemProxyForQuery() for further information.

here.mapping.hostBase map tile service URL used by mapping manager.
here.mapping.host.aerialAerial map tile service URL used by mapping manager. For all satellite, hybrid and terrain schemes.
here.mapping.cache.directoryAbsolute path to map tile cache directory used as network disk cache.

The default place for the cache is the QtLocation/here subdirectory in the location returned by QStandardPaths::writableLocation(), called with QStandardPaths::GenericCacheLocation as a parameter. On systems that have no concept of a shared cache, the application-specific QStandardPaths::CacheLocation is used instead.

here.mapping.cache.disk.cost_strategyThe cost strategy to use to cache map tiles on disk. Valid values are bytesize and unitary. Using bytesize, the related size parameter (here.mapping.cache.disk.size) will be interpreted as bytes. Using unitary, they will be interpreted as number of tiles. The default value for this parameter is bytesize.
here.mapping.cache.disk.sizeDisk cache size for map tiles. The default size of the cache is 50 MiB when bytesize is the cost strategy for this cache, or 1000 tiles, when unitary is the cost strategy.
here.mapping.cache.memory.cost_strategyThe cost strategy to use to cache map tiles in memory. Valid values are bytesize and unitary. Using bytesize, the related size parameter (here.mapping.cache.memory.size) will be interpreted as bytes. Using unitary, they will be interpreted as number of tiles. The default value for this parameter is bytesize.
here.mapping.cache.memory.sizeMemory cache size for map tiles. The default size of the cache is 3 MiB when bytesize is the cost strategy for this cache, or 100 tiles, when unitary is the cost strategy.
here.mapping.cache.texture.cost_strategyThe cost strategy to use to cache decompressed map tiles in memory. Valid values are bytesize and unitary. Using bytesize, the related size parameter (here.mapping.cache.texture.size) will be interpreted as bytes. Using unitary, they will be interpreted as number of tiles. The default value for this parameter is bytesize.
here.mapping.cache.texture.sizeTexture cache size for map tiles. The default size of the cache is 6 MiB when bytesize is the cost strategy for this cache, or 30 tiles, when unitary is the cost strategy. Note that the texture cache has a hard minimum size which depends on the size of the map viewport (it must contain enough data to display the tiles currently visible on the display). This value is the amount of cache to be used in addition to the bare minimum.
here.mapping.prefetching_styleThis parameter allows to provide a hint how tile prefetching is to be performed by the engine. The default value, TwoNeighbourLayers, makes the engine prefetch tiles for the layer above and the one below the current tile layer, providing ready tiles when zooming in or out from the current zoom level. OneNeighbourLayer only prefetches the one layer closest to the current zoom level. Finally, NoPrefetching allows to disable the prefetching, so only tiles that are visible will be fetched. Note that, depending on the active map type, this hint might be ignored.
here.mapping.highdpi_tilesWhether or not to request high dpi tiles. Valid values are true and false. The default value is false.
here.geocoding.hostGeocoding service URL used by geocoding manager.
here.routing.hostRouting service URL used by routing manager.
here.places.hostSearch service URL used by search manager.
here.places.api_versionVersion of the REST API used by the places manager. Currently versions 1 and 2 are supported. The version 1 is deprecated and will not be part of the final Qt release. The default is version 2.

Parameter Usage Example

The following two examples show how to create a HERE plugin instance with parameters supplied for an application id and token, which is required for authentication.

QML

Plugin {
    name: "here"
    PluginParameter { name: "here.app_id"; value: "myapp" }
    PluginParameter { name: "here.token"; value: "abcdefg12345" }
}

C++

QMap<QString,QVariant> params;
params["here.app_id"] = "myapp";
params["here.token"] = "abcdefg12345";

QGeoServiceProvider *gsp = new QGeoServiceProvider("here", params);

Places

The HERE provider remotely accesses places (read-only) from a REST based server. The specific capabilities and behaviours are outlined below:

Capabilities

Storageremote
Read/Writeread-only
Iconsyes
Search term suggestionsyes
Recommendationsyes
Category structureHierarchical
(Rich) Content imagesyes
(Rich) Content reviewsyes
(Rich) Content editorialsyes
All details fetched during searchno
Paging offset indexno
Paging limityes
Distance relevance hintno
Lexical name relevance hintno
Extended Attributesyes
Notifications for added/removed places/categoriesno
visibility scopespublic
favorites matching/(usable as favoritesPlugin)no

Plugin Specific Behaviors and Limitations.

The following list shows what core place data is returned during a place search:

  • name
  • location
  • contact information
  • attribution
  • categories
  • rating
  • visibility

The following list shows further details that may be retrieved via QPlaceManager::getDetails()

  • supplier
  • extended attributes

Searching for Places

Search Term and Categories

The HERE plugin supports searching with a search term and category or categories, however both are not supported simultaneously.

  • Valid usage: search term + search center
  • Valid usage: category + search center
  • Invalid usage: search term + category + search center

This limitation applies when using the HERE plugin with PlaceSearchModel and QPlaceManager::search().

Search Area

The HERE plugin only supports provision of a search center when searching for places via PlaceSearchModel and QPlaceManager::search(). A search center can be provided via a bounding circle, however the radius should be kept at the default value of -1. Typically a developer should not have to set the radius at all. If a developer sets a radius, it is ignored by the plugin and the boundaries are not honored.

In a similar manner only the center of a bounding box is taken into consideration when searching. The boundaries of the box are not honored.

A search center must be provided for all searches.

Relevancy Hints

The HERE plugin does not support relevancy hints. Any relevancy hints supplied to a search request are consequently ignored.

Search Term suggestions

Only a partial search term and search center is supported when retrieving suggestions. This limitation applies when using the HERE plugin with the PlaceSearchSuggestionModel and QPlaceManager::searchSuggestions().

Both search term and search center must be provided when retrieving search term suggestions.

Recommendations

Only a given place identifier is supported as a parameter for a recommendations. No other parameters such as limit, offset, and search area are supported. This limitation applies when using the HERE plugin with PlaceSearchModel and QPlaceManager::search().

Extended Attributes

The supported set of attributes provided by the HERE plugin are not fixed and may grow over time. Also the attributes provided may vary according to a place by place basis, e.g one place may provide opening hours while another does not. At the time of writing, it is known that some places provide openingHours (QPlaceAttribute::OpeningHours) and payment (QPlaceAttribute::Payment) methods but other attributes may be made available by the backend server. All places provided by the plugin will have the x_provider (QPlaceAttribute::Provider) attribute set to here.

Restrictions of Usage - ExtendedAttributes and Content

The extended attributes and rich content of places are not permitted to be saved. For QML this is related to Place::extendedAttributes, ImageModel, ReviewModel, and EditorialModel. For C++ this relates to QPlace::extendedAttribute(), QPlace::content() and QPlaceManager::getPlaceContent().

(Note that the HERE plugin is a read-only source of places and does not support saving functionality at all.)

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.