AnsweredAssumed Answered

Updating point feature problem qt/qml

Question asked by tanerkoka on Feb 25, 2016
Latest reply on Feb 29, 2016 by LDanzinger-esristaff

Hi,

I'm using GeodatabaseFeatureServiceTable service to update point feature in online side. But I can't update my point feature to another place.Point moves to other place but can't apply feature edits back to the service and applyFeatureEditsErrors  object is undefined when trigger onApplyFeatureEditsErrorsChanged event in GeodatabaseFeatureServiceTable  .Are there any wrong code in my app.Here is the app and console output below.

 

Thanks.

 

import QtQuick.Controls.Styles 1.2

import ArcGIS.Extras 1.0

import QtQuick 2.3

import QtQuick.Controls 1.2

import ArcGIS.Runtime 10.26

 

ApplicationWindow {

    id: appWindow

    width: 800

    height: 600

    title: "Test"

 

    property double scaleFactor: System.displayScaleFactor

    property int fontSize: 15 * scaleFactor

    property string featuresUrl: "http://........................./arcgis/rest/services/....................../......................./FeatureServer"

    property var selectedFeatureId: null

 

    Envelope  {

      id: sfExtent

 

        xMin: 3430342.171241454

        yMin: 4671974.99845585

        xMax: 3775017.817877803

        yMax: 4976536.316803186

    }

 

    Map {

        id: mainMap

        anchors.fill: parent

        extent: sfExtent

        focus: true

 

        ArcGISTiledMapServiceLayer

        {

            url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"

            opacity: 0.5

        }

 

        ArcGISDynamicMapServiceLayer

        {

            url: "http://........................................./arcgis/rest/services/................../............../MapServer"

        }

 

        FeatureLayer {

           id: onlineNumaratajLayer

           featureTable: featureServiceNumaratajTable

           selectionColor: "cyan"

 

            function hitTestFeatures(x,y) {

                var tolerance = Qt.platform.os === "ios" || Qt.platform.os === "android" ? 4 : 1;

                var featureIds = onlineNumaratajLayer.findFeatures(x, y, tolerance * scaleFactor, 1);

                if (featureIds.length > 0) {

                    selectedFeatureId = featureIds[0];

                    selectFeature(selectedFeatureId);

                    statusText.text = "Feature Selected.Please Update Point";

                }

            }

        }

 

        onMouseClicked:

        {

            if (onlineNumaratajLayer.isFeatureSelected(selectedFeatureId))

            {

                var featureToEdit = onlineNumaratajLayer.featureTable.feature(selectedFeatureId);

                featureToEdit.geometry = mouse.mapPoint;

                onlineNumaratajLayer.featureTable.updateFeature(selectedFeatureId, featureToEdit);

                onlineNumaratajLayer.unselectFeature(selectedFeatureId);

         

               featureServiceNumaratajTable.applyFeatureEdits();

         

               statusText.text="Editing is complated";

                selectedFeatureId = null;

 

            } else

                onlineNumaratajLayer.hitTestFeatures(mouse.x,mouse.y);

        }

    }

 

    GeodatabaseFeatureServiceTable {

        id: featureServiceNumaratajTable

        url: featuresUrl + "/1"

     

onApplyFeatureEditsErrorsChanged:

   console.log("Error Edit Operation String :"+applyFeatureEditsErrors.editOperationString);

    console.log("Error Edit Operation :"+applyFeatureEditsErrors.editOperation);

  }

  

}

 

    Rectangle {

        id: textStatusRectangle

        anchors {

            fill: statusText

            margins: -10 * scaleFactor

        }

        visible: statusText.text.length > 0

        color: "lightgrey"

        radius: 5

        border.color: "black"

        opacity: 0.77

    }

 

    Text {

        id: statusText

        anchors {

            left: parent.left

            right: parent.right

            bottom: parent.bottom

            margins: 20 * scaleFactor

        }

        wrapMode: Text.WordWrap

        color: "black"

    }

 

    Rectangle {

        anchors.fill: parent

        color: "transparent"

        border {

            width: 0.5 * scaleFactor

            color: "black"

        }

    }

}

 

 

Console output:

 

Starting D:\Projects\Packages\QT\build-OfflineNumtest-Desktop_Qt_5_4_2_MSVC2013_64bit-Release\release\OfflineNumtest.exe...

Initializing application

ArcGIS.Extras.Plugin: void __cdecl ArcGISExtrasPlugin::registerTypes(const char *) ArcGIS.Extras

ArcGIS.Extras.Plugin: void __cdecl ArcGISExtrasPlugin::registerTypes(const char *) Registering Singleton Types

ArcGIS.Extras.Core: void __cdecl TkTypes::registerTypes(const char *) ArcGIS.Extras

int __cdecl main(int,char *[]) ApplicationWindow_QMLTYPE_12_QML_15(0x21c40d0)

qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_client_method

qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_client_method

qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_server_method

qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_server_method

qt.network.ssl: QSslSocket: cannot resolve SSL_select_next_proto

qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb

qt.network.ssl: QSslSocket: cannot resolve SSL_get0_next_proto_negotiated

qml: Error Edit Operation String :undefined

qml: Error Edit Operation :undefined

Outcomes