Elleo/qt-osm-map-providers

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

ybabs opened this issue · 4 comments

ybabs commented

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

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

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

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

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.