[SOLVED] PluginParameter doesn't work for Nokia plugin on QML's MapElement
-
Has anyone managed to pass parameters to the Nokia plugin when using the Map element?
From the "documentation":http://doc.qt.nokia.com/qt-mobility-snapshot/location-overview.html#the-nokia-plugin one can see that many interesting parameters are accessible for plugin users but I can't figure out a way to set them.
The most promising way I found was:
@
import QtMobility.location 1.2Page {
Map {
plugin: Plugin { name: "nokia"
parameters: [
PluginParameter {
name: "mapping.cache.directory"
value: "/var/tmp/sampleMap/"
},
PluginParameter {
name: "mapping.cache.size"
value: "50MB"
}
]
}
}
}
@But when I try to run this it will produce bizarre errors and will have no effect:
@
QColor::setNamedColor: Unknown color name '/var/tmp/sampleMap/'
QColor::setNamedColor: Unknown color name '50MB'
@Color!?!?!
anyone's got any ideas on how to set these parameters?
-
The parameters as you're trying to use them look correct to me. The QColor error messages seem odd, for sure. You might want to open a bug report on "Jira.":https://bugreports.qt.nokia.com/secure/Dashboard.jspa
-
Thanks for your review mlong,
I was about to open the bug report but I tried to pinpoint the problem and found out I can't replicate the bug with the version from gitorious (on the desktop) so probably it has been fixed already. It was probably something around the QML bindings (QDeclarativeGraphicsGeoMap ... ) since using the plugin from c++ works fine (has no effect but produces no errors).
The big next problem here that I was unaware of is that (from the same doc I linked before):
"Map tile caching is disabled on Maemo, Meego and Windows CE platforms. Using the parameter on these platforms will have no effect."Can someone please tell me WHY caching is disabled at Meego/Harmattan ? If you look at the source, it was deliberately taken out! The implementation is already there (Linux/Unix/Maemo6 are all the same!)
@
#if defined(Q_OS_WINCE_WM) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
#undef DISK_CACHE_ENABLED
#else
#define DISK_CACHE_ENABLED 1
#endif
@
(From qgeomappingmanagerengine_nokia.cpp )
I would understand why on WINCE but on Maemo 6? I'd say caching makes a lot more sense in a mobile device than in the desktop itself!:/
-
I would assume it's for performance or storage conservation reasons. But that's just speculation.
If you have the plugin sources, you could create your own plugin version with the disk caching enabled, I suppose (provided that any licensing implications work for your situation.)
-
Well, the plugin sources are available but changing them doesn't look like a good solution.
Either providing a "custom" plugin or overwriting the official one looks bad.
(And OVI store would certainly not like it for obvious reasons ;) )Since you mentioned the license, I gave it a check and found this:
@
...
When using the Ovi Maps API Developer Package and/or the Ovi Maps Service, You hereby agree that You will not:
...
(ix) pre-fetch, cache, or store any Ovi Maps Content except that You may store limited amounts of Ovi Maps Content for the purpose of testing your Application, if You do so temporarily, securely, and in a manner that does not permit use of the Ovi Maps Content outside of the Ovi Maps Service; or
...
@So I think that's really it.. no caching. I'll live with it..