0

I have been looking finding the documentation on how to add GeoServer WMS services in ArcGIS Runtime SDK for QT applications.

However, I found the sample below: https://developers.arcgis.com/qt/latest/qml/sample-code/sample-qt-wmslayerurl.htm

Which only works for services coming from ArcGIS Server's WMS service.

Is there any other way of adding the GeoServer WMS service in ArcGIS Runtime SDK for QT application?

  • Why do you think it only works with "ArcGIS Server's WMS Service"? WMS is an OGC Standard. The ArcGIS Server WMS service adheres to that standard, as such you should be able to add any/all WMS services....that's unless you're saying Geoserver WMS doesn't adhere to the WMS spec? – KHibma Jan 18 '19 at 21:09
  • @KHibma, I have tried adding the Geoserver WMS service and the Runtime application fails to load the layers from the Geoserver WMS services for reasons unknown. However, on further research, I found out the format to required to be added in the WMSLayer type properties. – Gurminder Bharani Jan 18 '19 at 22:56
1

The code in the documentation uses from ArcGIS Server WMS service URL:

import QtQuick 2.6
import Esri.ArcGISRuntime 100.4

Rectangle {
    id: rootRectangle
    clip: true
    width: 800
    height: 600

    MapView {
        id: mapView
        anchors.fill: parent

        Map {
            BasemapImagery {}                        

            // Add a WMS Layer by specifying the URL and layer name
            WmsLayer {
                url: "https://certmapper.cr.usgs.gov/arcgis/services/geology/africa/MapServer/WMSServer?request=GetCapabilities&service=WMS"
                layerNames: ["0"]
            }
        }
    }
}

Following is the URL of Geoserver WMS service hosted locally on my Geoserver:

https://domainName:8080/geoserver/cite/wms?service=WMS&version=1.1.0&request=GetMap&layers=cite%3AUS_Cities&bbox=-47.74%2C14.92%2C167.65%2C86.46&width=768&height=330&srs=EPSG%3A4269&format=application/openlayers

Following is the updated code with the wms service displayed above.

import QtQuick 2.6
import QtQuick.Controls 1.4
import Esri.ArcGISRuntime 100.4

ApplicationWindow {
    id: appWindow
    width: 800
    height: 600
    title: "WMSAGS"

    // add a mapView component
    MapView {
           id: mapView
           anchors.fill: parent

           Map {
               BasemapImagery {}

               // Add a WMS Layer by specifying the URL and layer name
               WmsLayer {
                   url: "https://domainName:8080/geoserver/cite/wms"
                   layerNames: ["US_Cities"]
               }
           }
       }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.