summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron McCarthy <mccarthy.aaron@gmail.com>2014-12-12 14:18:35 +1000
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-02-04 11:18:12 +0000
commit8e2c7e491373c17f8985530690000abcb76dee0b (patch)
tree40c8b12bd285b237430cdc850e5be560acfb52fe
parentd5daf443ca594bd60ee9abfb167c96ab892da899 (diff)
downloadqtlocation-8e2c7e491373c17f8985530690000abcb76dee0b.tar.gz
Make Open Street Maps the default plugin used in Qt Location examples.
The Nokia plugin requires application authentication codes before it can be used. The OSM plugin does not. Use the OSM plugin by default so that the examples work out of the box. Change-Id: I4c965dc35b0ae6b643ee14f64c0758fee2bb958d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
-rw-r--r--examples/location/mapviewer/mapviewer.qml39
-rw-r--r--examples/location/places/places.qml4
-rw-r--r--examples/location/places_list/places_list.qml2
-rw-r--r--examples/location/places_map/places_map.qml2
-rw-r--r--src/imports/location/qdeclarativegeoroutemodel.cpp2
-rw-r--r--src/imports/location/qdeclarativegeoserviceprovider.cpp4
-rw-r--r--src/location/doc/snippets/declarative/places_loader.qml2
-rw-r--r--src/location/doc/src/places.qdoc2
-rw-r--r--src/location/doc/src/qtlocation-qml.qdoc2
9 files changed, 15 insertions, 44 deletions
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml
index 4f087c0a..b49315b1 100644
--- a/examples/location/mapviewer/mapviewer.qml
+++ b/examples/location/mapviewer/mapviewer.qml
@@ -190,8 +190,11 @@ Item {
Component.onCompleted: {
var plugins = getPlugins()
- for (var i = 0; i<plugins.length; i++)
+ for (var i = 0; i<plugins.length; i++) {
addItem(plugins[i])
+ if (plugins[i] === "osm")
+ exclusiveButton = plugins[i]
+ }
}
onExclusiveButtonChanged: createMap(exclusiveButton)
@@ -491,38 +494,6 @@ Item {
}
}
-
- /* GeocodeModel {
- id: geocodeModel
- plugin : Plugin { name : "nokia"}
- onLocationsChanged: {
- if (geocodeModel.count > 0) {
- console.log('setting the coordinate as locations changed in model.')
- map.center = geocodeModel.get(0).coordinate
- }
- }
- }*/
-
- //=====================Map=====================
-
- /* MapObjectView {
- model: geocodeModel
- delegate: Component {
- MapCircle {
- radius: 10000
- color: "red"
- center: location.coordinate
- }
- }
- }
-
-
- */
-
-/*
-
- }
-*/
function geocodeMessage(){
var street, district, city, county, state, countryCode, country, postalCode, latitude, longitude, text
latitude = Math.round(map.geocodeModel.get(0).coordinate.latitude * 10000) / 10000
@@ -551,7 +522,7 @@ Item {
function createMap(provider){
var plugin
- if (parameters.length>0)
+ if (parameters && parameters.length > 0)
plugin = Qt.createQmlObject ('import QtLocation 5.3; Plugin{ name:"' + provider + '"; parameters: page.parameters}', page)
else
plugin = Qt.createQmlObject ('import QtLocation 5.3; Plugin{ name:"' + provider + '"}', page)
diff --git a/examples/location/places/places.qml b/examples/location/places/places.qml
index 23330591..00d48d8e 100644
--- a/examples/location/places/places.qml
+++ b/examples/location/places/places.qml
@@ -96,8 +96,8 @@ Item {
for (var i = 0; i<plugins.length; i++) {
addItem(plugins[i]);
- // default to nokia plugin
- if (plugins[i] === "nokia")
+ // default to osm plugin
+ if (plugins[i] === "osm")
exclusiveButton = plugins[i];
}
diff --git a/examples/location/places_list/places_list.qml b/examples/location/places_list/places_list.qml
index 45c4712f..7052db74 100644
--- a/examples/location/places_list/places_list.qml
+++ b/examples/location/places_list/places_list.qml
@@ -52,7 +52,7 @@ Rectangle {
//! [Initialize Plugin]
Plugin {
id: myPlugin
- name: "nokia"
+ name: "osm"
//specify plugin parameters as necessary
//PluginParameter {...}
//PluginParameter {...}
diff --git a/examples/location/places_map/places_map.qml b/examples/location/places_map/places_map.qml
index e6ceafe8..bb65a113 100644
--- a/examples/location/places_map/places_map.qml
+++ b/examples/location/places_map/places_map.qml
@@ -51,7 +51,7 @@ Rectangle {
//! [Initialize Plugin]
Plugin {
id: myPlugin
- name: "nokia"
+ name: "osm"
//specify plugin parameters if necessary
//PluginParameter {...}
//PluginParameter {...}
diff --git a/src/imports/location/qdeclarativegeoroutemodel.cpp b/src/imports/location/qdeclarativegeoroutemodel.cpp
index b47d3313..90d07f03 100644
--- a/src/imports/location/qdeclarativegeoroutemodel.cpp
+++ b/src/imports/location/qdeclarativegeoroutemodel.cpp
@@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE
\code
Plugin {
id: aPlugin
- name: "nokia"
+ name: "osm"
}
RouteQuery {
diff --git a/src/imports/location/qdeclarativegeoserviceprovider.cpp b/src/imports/location/qdeclarativegeoserviceprovider.cpp
index 8bdac880..082464ea 100644
--- a/src/imports/location/qdeclarativegeoserviceprovider.cpp
+++ b/src/imports/location/qdeclarativegeoserviceprovider.cpp
@@ -68,12 +68,12 @@ QT_BEGIN_NAMESPACE
The following snippet shows a Plugin object being created with the
\l required and \l preferred properties set. This Plugin will attach to the
first plugin found plugin that supports both mapping and geocoding, and will
- prefer plugins named "nokia" or "foo" to any others.
+ prefer plugins named "nokia" or "osm" to any others.
\code
Plugin {
id: plugin
- preferred: ["nokia", "foo"]
+ preferred: ["nokia", "osm"]
required: Plugin.AnyMappingFeatures | Plugin.AnyGeocodingFeatures
}
\endcode
diff --git a/src/location/doc/snippets/declarative/places_loader.qml b/src/location/doc/snippets/declarative/places_loader.qml
index d14223fd..6eea0194 100644
--- a/src/location/doc/snippets/declarative/places_loader.qml
+++ b/src/location/doc/snippets/declarative/places_loader.qml
@@ -48,7 +48,7 @@ Rectangle {
Plugin {
id: myPlugin
- name: "nokia"
+ name: "osm"
//specify plugin parameters if necessary
//PluginParameter {...}
//PluginParameter {...}
diff --git a/src/location/doc/src/places.qdoc b/src/location/doc/src/places.qdoc
index 2a853a20..edbd20f4 100644
--- a/src/location/doc/src/places.qdoc
+++ b/src/location/doc/src/places.qdoc
@@ -42,7 +42,7 @@
\section2 Plugin
A \l Plugin is an abstraction for a backend. One \l Plugin might access places from a
REST server while another may access places from a local database. The following
- instantiates a \l Plugin object by providing a name of "nokia". The \l Plugin name
+ instantiates a \l Plugin object by providing a name of "osm". The \l Plugin name
identifies which backend to choose from. Plugins may also be provided with a set of
\l {PluginParameter} {parameters}, which essentially takes the form of a set of
key-value pairs. The \l {PluginParameter} {parameters} that can be specified vary
diff --git a/src/location/doc/src/qtlocation-qml.qdoc b/src/location/doc/src/qtlocation-qml.qdoc
index a2ef8058..68b82d30 100644
--- a/src/location/doc/src/qtlocation-qml.qdoc
+++ b/src/location/doc/src/qtlocation-qml.qdoc
@@ -68,7 +68,7 @@ geocoding and routing information, which can be consumed by the application.
There may be various GeoServices plugins for various tasks with some plugins
providing more than one service. One QML \l Plugin must be created for each
required GeoService plugin. Plugins are required for maps, routing and geocoding,
-however the default plugin handles all three of these services. A plugin may
+and places, however the default plugin handles all four of these services. A plugin may
require online access or may support on-board maps and data.
\note Plugins may not provide features such as paging or relevance hints.