Showing Images On Map

3882
7
Jump to solution
06-22-2015 07:56 AM
CeyhunYilmaz
New Contributor III

Hi ,

I have an wms server and i want to use this service's GetMap function via url get query. I done it and i get an picture/image result which png/geotiff/kml etc. type. But there is a problem with show this image on the map. Image has an its extend scale like in the attachment.

Query url like below :

http://giswebservices.massgis.state.ma.us/geoserver/wms

Is there any way show image with/without coordinates on the map ?

Thanks.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ThomasDunn
Occasional Contributor

Yes. Here is a C++ sample demonstrating what you can do with WMS with the C++ API.

https://developers.arcgis.com/qt/cpp/sample-code/wms_layer_sample.htm

You can download the sample from https://developers.arcgis.com/qt/cpp/sample-code/

I hope this helps.

View solution in original post

0 Kudos
7 Replies
ThomasDunn
Occasional Contributor

Hello. I would like to understand this issue better, so here are some questions. Some answers may seem obvious, but I want to understand clearly.

- Is the attached PNG file the actual file that was returned from the WMS service?

- If so, was this image returned from the service whose URL begins with cbsservis.tkgm.gov.tr/tkgm.ows/wms?

- Should the image only contain the Antalya province?

- Are you using the Runtime SDK for Qt C++ (Qt Widgets) API or the QML (Qt Quick) API?

- Can you share the part of the code that displays the image on the map?

Thank you.

0 Kudos
CeyhunYilmaz
New Contributor III

Url which start with geonet is extra . There is   misspelling.

1. Yes Png file type. But service support many image type like  jpeg,tiff,geotiff. Also there are atom,kml etc

2.Yes

3.Yes

4. Mostly Qml. Actually we have developed with qml because of JS support and easy to use.

5.

    Envelope  {

        id: sfExtent

        xMin: 25.382409179687

        yMin: 35.74005859375

        xMax: 44.144582031249

        yMax: 41.913056640624

        spatialReference.wkid: 4326

    }

    Rectangle {

        id:mainRect

        width: 1003

        height: 400

        Map {

            id:mainmap

            transformOrigin: Item.Right

            anchors.fill: parent

            rotationByPinchingEnabled: true

            magnifierOnPressAndHoldEnabled: true

            mapPanningByMagnifierEnabled: true

            focus:true

            ArcGISDynamicMapServiceLayer{

                id: dynamiclayer

                url: "http://server.arcgisonline.com/arcgis/rest/services/ESRI_Imagery_World_2D/MapServer"

            }

            extent:sfExtent

        }

        // Create a flickable to view a large image.

        Flickable {

            id: view

            anchors.fill:parent

            contentWidth: picture.width

            contentHeight: picture.height

            Image {

                id: picture

                source:"";

                asynchronous: true

                opacity: 0.8

                }

            }

            states: State {

                name: "ShowBars"

                when: view.movingVertically || view.movingHorizontally

                PropertyChanges { target: verticalScrollBar; opacity: 0.1 }

                PropertyChanges { target: horizontalScrollBar; opacity: 0.1 }

            }

            transitions: Transition {

                NumberAnimation { properties: "opacity"; duration: 400 }

            }

        }

        ScrollBar {

            id: verticalScrollBar

            width: 12; height: view.height-12

            anchors.right: view.right

            opacity: 0

            orientation: Qt.Vertical

            position: view.visibleArea.yPosition

            pageSize: view.visibleArea.heightRatio

        }

        ScrollBar {

            id: horizontalScrollBar

            width: view.width-12; height: 12

            anchors.bottom: view.bottom

            opacity: 0

            orientation: Qt.Horizontal

            position: view.visibleArea.xPosition

            pageSize: view.visibleArea.widthRatio

        }

    }

And Final thank you

0 Kudos
ThomasDunn
Occasional Contributor

The source for the Image component gets a map as a PNG from the service. This is a raster image file. You can display it as an Image but you cannot add it as a Layer in the Map.

CeyhunYilmaz
New Contributor III

Hi Thomas,

thanks for reply

Is there any way show this image on the map with right place (with spatial reference)? I ask it to you because  we develop an project with this services and other wfs services (for table queries) and showing this image or wms layer last part. I will be very plesant if i can do that with your help.

Regards.

0 Kudos
ThomasDunn
Occasional Contributor

Hello, Ceyhun,

I wish I could offer you something, but there is nothing in the QML API in 10.2.6 to support adding the raster to a layer in the map.

-- Thomas

0 Kudos
CeyhunYilmaz
New Contributor III

Hi Thomas,

is there in qt c++ api ?

Thanks

0 Kudos
ThomasDunn
Occasional Contributor

Yes. Here is a C++ sample demonstrating what you can do with WMS with the C++ API.

https://developers.arcgis.com/qt/cpp/sample-code/wms_layer_sample.htm

You can download the sample from https://developers.arcgis.com/qt/cpp/sample-code/

I hope this helps.

0 Kudos