Using local gis server
-
Hi!
I have local QGIS-server and this requests works on my PC:http://localhost:81/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities http://localhost:81/cgi-bin/myProject/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
How I can using this server?
I try this in QML, but it's not work:PluginParameter { name: "osm.mapping.host"; value: "http://127.0.0.1:81/cgi-bin/myProject/" } PluginParameter { name: "osm.mapping.host"; value: "http://localhost:81/cgi-bin/myProject" }
-
QGIS appears to provide an OGC WMTS interface, not an OpenStreetMap interface (or any other supported by Qt out-of-the-box).
You might find this GIS Stack Exchange article informative, but it does not provide a copy and paste solution. -
@Mihaill said in Using local gis server:
it is work
https://www.linuxbabe.com/ubuntu/openstreetmap-tile-server-ubuntu-20-04-osm
https://kurazhov.ru/tile-server-openstreetmap/Plugin { id: mapPlugin name: "osm" PluginParameter { name: "osm.mapping.providersrepository.disabled"; value: true } PluginParameter { name: "osm.mapping.host"; value: "http://tile.your-domain.com/osm/" } }
-
@Mihaill said in Using local gis server:
it is work
https://www.linuxbabe.com/ubuntu/openstreetmap-tile-server-ubuntu-20-04-osm
https://kurazhov.ru/tile-server-openstreetmap/Plugin { id: mapPlugin name: "osm" PluginParameter { name: "osm.mapping.providersrepository.disabled"; value: true } PluginParameter { name: "osm.mapping.host"; value: "http://tile.your-domain.com/osm/" } }
@Mihaill
Hi Mihaill,I did as your recommend but could not load the map. Could you help me?
I followed this url to setup the server: https://switch2osm.org/serving-tiles/manually-building-a-tile-server-20-04-lts/
I could access those tiles via browser with url domain is localhost or 127.0.0.1 or my IP.
And the uri is "hot"
E.x: http://localhost/hot/7/10/26.pngThis is my simple source code:
Window { visible: true width: 800 height: 600 Plugin { id: mapPlugin name: "osm" PluginParameter { name: "osm.mapping.providersrepository.disabled" value: true } PluginParameter { name: "mymap" value: "http://127.0.0.1/hot/" } } Map { id: map anchors.fill: parent center { latitude: 10.802138 longitude: 106.6397577 } zoomLevel: 10 gesture.enabled: true plugin: mapPlugin //Make sure to set activeMapType equal to MapType.CustomType activeMapType: { return MapType.CustomType } } }
I get warning when run: qrc:/main.qml:83:9: Unable to assign [undefined] to QDeclarativeGeoMapType*
This point to MapType.CustomType :|
Thank you!
-
@Mihaill
Hi Mihaill,I did as your recommend but could not load the map. Could you help me?
I followed this url to setup the server: https://switch2osm.org/serving-tiles/manually-building-a-tile-server-20-04-lts/
I could access those tiles via browser with url domain is localhost or 127.0.0.1 or my IP.
And the uri is "hot"
E.x: http://localhost/hot/7/10/26.pngThis is my simple source code:
Window { visible: true width: 800 height: 600 Plugin { id: mapPlugin name: "osm" PluginParameter { name: "osm.mapping.providersrepository.disabled" value: true } PluginParameter { name: "mymap" value: "http://127.0.0.1/hot/" } } Map { id: map anchors.fill: parent center { latitude: 10.802138 longitude: 106.6397577 } zoomLevel: 10 gesture.enabled: true plugin: mapPlugin //Make sure to set activeMapType equal to MapType.CustomType activeMapType: { return MapType.CustomType } } }
I get warning when run: qrc:/main.qml:83:9: Unable to assign [undefined] to QDeclarativeGeoMapType*
This point to MapType.CustomType :|
Thank you!
@QuanTong
I fixed, maybe the MapType.CustomType is not passed as my old code above.
I found a guy who fixed from this and I tried -> It worked well <3My new source code:
Window { visible: true width: 800 height: 600 Plugin { id: mapPlugin name: "osm" PluginParameter { name: "osm.mapping.providersrepository.disabled" value: true } PluginParameter { name: "osm.mapping.custom.host" // Modified here value: "http://127.0.0.1/hot/" } } Map { id: map anchors.fill: parent center { latitude: 10.802138 longitude: 106.6397577 } zoomLevel: 10 gesture.enabled: true plugin: mapPlugin //Make sure to set activeMapType equal to MapType.CustomType activeMapType: { return map.supportedMapTypes[6] // Modified here } } }