diff options
author | alex <alex.blasche@nokia.com> | 2011-07-26 18:19:57 +1000 |
---|---|---|
committer | alex <alex.blasche@nokia.com> | 2011-07-26 18:19:57 +1000 |
commit | aadb89ca155c94fe6a71e9126303e1c2eabe84aa (patch) | |
tree | b0b51ee075e1875a01f6138b856d46105b444c6a /plugins/geoservices | |
parent | 264c89815cd8afb040ec5d79846e7fca02035f7d (diff) | |
parent | 605a537607e7b383bc189c616c968e60746ca80a (diff) |
Merge branch 'maps-api'
Diffstat (limited to 'plugins/geoservices')
-rw-r--r-- | plugins/geoservices/nokia/marclanguagecodes.cpp | 291 | ||||
-rw-r--r-- | plugins/geoservices/nokia/marclanguagecodes.h | 224 | ||||
-rw-r--r-- | plugins/geoservices/nokia/nokia.pro | 11 | ||||
-rw-r--r-- | plugins/geoservices/nokia/qgeocodexmlparser.cpp | 12 | ||||
-rwxr-xr-x | plugins/geoservices/nokia/qgeomappingmanagerengine_nokia.cpp | 214 | ||||
-rw-r--r-- | plugins/geoservices/nokia/qgeomappingmanagerengine_nokia.h | 20 | ||||
-rw-r--r-- | plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp | 36 | ||||
-rw-r--r-- | plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h | 11 | ||||
-rw-r--r-- | plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp | 57 | ||||
-rw-r--r-- | plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h | 11 | ||||
-rw-r--r-- | plugins/geoservices/nokia/qgeotiledmapdata_nokia.cpp | 89 | ||||
-rw-r--r-- | plugins/geoservices/nokia/qgeotiledmapdata_nokia.h | 12 | ||||
-rw-r--r-- | plugins/geoservices/nokia/watermark.png | bin | 1542 -> 884 bytes |
13 files changed, 671 insertions, 317 deletions
diff --git a/plugins/geoservices/nokia/marclanguagecodes.cpp b/plugins/geoservices/nokia/marclanguagecodes.cpp new file mode 100644 index 0000000000..5dc5573cb0 --- /dev/null +++ b/plugins/geoservices/nokia/marclanguagecodes.cpp @@ -0,0 +1,291 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +** This file is part of the Ovi services plugin for the Maps and +** Navigation API. The use of these services, whether by use of the +** plugin or by other means, is governed by the terms and conditions +** described by the file OVI_SERVICES_TERMS_AND_CONDITIONS.txt in +** this package, located in the directory containing the Ovi services +** plugin source code. +** +****************************************************************************/ + +#include "marclanguagecodes.h" + +// MARC language codes for GeoCoding service language/locale support +// http://www.loc.gov/marc/languages/language_code.html +// Order matches QLocale::Language + +namespace { +const unsigned char marc_language_code_list[] = + "\0\0\0" // Unused + "\0\0\0" // C + "abk" // Abkhazian + "\0\0\0" // Afan + "aar" // Afar + "afr" // Afrikaans + "alb" // Albanian + "amh" // Amharic + "ara" // Arabic + "arm" // Armenian + "asm" // Assamese + "aym" // Aymara + "aze" // Azerbaijani + "bak" // Bashkir + "baq" // Basque + "ben" // Bengali + "\0\0\0" // Bhutani + "bih" // Bihari + "bis" // Bislama + "bre" // Breton + "bul" // Bulgarian + "bur" // Burmese + "bel" // Byelorussian + "khm" // Cambodian + "cat" // Catalan + "chi" // Chinese + "cos" // Corsican + "hrv" // Croatian + "cze" // Czech + "dan" // Danish + "dut" // Dutch + "eng" // English + "epo" // Esperanto + "est" // Estonian + "fao" // Faroese + "fij" // FijiLanguage + "fin" // Finnish + "fre" // French + "fry" // Frisian + "gla" // Gaelic + "glg" // Galician + "geo" // Georgian + "ger" // German + "gre" // Greek + "\0\0\0" // Greenlandic + "grn" // Guarani + "guj" // Gujarati + "hau" // Hausa + "heb" // Hebrew + "hin" // Hindi + "hun" // Hungarian + "ice" // Icelandic + "ind" // Indonesian + "ina" // Interlingua + "ile" // Interlingue + "iku" // Inuktitut + "ipk" // Inupiak + "gle" // Irish + "ita" // Italian + "jpn" // Japanese + "jav" // Javanese + "kan" // Kannada + "kas" // Kashmiri + "kaz" // Kazakh + "kin" // Kinyarwanda + "kir" // Kirghiz + "kor" // Korean + "kur" // Kurdish + "\0\0\0" // Kurundi + "lao" // Laothian + "lat" // Latin + "lav" // Latvian + "lin" // Lingala + "lit" // Lithuanian + "mac" // Macedonian + "mlg" // Malagasy + "may" // Malay + "mal" // Malayalam + "mlt" // Maltese + "mao" // Maori + "mar" // Marathi + "mol" // Moldavian + "mon" // Mongolian + "nau" // NauruLanguage + "nep" // Nepali + "nor" // Norwegian + "oci" // Occitan + "ori" // Oriya + "\0\0\0" // Pashto + "per" // Persian + "pol" // Polish + "por" // Portuguese + "pan" // Punjabi + "que" // Quechua + "roh" // RhaetoRomance + "rum" // Romanian + "rus" // Russian + "smo" // Samoan + "sag" // Sangho + "san" // Sanskrit + "srp" // Serbian + "\0\0\0" // SerboCroatian + "\0\0\0" // Sesotho + "\0\0\0" // Setswana + "sna" // Shona + "snd" // Sindhi + "\0\0\0" // Singhalese + "\0\0\0" // Siswati + "slo" // Slovak + "slv" // Slovenian + "som" // Somali + "spa" // Spanish + "sun" // Sundanese + "swa" // Swahili + "swe" // Swedish + "tgl" // Tagalog + "tgk" // Tajik + "tam" // Tamil + "tat" // Tatar + "tel" // Telugu + "tha" // Thai + "tib" // Tibetan + "tir" // Tigrinya + "tog" // TongaLanguage + "tso" // Tsonga + "tur" // Turkish + "tuk" // Turkmen + "twi" // Twi + "uig" // Uigur + "ukr" // Ukrainian + "urd" // Urdu + "uzb" // Uzbek + "vie" // Vietnamese + "vol" // Volapuk + "wel" // Welsh + "wol" // Wolof + "xho" // Xhosa + "yid" // Yiddish + "yor" // Yoruba + "zha" // Zhuang + "zul" // Zulu + "nno" // NorwegianNynorsk + "bos" // Bosnian + "div" // Divehi + "glv" // Manx + "cor" // Cornish + "aka" // Akan + "kok" // Konkani + "gaa" // Ga + "ibo" // Igbo + "kam" // Kamba + "syc" // Syriac + "\0\0\0" // Blin + "\0\0\0" // Geez + "\0\0\0" // Koro + "sid" // Sidamo + "\0\0\0" // Atsam + "tig" // Tigre + "\0\0\0" // Jju + "fur" // Friulian + "ven" // Venda + "ewe" // Ewe + "\0\0\0" // Walamo + "haw" // Hawaiian + "\0\0\0" // Tyap + "\0\0\0" // Chewa + "fil" // Filipino + "gsw" // SwissGerman + "iii" // SichuanYi + "kpe" // Kpelle + "nds" // LowGerman + "nbl" // SouthNdebele + "nso" // NorthernSotho + "sme" // NorthernSami + "\0\0\0" // Taroko + "\0\0\0" // Gusii + "\0\0\0" // Taita + "ful" // Fulah + "kik" // Kikuyu + "\0\0\0" // Samburu + "\0\0\0" // Sena + "nde" // NorthNdebele + "\0\0\0" // Rombo + "\0\0\0" // Tachelhit + "kab" // Kabyle + "nyn" // Nyankole + "\0\0\0" // Bena + "\0\0\0" // Vunjo + "bam" // Bambara + "\0\0\0" // Embu + "chr" // Cherokee + "\0\0\0" // Morisyen + "\0\0\0" // Makonde + "\0\0\0" // Langi + "lug" // Ganda + "bem" // Bemba + "\0\0\0" // Kabuverdianu + "\0\0\0" // Meru + "\0\0\0" // Kalenjin + "\0\0\0" // Nama + "\0\0\0" // Machame + "\0\0\0" // Colognian + "mas" // Masai + "\0\0\0" // Soga + "\0\0\0" // Luyia + "\0\0\0" // Asu + "\0\0\0" // Teso + "\0\0\0" // Saho + "\0\0\0" // KoyraChiini + "\0\0\0" // Rwa + "luo" // Luo + "\0\0\0" // Chiga + "\0\0\0" // CentralMoroccoTamazight + "\0\0\0" // KoyraboroSenni + "\0\0\0" // Shambala + ; +} + +QString languageToMarc(QLocale::Language language) +{ + uint offset = 3 * (uint(language)); + if (language == QLocale::C || offset + 3 > sizeof(marc_language_code_list)) + return QLatin1String("eng"); + + const unsigned char *c = marc_language_code_list + offset; + if (c[0] == 0) + return QLatin1String("eng"); + + QString code(3, Qt::Uninitialized); + code[0] = ushort(c[0]); + code[1] = ushort(c[1]); + code[2] = ushort(c[2]); + + return code; +} diff --git a/plugins/geoservices/nokia/marclanguagecodes.h b/plugins/geoservices/nokia/marclanguagecodes.h index 5f2accac30..aece2273c8 100644 --- a/plugins/geoservices/nokia/marclanguagecodes.h +++ b/plugins/geoservices/nokia/marclanguagecodes.h @@ -49,227 +49,9 @@ #ifndef MARCLANGUAGECODES_H_ #define MARCLANGUAGECODES_H_ -// MARC language codes for GeoCoding service language/locale support -// http://www.loc.gov/marc/languages/language_code.html -// Order matches QLocale::Language - -static const unsigned char marc_language_code_list[] = - "\0\0\0" // Unused - "\0\0\0" // C - "abk" // Abkhazian - "\0\0\0" // Afan - "aar" // Afar - "afr" // Afrikaans - "alb" // Albanian - "amh" // Amharic - "ara" // Arabic - "arm" // Armenian - "asm" // Assamese - "aym" // Aymara - "aze" // Azerbaijani - "bak" // Bashkir - "baq" // Basque - "ben" // Bengali - "\0\0\0" // Bhutani - "bih" // Bihari - "bis" // Bislama - "bre" // Breton - "bul" // Bulgarian - "bur" // Burmese - "bel" // Byelorussian - "khm" // Cambodian - "cat" // Catalan - "chi" // Chinese - "cos" // Corsican - "hrv" // Croatian - "cze" // Czech - "dan" // Danish - "dut" // Dutch - "eng" // English - "epo" // Esperanto - "est" // Estonian - "fao" // Faroese - "fij" // FijiLanguage - "fin" // Finnish - "fre" // French - "fry" // Frisian - "gla" // Gaelic - "glg" // Galician - "geo" // Georgian - "ger" // German - "gre" // Greek - "\0\0\0" // Greenlandic - "grn" // Guarani - "guj" // Gujarati - "hau" // Hausa - "heb" // Hebrew - "hin" // Hindi - "hun" // Hungarian - "ice" // Icelandic - "ind" // Indonesian - "ina" // Interlingua - "ile" // Interlingue - "iku" // Inuktitut - "ipk" // Inupiak - "gle" // Irish - "ita" // Italian - "jpn" // Japanese - "jav" // Javanese - "kan" // Kannada - "kas" // Kashmiri - "kaz" // Kazakh - "kin" // Kinyarwanda - "kir" // Kirghiz - "kor" // Korean - "kur" // Kurdish - "\0\0\0" // Kurundi - "lao" // Laothian - "lat" // Latin - "lav" // Latvian - "lin" // Lingala - "lit" // Lithuanian - "mac" // Macedonian - "mlg" // Malagasy - "may" // Malay - "mal" // Malayalam - "mlt" // Maltese - "mao" // Maori - "mar" // Marathi - "mol" // Moldavian - "mon" // Mongolian - "nau" // NauruLanguage - "nep" // Nepali - "nor" // Norwegian - "oci" // Occitan - "ori" // Oriya - "\0\0\0" // Pashto - "per" // Persian - "pol" // Polish - "por" // Portuguese - "pan" // Punjabi - "que" // Quechua - "roh" // RhaetoRomance - "rum" // Romanian - "rus" // Russian - "smo" // Samoan - "sag" // Sangho - "san" // Sanskrit - "srp" // Serbian - "\0\0\0" // SerboCroatian - "\0\0\0" // Sesotho - "\0\0\0" // Setswana - "sna" // Shona - "snd" // Sindhi - "\0\0\0" // Singhalese - "\0\0\0" // Siswati - "slo" // Slovak - "slv" // Slovenian - "som" // Somali - "spa" // Spanish - "sun" // Sundanese - "swa" // Swahili - "swe" // Swedish - "tgl" // Tagalog - "tgk" // Tajik - "tam" // Tamil - "tat" // Tatar - "tel" // Telugu - "tha" // Thai - "tib" // Tibetan - "tir" // Tigrinya - "tog" // TongaLanguage - "tso" // Tsonga - "tur" // Turkish - "tuk" // Turkmen - "twi" // Twi - "uig" // Uigur - "ukr" // Ukrainian - "urd" // Urdu - "uzb" // Uzbek - "vie" // Vietnamese - "vol" // Volapuk - "wel" // Welsh - "wol" // Wolof - "xho" // Xhosa - "yid" // Yiddish - "yor" // Yoruba - "zha" // Zhuang - "zul" // Zulu - "nno" // NorwegianNynorsk - "bos" // Bosnian - "div" // Divehi - "glv" // Manx - "cor" // Cornish - "aka" // Akan - "kok" // Konkani - "gaa" // Ga - "ibo" // Igbo - "kam" // Kamba - "syc" // Syriac - "\0\0\0" // Blin - "\0\0\0" // Geez - "\0\0\0" // Koro - "sid" // Sidamo - "\0\0\0" // Atsam - "tig" // Tigre - "\0\0\0" // Jju - "fur" // Friulian - "ven" // Venda - "ewe" // Ewe - "\0\0\0" // Walamo - "haw" // Hawaiian - "\0\0\0" // Tyap - "\0\0\0" // Chewa - "fil" // Filipino - "gsw" // SwissGerman - "iii" // SichuanYi - "kpe" // Kpelle - "nds" // LowGerman - "nbl" // SouthNdebele - "nso" // NorthernSotho - "sme" // NorthernSami - "\0\0\0" // Taroko - "\0\0\0" // Gusii - "\0\0\0" // Taita - "ful" // Fulah - "kik" // Kikuyu - "\0\0\0" // Samburu - "\0\0\0" // Sena - "nde" // NorthNdebele - "\0\0\0" // Rombo - "\0\0\0" // Tachelhit - "kab" // Kabyle - "nyn" // Nyankole - "\0\0\0" // Bena - "\0\0\0" // Vunjo - "bam" // Bambara - "\0\0\0" // Embu - "chr" // Cherokee - "\0\0\0" // Morisyen - "\0\0\0" // Makonde - "\0\0\0" // Langi - "lug" // Ganda - "bem" // Bemba - "\0\0\0" // Kabuverdianu - "\0\0\0" // Meru - "\0\0\0" // Kalenjin - "\0\0\0" // Nama - "\0\0\0" // Machame - "\0\0\0" // Colognian - "mas" // Masai - "\0\0\0" // Soga - "\0\0\0" // Luyia - "\0\0\0" // Asu - "\0\0\0" // Teso - "\0\0\0" // Saho - "\0\0\0" // KoyraChiini - "\0\0\0" // Rwa - "luo" // Luo - "\0\0\0" // Chiga - "\0\0\0" // CentralMoroccoTamazight - "\0\0\0" // KoyraboroSenni - "\0\0\0" // Shambala - ; +#include <QString> +#include <QLocale> +QString languageToMarc(QLocale::Language language); #endif /* MARCLANGUAGECODES_H_ */ diff --git a/plugins/geoservices/nokia/nokia.pro b/plugins/geoservices/nokia/nokia.pro index 7ad8f17b96..1b2e050e0b 100644 --- a/plugins/geoservices/nokia/nokia.pro +++ b/plugins/geoservices/nokia/nokia.pro @@ -6,6 +6,7 @@ PLUGIN_TYPE=geoservices include(../../../common.pri) QT += network +QT += xml CONFIG += mobility MOBILITY = location @@ -33,7 +34,9 @@ SOURCES += \ qgeosearchmanagerengine_nokia.cpp \ qgeosearchreply_nokia.cpp \ qgeoserviceproviderplugin_nokia.cpp \ - qgeotiledmapdata_nokia.cpp + qgeotiledmapdata_nokia.cpp\ + marclanguagecodes.cpp + INCLUDEPATH += $$SOURCE_DIR/src/location \ $$SOURCE_DIR/src/location/maps \ @@ -50,3 +53,9 @@ symbian { } RESOURCES += resource.qrc + +symbian|maemo5|maemo6:{ + message("Building for mobile platform...") + MOBILITY +=systeminfo + DEFINES +=USE_CHINA_NETWORK_REGISTRATION +} diff --git a/plugins/geoservices/nokia/qgeocodexmlparser.cpp b/plugins/geoservices/nokia/qgeocodexmlparser.cpp index 900ee47994..24b90dda75 100644 --- a/plugins/geoservices/nokia/qgeocodexmlparser.cpp +++ b/plugins/geoservices/nokia/qgeocodexmlparser.cpp @@ -456,11 +456,11 @@ bool QGeoCodeXmlParser::parseBoundingBox(QGeoBoundingBox *bounds) QGeoCoordinate nw; - if (m_reader->name() == "northWest") { - if (!parseCoordinate(&nw, "northWest")) + if (m_reader->name() == "topLeft") { + if (!parseCoordinate(&nw, "topLeft")) return false; } else { - m_reader->raiseError(QString("The element \"boundingBox\" expected this child element to be named \"northWest\" (found an element named \"%1\")").arg(m_reader->name().toString())); + m_reader->raiseError(QString("The element \"boundingBox\" expected this child element to be named \"topLeft\" (found an element named \"%1\")").arg(m_reader->name().toString())); return false; } @@ -471,11 +471,11 @@ bool QGeoCodeXmlParser::parseBoundingBox(QGeoBoundingBox *bounds) QGeoCoordinate se; - if (m_reader->name() == "southEast") { - if (!parseCoordinate(&se, "southEast")) + if (m_reader->name() == "bottomRight") { + if (!parseCoordinate(&se, "bottomRight")) return false; } else { - m_reader->raiseError(QString("The element \"boundingBox\" expected this child element to be named \"southEast\" (found an element named \"%1\")").arg(m_reader->name().toString())); + m_reader->raiseError(QString("The element \"boundingBox\" expected this child element to be named \"bottomRight\" (found an element named \"%1\")").arg(m_reader->name().toString())); return false; } diff --git a/plugins/geoservices/nokia/qgeomappingmanagerengine_nokia.cpp b/plugins/geoservices/nokia/qgeomappingmanagerengine_nokia.cpp index 80b907c263..62d170d0ef 100755 --- a/plugins/geoservices/nokia/qgeomappingmanagerengine_nokia.cpp +++ b/plugins/geoservices/nokia/qgeomappingmanagerengine_nokia.cpp @@ -49,6 +49,7 @@ #include "qgeomappingmanagerengine_nokia.h" #include "qgeomapreply_nokia.h" #include "qgeotiledmapdata_nokia.h" +#include "marclanguagecodes.h" #include <qgeotiledmaprequest.h> @@ -58,6 +59,11 @@ #include <QSize> #include <QDir> #include <QUrl> +#include <QEventLoop> +#include <QDomDocument> +#include <QScopedPointer> + +#include <algorithm> #define LARGE_TILE_DIMENSION 256 @@ -100,26 +106,100 @@ QChar QGeoMappingManagerEngineNokia::findFirstInternalFlashDrive() } #endif //Q_OS_SYMBIAN +namespace +{ + void getMapTypes(const QDomDocument &doc, QList<QGraphicsGeoMap::MapType> &mapTypes) + { + typedef std::map<QString, QGraphicsGeoMap::MapType> MapTypeRegistry; + static MapTypeRegistry registeredTypes; + if (registeredTypes.empty()) + { + + registeredTypes.insert(std::make_pair("terrain.day", QGraphicsGeoMap::TerrainMap)); + registeredTypes.insert(std::make_pair("normal.day", QGraphicsGeoMap::StreetMap)); + registeredTypes.insert(std::make_pair("satellite.day", QGraphicsGeoMap::SatelliteMapDay)); + + //registeredTypes.insert(std::make_pair("hybrid.day", QGraphicsGeoMap::)); + //registeredTypes.insert(std::make_pair("normal.day.transit", QGraphicsGeoMap::)); + //registeredTypes.insert(std::make_pair("normal.day.grey", QGraphicsGeoMap::)); + } + + QDomElement response = doc.firstChildElement("response"); + QDomNodeList schemes = response.firstChildElement("schemes").childNodes(); + for (int i = 0; i < schemes.count(); ++i) + { + QString id = schemes.at(i).toElement().attribute("id"); + MapTypeRegistry::const_iterator found = registeredTypes.find(id); + if (found != registeredTypes.end()) + { + mapTypes << found->second; + } + } + + if (mapTypes.empty()) + { + mapTypes << QGraphicsGeoMap::NoMap; + } + } + + void getResolutions(const QDomDocument &doc, QList<QSize> &sizes) + { + QDomElement response = doc.firstChildElement("response"); + QDomNodeList resolutions = response.firstChildElement("resolutions").childNodes(); + + for (int i = 0; i < resolutions.count(); ++i) + { + QDomElement size = resolutions.at(i).toElement(); + sizes << QSize(size.attribute("width").toInt(), size.attribute("height").toInt()); + } + } + + void getZoomLevels(const QDomDocument &doc, double &minZoomLevel, double &maxZoomLevel) + { + QDomElement response = doc.firstChildElement("response"); + + QDomElement zoomLevels = response.firstChildElement("zoomLevels"); + minZoomLevel = zoomLevels.attribute("min").toDouble(); + maxZoomLevel = zoomLevels.attribute("max").toDouble(); + } + + bool less(const QSize &first, const QSize &second) + { + return first.width() * first.height() < second.width() * second.height(); + } + + int GetLogoPosition(QString positionName) + { + typedef std::map<QString, int> KnownPositionsType; + static KnownPositionsType knownPositions; + if (knownPositions.empty()) + { + knownPositions.insert(std::make_pair("top.left", TopLeft)); + knownPositions.insert(std::make_pair("left.top", TopLeft)); + knownPositions.insert(std::make_pair("top.right", ShiftedRight)); + knownPositions.insert(std::make_pair("right.top", ShiftedRight)); + knownPositions.insert(std::make_pair("bottom.left", ShiftedDown)); + knownPositions.insert(std::make_pair("left.bottom", ShiftedDown)); + knownPositions.insert(std::make_pair("bottom.right", ShiftedRight | ShiftedDown)); + knownPositions.insert(std::make_pair("right.bottom", ShiftedRight | ShiftedDown)); + } + + KnownPositionsType::const_iterator found = knownPositions.find(positionName); + return found == knownPositions.end() ? ShiftedDown : found->second; + } +} + QGeoMappingManagerEngineNokia::QGeoMappingManagerEngineNokia(const QMap<QString, QVariant> ¶meters, QGeoServiceProvider::Error *error, QString *errorString) : QGeoTiledMappingManagerEngine(parameters), m_cache(0), m_host("maptile.maps.svc.ovi.com"), m_token(QGeoServiceProviderFactoryNokia::defaultToken), - m_referer(QGeoServiceProviderFactoryNokia::defaultReferer) + m_referer(QGeoServiceProviderFactoryNokia::defaultReferer), + m_logoPosition(ShiftedDown) { Q_UNUSED(error) Q_UNUSED(errorString) - setTileSize(QSize(256, 256)); - setMinimumZoomLevel(0.0); - setMaximumZoomLevel(18.0); - - QList<QGraphicsGeoMap::MapType> types; - types << QGraphicsGeoMap::StreetMap; - types << QGraphicsGeoMap::SatelliteMapDay; - types << QGraphicsGeoMap::TerrainMap; - setSupportedMapTypes(types); - QList<QGraphicsGeoMap::ConnectivityMode> modes; modes << QGraphicsGeoMap::OnlineMode; setSupportedConnectivityModes(modes); @@ -156,6 +236,20 @@ QGeoMappingManagerEngineNokia::QGeoMappingManagerEngineNokia(const QMap<QString, else if (parameters.contains("token")) { m_token = parameters.value("token").toString(); } + + if (parameters.contains("logo.position")) + { + m_logoPosition = GetLogoPosition(parameters.value("logo.position").toString()); + } + + if (parameters.contains("mapping.app_id")) { + m_applicationId = parameters.value("mapping.app_id").toString(); + } + else if (parameters.contains("app_id")) { + m_applicationId = parameters.value("app_id").toString(); + } + + setupServiceInfo(); #ifdef DISK_CACHE_ENABLED QString cacheDir; if (parameters.contains("mapping.cache.directory")) @@ -193,6 +287,11 @@ QGeoMappingManagerEngineNokia::QGeoMappingManagerEngineNokia(const QMap<QString, m_networkManager->setCache(m_cache); } #endif + +#ifdef USE_CHINA_NETWORK_REGISTRATION + connect(&m_networkInfo, SIGNAL(currentMobileCountryCodeChanged(const QString&)), SLOT(currentMobileCountryCodeChanged(const QString&))); + currentMobileCountryCodeChanged(m_networkInfo.currentMobileCountryCode()); +#endif } QGeoMappingManagerEngineNokia::~QGeoMappingManagerEngineNokia() {} @@ -234,14 +333,19 @@ QString QGeoMappingManagerEngineNokia::getRequestString(const QGeoTiledMapReques { const int maxDomains = 11; // TODO: hmmm.... const char subdomain = 'a' + (request.row() + request.column()) % maxDomains; // a...k + static const QString http("http://"); static const QString path("/maptiler/maptile/newest/"); static const QChar dot('.'); static const QChar slash('/'); QString requestString = http; - requestString += subdomain; - requestString += dot; + if ("maptile.maps.svc.ovi.com" == m_host) // TODO: temporay solution while china DNS does not work + { + requestString += subdomain; + requestString += dot; + } + requestString += m_host; requestString += path; requestString += mapTypeToStr(request.mapType()); @@ -260,19 +364,25 @@ QString QGeoMappingManagerEngineNokia::getRequestString(const QGeoTiledMapReques //#endif requestString += slashpng; + requestString += "?lg="; + requestString += languageToMarc(locale().language()); + if (!m_token.isEmpty()) { - requestString += "?token="; + requestString += "&token="; requestString += m_token; + } - if (!m_referer.isEmpty()) { - requestString += "&referer="; - requestString += m_referer; - } - } else if (!m_referer.isEmpty()) { - requestString += "?referer="; + if (!m_referer.isEmpty()) { + + requestString += "&referer="; requestString += m_referer; } + if (!m_applicationId.isEmpty()) { + requestString += "&app_id="; + requestString += m_applicationId; + } + return requestString; } @@ -300,3 +410,67 @@ QString QGeoMappingManagerEngineNokia::mapTypeToStr(QGraphicsGeoMap::MapType typ return "normal.day"; } +void QGeoMappingManagerEngineNokia::setupServiceInfo() +{ + QSize maxResolution(256, 256); + double minZoomLevel(0.0), maxZoomLevel(18.0); + QList<QGraphicsGeoMap::MapType> types; + types << QGraphicsGeoMap::StreetMap; + types << QGraphicsGeoMap::SatelliteMapDay; + types << QGraphicsGeoMap::TerrainMap; + + QString path = "http://"; + path += m_host; + path += "/maptiler/info"; + + QScopedPointer<QNetworkReply> reply(m_networkManager->get(QNetworkRequest((QUrl(path))))); + + QEventLoop loop; + connect(reply.data(), SIGNAL(finished()), &loop, SLOT(quit())); + connect(reply.data(), SIGNAL(error(QNetworkReply::NetworkError)), &loop, SLOT(quit())); + loop.exec(); + + if (QNetworkReply::NoError == reply->error()) + { + QDomDocument doc; + if (doc.setContent(reply->readAll())) + { + getZoomLevels(doc, minZoomLevel, maxZoomLevel); + + types.clear(); + getMapTypes(doc, types); + + QList<QSize> resolutions; + getResolutions(doc, resolutions); + QList<QSize>::const_iterator found = std::max_element(resolutions.begin(), resolutions.end(), &less); + if (found != resolutions.end()) + { + maxResolution = *found; + } + } + } + + setTileSize(maxResolution); + setMinimumZoomLevel(minZoomLevel); + setMaximumZoomLevel(maxZoomLevel); + setSupportedMapTypes(types); +} + +int QGeoMappingManagerEngineNokia::logoPosition() const +{ + return m_logoPosition; +} + +const QString & QGeoMappingManagerEngineNokia::host() const +{ + return m_host; +} + +void QGeoMappingManagerEngineNokia::currentMobileCountryCodeChanged(const QString & mcc) +{ + if (mcc == "460" || mcc == "461") { + m_host ="maptile.maps.svc.nokia.com.cn"; + } else { + m_host ="maptile.maps.svc.ovi.com"; + } +} diff --git a/plugins/geoservices/nokia/qgeomappingmanagerengine_nokia.h b/plugins/geoservices/nokia/qgeomappingmanagerengine_nokia.h index 89f145dc55..9b599b41ec 100644 --- a/plugins/geoservices/nokia/qgeomappingmanagerengine_nokia.h +++ b/plugins/geoservices/nokia/qgeomappingmanagerengine_nokia.h @@ -57,6 +57,10 @@ class QNetworkAccessManager; class QNetworkDiskCache; +#ifdef USE_CHINA_NETWORK_REGISTRATION +#include "../../../src/systeminfo/qsystemnetworkinfo.h" +#endif + QTM_USE_NAMESPACE class QGeoMappingManagerEngineNokia : public QGeoTiledMappingManagerEngine @@ -71,6 +75,9 @@ public: QGeoMapData* createMapData(); QGeoTiledMapReply* getTileImage(const QGeoTiledMapRequest &request); + int logoPosition() const; + const QString & host() const; + private: Q_DISABLE_COPY(QGeoMappingManagerEngineNokia) @@ -78,15 +85,28 @@ private: static QString sizeToStr(const QSize &size); static QString mapTypeToStr(QGraphicsGeoMap::MapType type); + + void setupServiceInfo(); + #if defined(Q_OS_SYMBIAN) QChar findFirstInternalFlashDrive(); #endif //Q_OS_SYMBIAN +private slots: + void currentMobileCountryCodeChanged(const QString& mcc); + +private: QNetworkAccessManager *m_networkManager; QNetworkDiskCache *m_cache; QString m_host; QString m_token; QString m_referer; + QString m_applicationId; + int m_logoPosition; + +#ifdef USE_CHINA_NETWORK_REGISTRATION + QSystemNetworkInfo m_networkInfo; +#endif }; #endif diff --git a/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp b/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp index 4590f38b25..4f6d9bd9cf 100644 --- a/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp +++ b/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp @@ -58,7 +58,8 @@ QGeoRoutingManagerEngineNokia::QGeoRoutingManagerEngineNokia(const QMap<QString, : QGeoRoutingManagerEngine(parameters), m_host("prd.lbsp.navteq.com"), m_token(QGeoServiceProviderFactoryNokia::defaultToken), - m_referer(QGeoServiceProviderFactoryNokia::defaultReferer) + m_referer(QGeoServiceProviderFactoryNokia::defaultReferer), + m_serviceDisabled(false) { m_networkManager = new QNetworkAccessManager(this); @@ -93,6 +94,13 @@ QGeoRoutingManagerEngineNokia::QGeoRoutingManagerEngineNokia(const QMap<QString, m_token = parameters.value("token").toString(); } + if (parameters.contains("routing.app_id")) { + m_applicationId = parameters.value("routing.app_id").toString(); + } + else if (parameters.contains("app_id")) { + m_applicationId = parameters.value("app_id").toString(); + } + setSupportsRouteUpdates(true); setSupportsAlternativeRoutes(true); setSupportsExcludeAreas(true); @@ -128,12 +136,16 @@ QGeoRoutingManagerEngineNokia::QGeoRoutingManagerEngineNokia(const QMap<QString, QGeoRouteRequest::SegmentDetails segmentDetails; segmentDetails |= QGeoRouteRequest::BasicSegmentData; setSupportedSegmentDetails(segmentDetails); - if (error) *error = QGeoServiceProvider::NoError; if (errorString) *errorString = ""; +#ifdef USE_CHINA_NETWORK_REGISTRATION + connect(&m_networkInfo, SIGNAL(currentMobileCountryCodeChanged(const QString&)), SLOT(currentMobileCountryCodeChanged(const QString&))); + currentMobileCountryCodeChanged(m_networkInfo.currentMobileCountryCode()); +#endif + } QGeoRoutingManagerEngineNokia::~QGeoRoutingManagerEngineNokia() {} @@ -142,7 +154,7 @@ QGeoRouteReply* QGeoRoutingManagerEngineNokia::calculateRoute(const QGeoRouteReq { QString reqString = calculateRouteRequestString(request); - if (reqString.isEmpty()) { + if (reqString.isEmpty() || m_serviceDisabled) { QGeoRouteReply *reply = new QGeoRouteReply(QGeoRouteReply::UnsupportedOptionError, "The given route request options are not supported by this service provider.", this); emit error(reply, reply->error(), reply->errorString()); return reply; @@ -168,7 +180,7 @@ QGeoRouteReply* QGeoRoutingManagerEngineNokia::updateRoute(const QGeoRoute &rout { QString reqString = updateRouteRequestString(route, position); - if (reqString.isEmpty()) { + if (reqString.isEmpty() || m_serviceDisabled) { QGeoRouteReply *reply = new QGeoRouteReply(QGeoRouteReply::UnsupportedOptionError, "The given route request options are not supported by this service provider.", this); emit error(reply, reply->error(), reply->errorString()); return reply; @@ -365,6 +377,7 @@ QString QGeoRoutingManagerEngineNokia::modesRequestString(const QGeoRouteRequest if (featureStrings.count()) requestString += ";" + featureStrings.join(","); } + return requestString; } @@ -431,6 +444,11 @@ QString QGeoRoutingManagerEngineNokia::routeRequestString(const QGeoRouteRequest requestString += "&language="; requestString += locale().name(); + if (!m_applicationId.isEmpty()) { + requestString += "&app_id="; + requestString += m_applicationId; + } + return requestString; } @@ -475,3 +493,13 @@ void QGeoRoutingManagerEngineNokia::routeError(QGeoRouteReply::Error error, cons emit this->error(reply, error, errorString); } + +void QGeoRoutingManagerEngineNokia::currentMobileCountryCodeChanged(const QString & mcc) +{ + if(mcc == "460" || mcc == "461"){ + m_serviceDisabled=true; + } + else{ + m_serviceDisabled=false; + } +} diff --git a/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h b/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h index f0e4a1734b..85b9ae0199 100644 --- a/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h +++ b/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.h @@ -54,6 +54,9 @@ #include <qgeoserviceprovider.h> #include <qgeoroutingmanagerengine.h> #include <QNetworkAccessManager> +#ifdef USE_CHINA_NETWORK_REGISTRATION +#include "../../../src/systeminfo/qsystemnetworkinfo.h" +#endif QTM_USE_NAMESPACE @@ -72,6 +75,7 @@ public: private slots: void routeFinished(); void routeError(QGeoRouteReply::Error error, const QString &errorString); + void currentMobileCountryCodeChanged(const QString& mcc); private: QString calculateRouteRequestString(const QGeoRouteRequest &request); @@ -87,6 +91,13 @@ private: QString m_host; QString m_token; QString m_referer; + QString m_applicationId; + + bool m_serviceDisabled; +#ifdef USE_CHINA_NETWORK_REGISTRATION + QSystemNetworkInfo m_networkInfo; +#endif + }; #endif diff --git a/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp b/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp index 388283befa..135aadcfea 100644 --- a/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp +++ b/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp @@ -95,6 +95,12 @@ QGeoSearchManagerEngineNokia::QGeoSearchManagerEngineNokia(const QMap<QString, Q m_token = parameters.value("token").toString(); } + if (parameters.contains("places.app_id")) { + m_applicationId = parameters.value("places.app_id").toString(); + } + else if (parameters.contains("app_id")) { + m_applicationId = parameters.value("app_id").toString(); + } setSupportsGeocoding(true); setSupportsReverseGeocoding(true); @@ -108,6 +114,11 @@ QGeoSearchManagerEngineNokia::QGeoSearchManagerEngineNokia(const QMap<QString, Q if (errorString) *errorString = ""; +#ifdef USE_CHINA_NETWORK_REGISTRATION + connect(&m_networkInfo, SIGNAL(currentMobileCountryCodeChanged(const QString&)), SLOT(currentMobileCountryCodeChanged(const QString&))); + currentMobileCountryCodeChanged(m_networkInfo.currentMobileCountryCode()); +#endif + } QGeoSearchManagerEngineNokia::~QGeoSearchManagerEngineNokia() {} @@ -123,11 +134,16 @@ QGeoSearchReply* QGeoSearchManagerEngineNokia::geocode(const QGeoAddress &addres QString requestString = "http://"; requestString += m_host; - requestString += "/geocoder/gc/1.0?referer=" + m_referer; + requestString += "/geocoder/gc/2.0?referer=" + m_referer; if (!m_token.isNull()) requestString += "&token=" + m_token; + if (!m_applicationId.isEmpty()) { + requestString += "&app_id="; + requestString += m_applicationId; + } + requestString += "&lg="; requestString += languageToMarc(locale().language()); @@ -152,7 +168,7 @@ QGeoSearchReply* QGeoSearchManagerEngineNokia::geocode(const QGeoAddress &addres if (!address.street().isEmpty()) { requestString += "&street="; requestString += address.street(); - } + } // TODO? // street number has been removed from QGeoAddress @@ -179,9 +195,15 @@ QGeoSearchReply* QGeoSearchManagerEngineNokia::reverseGeocode(const QGeoCoordina QString requestString = "http://"; requestString += m_host; - requestString += "/geocoder/rgc/1.0?referer=" + m_referer; + requestString += "/geocoder/rgc/2.0?referer=" + m_referer; if (!m_token.isNull()) requestString += "&token=" + m_token; + + if (!m_applicationId.isEmpty()) { + requestString += "&app_id="; + requestString += m_applicationId; + } + requestString += "&long="; requestString += trimDouble(coordinate.longitude()); requestString += "&lat="; @@ -211,11 +233,16 @@ QGeoSearchReply* QGeoSearchManagerEngineNokia::search(const QString &searchStrin QString requestString = "http://"; requestString += m_host; - requestString += "/geocoder/gc/1.0?referer=" + m_referer; + requestString += "/geocoder/gc/2.0?referer=" + m_referer; if (!m_token.isNull()) requestString += "&token=" + m_token; + if (!m_applicationId.isEmpty()) { + requestString += "&app_id="; + requestString += m_applicationId; + } + requestString += "&lg="; requestString += languageToMarc(locale().language()); @@ -298,20 +325,12 @@ void QGeoSearchManagerEngineNokia::placesError(QGeoSearchReply::Error error, con emit this->error(reply, error, errorString); } -QString QGeoSearchManagerEngineNokia::languageToMarc(QLocale::Language language) +void QGeoSearchManagerEngineNokia::currentMobileCountryCodeChanged(const QString & mcc) { - uint offset = 3 * (uint(language)); - if (language == QLocale::C || offset + 3 > sizeof(marc_language_code_list)) - return QLatin1String("eng"); - - const unsigned char *c = marc_language_code_list + offset; - if (c[0] == 0) - return QLatin1String("eng"); - - QString code(3, Qt::Uninitialized); - code[0] = ushort(c[0]); - code[1] = ushort(c[1]); - code[2] = ushort(c[2]); - - return code; + if(mcc == "460" || mcc == "461"){ + m_host="pr.geo.maps.svc.nokia.com.cn"; + } + else{ + m_host ="loc.desktop.maps.svc.ovi.com"; + } } diff --git a/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h b/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h index f0b112e168..d686eb5f07 100644 --- a/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h +++ b/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h @@ -57,6 +57,10 @@ #include <QNetworkAccessManager> #include <QLocale> +#ifdef USE_CHINA_NETWORK_REGISTRATION +#include "../../../src/systeminfo/qsystemnetworkinfo.h" +#endif + QTM_USE_NAMESPACE @@ -83,16 +87,21 @@ public: private slots: void placesFinished(); void placesError(QGeoSearchReply::Error error, const QString &errorString); + void currentMobileCountryCodeChanged(const QString& mcc); private: static QString trimDouble(double degree, int decimalDigits = 10); QGeoSearchReply* search(QString requestString, QGeoBoundingArea *bounds, int limit = -1, int offset = 0); - QString languageToMarc(QLocale::Language language); QNetworkAccessManager *m_networkManager; QString m_host; QString m_token; QString m_referer; + QString m_applicationId; + +#ifdef USE_CHINA_NETWORK_REGISTRATION + QSystemNetworkInfo m_networkInfo; +#endif }; #endif diff --git a/plugins/geoservices/nokia/qgeotiledmapdata_nokia.cpp b/plugins/geoservices/nokia/qgeotiledmapdata_nokia.cpp index 9a3d06be06..77cc528bac 100644 --- a/plugins/geoservices/nokia/qgeotiledmapdata_nokia.cpp +++ b/plugins/geoservices/nokia/qgeotiledmapdata_nokia.cpp @@ -57,18 +57,37 @@ QTM_USE_NAMESPACE +namespace +{ + void AdjustLogo(const QRect &windowRect, QRect &logoRect, int position) + { + logoRect.moveTo(windowRect.topLeft()); + if (position & ShiftedRight) + { + logoRect.moveRight(windowRect.x() + windowRect.width()); + } + + if (position & ShiftedDown) + { + logoRect.moveBottom(windowRect.y() + windowRect.height()); + } + } +} + /*! Constructs a new tiled map data object, which stores the map data required by \a geoMap and makes use of the functionality provided by \a engine. */ QGeoTiledMapDataNokia::QGeoTiledMapDataNokia(QGeoMappingManagerEngineNokia *engine) : QGeoTiledMapData(engine), - watermark(":/images/watermark.png") + watermark(":/images/watermark.png"), + m_logoPosition(engine->logoPosition()) { m_networkManager = new QNetworkAccessManager(this); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), SLOT(copyrightReplyFinished(QNetworkReply*))); - m_networkManager->get(QNetworkRequest(QUrl("http://maptile.maps.svc.ovi.com/maptiler/v2/copyright/newest"))); + QString copirightUrl = "http://" + engine->host() + "/maptiler/v2/copyright/newest"; + m_networkManager->get(QNetworkRequest(QUrl(copirightUrl))); } QGeoTiledMapDataNokia::~QGeoTiledMapDataNokia() @@ -185,52 +204,40 @@ QString QGeoTiledMapDataNokia::getViewCopyright() /*! \reimp */ -void QGeoTiledMapDataNokia::paintProviderNotices(QPainter *painter, const QStyleOptionGraphicsItem *option) +void QGeoTiledMapDataNokia::paintProviderNotices(QPainter *painter, const QStyleOptionGraphicsItem *) { - QRect viewport = painter->combinedTransform().inverted().mapRect(painter->viewport()); + QColor fontColor(Qt::white); + if (mapType() == QGraphicsGeoMap::StreetMap) + { + fontColor = Qt::black; + fontColor.setAlphaF(0.5); + } - painter->drawPixmap( - viewport.bottomLeft()+QPoint(5,-5-watermark.height()), - watermark - ); + QFont font("Arial"); + font.setPixelSize(10); + font.setStyleHint(QFont::SansSerif); - QString copyrightText = getViewCopyright(); + painter->save(); + painter->setFont(font); + painter->setPen(fontColor); - if (copyrightText != lastCopyrightText || lastViewport != viewport) { - lastCopyrightText = copyrightText; - lastViewport = viewport; + QRect viewport = painter->combinedTransform().inverted().mapRect(painter->viewport()); + const int offset = 5; + viewport.adjust(offset, offset, -offset, -offset); - QRect maxBoundingRect(QPoint(viewport.left()+10+watermark.width(), viewport.top()), QPoint(viewport.right()-5, viewport.bottom()-5)); + QString copyrightText = getViewCopyright(); + QRect copyrightRect = painter->boundingRect(viewport, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, copyrightText); - QRect textBoundingRect = painter->boundingRect(maxBoundingRect, Qt::AlignLeft | Qt::AlignBottom | Qt::TextWordWrap, copyrightText); - lastCopyrightRect = textBoundingRect.adjusted(-1, -1, 1, 1); + QRect watermarkViewRect(viewport), copyrightViewRect(viewport); + watermarkViewRect.setHeight(watermarkViewRect.height() - copyrightRect.height()); + copyrightViewRect.adjust(0, watermark.height(), 0, 0); - lastCopyright = QPixmap(lastCopyrightRect.size()); - lastCopyright.fill(QColor(Qt::transparent)); + QRect watermarkRect(watermark.rect()); + AdjustLogo(watermarkViewRect, watermarkRect, m_logoPosition); + AdjustLogo(copyrightViewRect, copyrightRect, m_logoPosition); - { - QPainter painter2(&lastCopyright); - - painter2.drawText( - QRect(QPoint(1, 2), textBoundingRect.size()), - Qt::TextWordWrap, - copyrightText - ); - - painter2.drawPixmap(QRect(QPoint(-1, -1), lastCopyrightRect.size()), lastCopyright); - painter2.drawPixmap(QRect(QPoint(1, -1), lastCopyrightRect.size()), lastCopyright); - - painter2.setPen(QColor(Qt::white)); - painter2.drawText( - QRect(QPoint(1, 1), textBoundingRect.size()), - Qt::TextWordWrap, - copyrightText - ); - } - } + painter->drawPixmap(watermarkRect, watermark); + painter->drawText(copyrightRect, Qt::TextWordWrap, copyrightText); - painter->drawPixmap( - lastCopyrightRect, - lastCopyright - ); + painter->restore(); } diff --git a/plugins/geoservices/nokia/qgeotiledmapdata_nokia.h b/plugins/geoservices/nokia/qgeotiledmapdata_nokia.h index 38d6004fe3..52d01677ff 100644 --- a/plugins/geoservices/nokia/qgeotiledmapdata_nokia.h +++ b/plugins/geoservices/nokia/qgeotiledmapdata_nokia.h @@ -65,6 +65,13 @@ struct CopyrightDescriptor QList<QGeoBoundingBox> boxes; }; +enum LogoPosition +{ + TopLeft = 0, + ShiftedRight = 1, + ShiftedDown = 2 +}; + class QGeoTiledMapDataNokia: public QGeoTiledMapData { Q_OBJECT @@ -80,13 +87,10 @@ private: QPixmap watermark; - QPixmap lastCopyright; - QString lastCopyrightText; - QRect lastViewport; - QRect lastCopyrightRect; QNetworkAccessManager *m_networkManager; QHash<QString, QList<CopyrightDescriptor> > copyrights; + int m_logoPosition; private slots: void copyrightReplyFinished(QNetworkReply*); diff --git a/plugins/geoservices/nokia/watermark.png b/plugins/geoservices/nokia/watermark.png Binary files differindex fe7abc3d0f..ed8f332110 100644 --- a/plugins/geoservices/nokia/watermark.png +++ b/plugins/geoservices/nokia/watermark.png |