summaryrefslogtreecommitdiff
path: root/examples
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 /examples
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>
Diffstat (limited to 'examples')
-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
4 files changed, 9 insertions, 38 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 {...}