Hello,
In AppStudio, desktop edition, Is it possible to add FeatureService with a spatial reference different from the basemap's ? If yes, how can I do that ?
I tried the below QML but the featureservice doesn't show !
Map {
id: mainMap
anchors.fill: parent
extent: envelopeInitalExtent
wrapAroundEnabled: true
rotationByPinchingEnabled: true
magnifierOnPressAndHoldEnabled: false
mapPanningByMagnifierEnabled: true
zoomByPinchingEnabled: true
//INITIAL EXTENT
Envelope {
id: envelopeInitalExtent
xMax: -13630134.691272736
yMax: 4554320.7069897875
xMin: -13647294.804122735
yMin: 4535211.44991852
spatialReference: mainMap.spatialReference
}
//BASEMAP
ArcGISTiledMapServiceLayer {
url: appWindow.info.propertyValue("basemapServiceUrl", "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer")
}
//CREATE A FEATURE SERVICE TABLE FROM A FEATURE SERVICE
GeodatabaseFeatureServiceTable {
id: featureServiceTable
url: "MY_FS_URL"
spatialReference: mainMap.spatialReference
}
FeatureLayer {
id: featureLayer
featureTable: featureServiceTable
}
}
Thanks.
Solved! Go to Solution.
Yes, this should work. A couple of key points:
- Luke
Yes, this should work. A couple of key points:
- Luke
Thank you Lucas for your reply.
What I found is that the FeatureService I'm trying to add is secured so, it needs authentication before being able to display it !
Yes it should work just fine unless you are adding a local (offline) geodatabase and in that case it should be in same spatial reference as the basemap. I tested the following code and works fine
ArcGISTiledMapServiceLayer {
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
GeodatabaseFeatureServiceTable {
id: featureServiceTable
url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Water_Network/FeatureServer/23"
}
FeatureLayer {
id: featureLayer
featureTable: featureServiceTable
}