summaryrefslogtreecommitdiff
path: root/src/location/doc/src/qtlocation-geoservices.qdoc
blob: ca64f986ce22a5976f12448e3479cb91aa4d5f49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page qtlocation-geoservices.html
\title Qt Location GeoServices
\brief Implementing Qt Location GeoService plugins

The Qt Location provides the majority of its functionality through GeoService plugins. This
document outlines how to develop a new GeoService plugin.

\section1 Plugin Description

Each plugin is described by a json file. The json describes the plugins capabilities and
version. Below is an example of a json file used by the OpenStreenMap plugin:


\quotefile ../../../plugins/geoservices/osm/osm_plugin.json

The entries have the following meaning:

\table
    \header
        \li Key
        \li Description
    \row
        \li Keys
        \li The unique name/key of the plugin. Each GeoService plugin must have a unique name.
    \row
        \li Provider
        \li The provider name of the services. Multiple plugins may have the same name.
            In such cases the Version string will be used to further distinguish the plugins.
    \row
        \li Experimental
        \li Marks the service plugin as experimental. API developers may choose to ignore
            such plugins when instanciating \l QGeoServiceProvider::QGeoServiceProvider().
    \row
        \li Version
        \li The plugin version. If multiple plugins have the same provider name, the plugin
            with the higest version will be used.
    \row
        \li Features
        \li List of features provided by the plugin/service. Each feature is a string
        representation of the corresponding features in \l QGeoServiceProvider. For more
        details see \l QGeoServiceProvider::routingFeatures(),
        \l QGeoServiceProvider::geocodingFeatures() and \l QGeoServiceProvider::placesFeatures().

\endtable

\section1 Implementing Plugins

A plugin implementer needs to subclass QGeoServiceProviderFactory and as
many of the ManagerEngine classes as they want to provide implementations for.

Subclassing QGeoServiceProviderFactory will only involves overriding of one of the following
methods:

\list
    \li \l QGeoServiceProviderFactory::createGeocodingManagerEngine()
    \li \l QGeoServiceProviderFactory::createRoutingManagerEngine()
    \li \l QGeoServiceProviderFactory::createPlaceManagerEngine()
\endlist

If a plugin does not provide an engine the relevant function should return \nullptr.

\annotatedlist QtLocation-impl

*/