summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/location/mapviewer/map/MiniMap.qml1
-rw-r--r--examples/location/mapviewer/mapviewer.qml34
2 files changed, 23 insertions, 12 deletions
diff --git a/examples/location/mapviewer/map/MiniMap.qml b/examples/location/mapviewer/map/MiniMap.qml
index 3ab9a572..43af605d 100644
--- a/examples/location/mapviewer/map/MiniMap.qml
+++ b/examples/location/mapviewer/map/MiniMap.qml
@@ -62,6 +62,7 @@ Rectangle{
center: map.center
plugin: map.plugin
gesture.enabled: false
+ copyrightsVisible: false
MapRectangle {
color: "#44ff0000"
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml
index eca51485..929ea4ba 100644
--- a/examples/location/mapviewer/mapviewer.qml
+++ b/examples/location/mapviewer/mapviewer.qml
@@ -63,26 +63,41 @@ ApplicationWindow {
var plugin
if (parameters && parameters.length>0)
- plugin = Qt.createQmlObject ('import QtLocation 5.3; Plugin{ name:"' + provider + '"; parameters: appWindow.parameters}', appWindow)
+ plugin = Qt.createQmlObject ('import QtLocation 5.6; Plugin{ name:"' + provider + '"; parameters: appWindow.parameters}', appWindow)
else
- plugin = Qt.createQmlObject ('import QtLocation 5.3; Plugin{ name:"' + provider + '"}', appWindow)
+ plugin = Qt.createQmlObject ('import QtLocation 5.6; Plugin{ name:"' + provider + '"}', appWindow)
+ if (minimap) {
+ minimap.destroy()
+ minimap = null
+ }
+
+ var zoomLevel = null
+ var center = null
if (map) {
+ zoomLevel = map.zoomLevel
+ center = map.center
map.destroy()
- minimap = null
}
map = mapComponent.createObject(page);
map.plugin = plugin;
- map.zoomLevel = (map.maximumZoomLevel - map.minimumZoomLevel)/2
+ if (zoomLevel != null) {
+ map.zoomLevel = zoomLevel
+ map.center = center
+ } else {
+ map.zoomLevel = (map.maximumZoomLevel - map.minimumZoomLevel)/2
+ }
+
+ map.forceActiveFocus()
}
function getPlugins()
{
- var plugin = Qt.createQmlObject ('import QtLocation 5.3; Plugin {}', appWindow)
+ var plugin = Qt.createQmlObject ('import QtLocation 5.6; Plugin {}', appWindow)
var myArray = new Array()
for (var i = 0; i<plugin.availableServiceProviders.length; i++) {
- var tempPlugin = Qt.createQmlObject ('import QtLocation 5.3; Plugin {name: "' + plugin.availableServiceProviders[i]+ '"}', appWindow)
+ var tempPlugin = Qt.createQmlObject ('import QtLocation 5.6; Plugin {name: "' + plugin.availableServiceProviders[i]+ '"}', appWindow)
if (tempPlugin.supportsMapping())
myArray.push(tempPlugin.name)
}
@@ -94,7 +109,7 @@ ApplicationWindow {
{
var parameters = new Array()
for (var prop in pluginParameters){
- var parameter = Qt.createQmlObject('import QtLocation 5.3; PluginParameter{ name: "'+ prop + '"; value: "' + pluginParameters[prop]+'"}',appWindow)
+ var parameter = Qt.createQmlObject('import QtLocation 5.6; PluginParameter{ name: "'+ prop + '"; value: "' + pluginParameters[prop]+'"}',appWindow)
parameters.push(parameter)
}
appWindow.parameters = parameters
@@ -156,11 +171,6 @@ ApplicationWindow {
providerMenu.items[i].checked = providerMenu.items[i].text === providerName
}
- if (minimap) {
- minimap.destroy()
- minimap = null
- }
-
createMap(providerName)
if (map.error === Map.NoError) {
selectMapType(map.activeMapType)