maplibre / maplibre-native-qt

MapLibre Native Qt Bindings and Qt Location Plugin
https://maplibre.org/maplibre-native-qt/docs/
38 stars 14 forks source link

Plugin does not import properly on iOs #108

Closed fro0m closed 1 month ago

fro0m commented 8 months ago

Describe the bug When importing plugin, the application do not import QML module.

module "QtLocation.MapLibre" is not installed

To Reproduce Steps to reproduce the behavior:

  1. I installed the library and linked it to the mobile application:
    
    INCLUDEPATH *= \
        $$libs_build_dir/map_libre_native_qt_lib/install/include/ \ # adding includes from sources not installed
    # CONFIG(release, debug|release) {
    #     SENTRY_RELEASE = Debug # some problem with sentry native it always create binary in Debug directory. It is supposed to be Release
    # }
    #QTPLUGIN += QGeoServiceProviderFactoryMapLibre
    QTPLUGIN += qtgeoservices_maplibre

link to plugin static lib

LIBS *= \ -L$$libs_build_dir/map_libre_native_qt_lib/install/lib -lQMapLibre -lQMapLibreLocation \ -L$$libs_build_dir/map_libre_native_qt_lib/install/plugins/geoservices -lqtgeoservices_maplibre \

2. In the app imported plugin before instantiating QGuiApplication

if defined(Q_OS_IOS)

Q_IMPORT_PLUGIN(QGeoServiceProviderFactoryMapLibre)
//Q_INIT_RESOURCE(QGeoServiceProviderFactoryMapLibre)

endif

4. when the app loading QML file with map usage, it shows

qrc:/path/MyMapComponent.qml:4 module "QtLocation.MapLibre" is not installed

import QtQuick import QtLocation import QtPositioning import QtLocation.MapLibre as Libre



**Expected behavior**
It works

**Platform information (please complete the following information):**
 - OS: IOs simulator 17.2
 - Qt version 6.6.1
 - Version latest, today's main

**Additional context**
Need to extend documentation.
ntadej commented 8 months ago

You are also missing the declarative_locationplugin_maplibre.

fro0m commented 8 months ago

It helped, thank you. Hower I believe this bug should be open until documentation will be extended. Users deserve not to spend hours in investigating sources in order to understand how to use this library.

ntadej commented 8 months ago

Indeed, I'm working on documentation now. #99 is the first step.