Elleo / qt-osm-map-providers

Easily setup a Qt OSM Map providers repository to allow use of tile servers that require an API key
MIT License
9 stars 2 forks source link

Embedding qt-osm-map-providers locally instead of a webserver #3

Closed ybabs closed 3 years ago

ybabs commented 3 years ago

Hi, I came across your repository and I'm trying to replicate the same thing in QML except instead of trying to point to a webserver, I want to do it locally.

I've gone through the steps here and Iv'e copied the contents of the folder into my project folder but for some reason, it seems
osm.mapping.providersrepository.address is trying to parse the directory as a URL as I get the following error message: Invalid custom providers repository address: "http://../qt-osm-map-providers/"

Here's what my plugin looks like:

 plugin:Plugin{
        name:"osm"

        PluginParameter {
            name: "osm.mapping.providersrepository.disabled"
             value: true
        }

        PluginParameter { name: "osm.mapping.highdpi_tiles"; value: true }

        PluginParameter {
            name: "osm.mapping.providersrepository.address"
            value: "../qt-osm-map-providers/"
        }

    }

Could you please assist?

Elleo commented 3 years ago

I haven't tried doing this locally, so I don't know if it'll work, but my first thought is that you could try passing a file:// URI

ybabs commented 3 years ago

Would it be to the folder or to the specific map style? I tried both

        PluginParameter {
            name: "osm.mapping.providersrepository.address"
            value: 'qrc:/qt-osm-map-providers/'
        }

and

        PluginParameter {
            name: "osm.mapping.providersrepository.address"
            value: 'qrc:/qt-osm-map-providers/cycle'
        }

for example. And error seems to have disapparead. Unfortunately the API key required watermark is still showing on the map

Elleo commented 3 years ago

I just remembered that someone else tried this a little while back and didn't seem to have much luck getting it to work from the filesystem, they ended up having their application implement a local HTTP server and provided the files via that (to see that discussion take a look at issue #2). I suspect the QML Map plugin only supports HTTP access.

ybabs commented 3 years ago

That makes sense, I'll try to deply a local HTTP Server to get this working. I'll close this for now, thanks for your help.