Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Get a pointer from QML to a cartography plugin class



  • Hello, I have a custom plugin for OpenStreetMap that works offline with maps, and in QML I have a Map component that uses this plugin:

        Window {
            visible: true
            width: 640
            height: 480
            Map {
                id: map
                anchors.fill: parent
                zoomLevel: 4
                center: QtPositioning.coordinate(54,28);
                copyrightsVisible: false
                plugin: Plugin {
                    name: "osm_custom";
                    PluginParameter {
                        name: "osm_custom.mapping.offline.directory"
                        value: "/home/deymos/Рабочий стол/build-Tiler-Desktop_Qt_5_14_1_GCC_64bit-Debug/offline_tiles"
                    }
                }
            }
        }
    

    And now it's time, besides displaying the map, to mark places and draw a route on it, and all calculations should occur on the plug-in side, and so, I need to somehow transfer the coordinates from QML to the plug-in class, ideally if there is such a possibility I need to get a pointer to plugin class and pass coordinates directly.

    P.S. The plugin is located in a different directory and is linked to the QML application only by what is specified in the Plugin component.


Log in to reply