vladest / googlemaps

QtLocation plugin for Google maps tile API
MIT License
137 stars 61 forks source link

Is it supposed to work in Qt for iOS #22

Closed jmastr closed 5 years ago

jmastr commented 6 years ago

Hello,

first of all thank you very much for the great plugin. It works beautifully on macOS with Qt 5.10.0. I can make install it and it automatically pops up in the official mapviewer example under Provider. Great job!

However the same approach does not work for iOS. I can see, that the files are placed correctly, but the provider does not show up:

Qt5.10.0//5.10.0//ios/plugins/geoservices/libqtgeoservices_googlemaps.a
Qt5.10.0//5.10.0//ios/plugins/geoservices/libqtgeoservices_googlemaps.prl
Qt5.10.0//5.10.0//ios/plugins/geoservices/libqtgeoservices_googlemaps_debug.a
Qt5.10.0//5.10.0//ios/plugins/geoservices/libqtgeoservices_googlemaps_debug.prl
Qt5.10.0//5.10.0//clang_64/plugins/geoservices/libqtgeoservices_googlemaps_debug.dylib

Is it supposed to work on iOS?

jmastr commented 6 years ago

It seems somehow related to static linking on iOS.

vladest commented 6 years ago

Sorry, I dis not tested it on iOS Can guess the issue is with deploying libraries on the target

aqmappdesigners commented 5 years ago

Hi, I did not find a proper solution but an workaround with xcode: U need to modify the \<projectname>_plugin_import.cpp manualy and add another Line for an import:

Q_IMPORT_PLUGIN(QGeoServiceProviderFactoryGooglemaps)

Then you have to add the libqtgeioservices_googlemaps.a manualy to Build Phases, Link Binary With Libraries I hope it helps, aqm

jmastr commented 5 years ago

One can build the library statically with:

diff --git b/googlemaps.pro a/googlemaps.pro
index 498bc58..ee4f31e 100644
--- b/googlemaps.pro
+++ a/googlemaps.pro
@@ -1,4 +1,7 @@
 TEMPLATE = lib
+# BV: start
+CONFIG += static
+# BV: end
 CONFIG += plugin
 CONFIG += relative_qt_rpath  # Qt's plugins should be relocatable
 TARGET = qtgeoservices_googlemap