|
POST
|
Simply trying to change the basemap with a click of a button any it does not seem to be working....any thoughts? import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Controls 1.0
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import Esri.ArcGISRuntime 100.5
import QtQuick.Layouts 1.1
Item {
signal previous(string message)
property string basemapId: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"
MapView {
id:mapView
Layout.fillHeight: true
Layout.alignment: Qt.AlignTop
width: parent.width
height: parent.height
property real initialMapRotation: 0
Map {
id: map
Basemap {
id: basemaplocation
ArcGISTiledLayer {
id: baseMap
url: basemapId
visible: true
}
}
}
}
Row {
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
margins: 5 * scaleFactor
bottomMargin: 50 * scaleFactor
}
spacing: 5
Button {
text: "Switch Basemap"
onClicked: {
console.log("changing basemamp");
basemapId = "http://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer"
baseMap.load(basemapId);
}
}
}
}
... View more
08-16-2019
06:43 AM
|
0
|
5
|
2625
|
|
POST
|
Thanks...my main issue is getting at the other attributes.... I cant seem to get to them....I tried 3 or 4 opther ways but keep getting Error: Undefined. // loop through the results var results = mapView.identifyLayersResults; for (var i = 0; i < results.length; i++) { var result = results; var count = geoElementsCountFromResult(result); var layerName = result.layerContent.name; var etst = result.attributes.attributeValue("inspector");
... View more
06-25-2019
05:44 AM
|
0
|
1
|
1984
|
|
POST
|
OK will try that....was going on your prior post to contact https://community.esri.com/groups/technical-support ... Got it now...I will place a Support Request and go that route to see if I can get some help.... MUCH Appreciated.
... View more
06-18-2019
11:04 AM
|
0
|
0
|
2005
|
|
POST
|
Is there another location I should forward this to Erwin?
... View more
06-18-2019
05:49 AM
|
0
|
2
|
2005
|
|
POST
|
Looking at my Feature Service from the link above I am noticing something... I can return values on OBJECTID, JURIS, and GLOBAL ID These either are in the TYPES below the FIELDS with a value or not in there. So maybe this is how the data is structured or how it was published?
... View more
06-14-2019
05:34 AM
|
0
|
0
|
700
|
|
POST
|
I posted this in the Support section...never heard back https://community.esri.com/thread/233828-update-feature-to-textfield-not-working
... View more
06-13-2019
01:23 PM
|
0
|
3
|
2005
|
|
POST
|
I swear I reached out to them....if not my mistake...I will try once again...
... View more
06-13-2019
01:20 PM
|
0
|
0
|
2005
|
|
POST
|
This is my exact code trying to hit a service of mine....everything is UNDEFINED. I reached out to ESRI but nothing... thoughts? import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1
import QtQuick.Controls.Material 2.1
import QtGraphicalEffects 1.0
import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Controls 1.0
import Esri.ArcGISRuntime 100.2
import "../controls" as Controls
Item {
id:setInitialMapArea
property real scaleFactor: AppFramework.displayScaleFactor
property int baseFontSize : app.info.propertyValue("baseFontSize", 15 * scaleFactor) + (isSmallScreen ? 0 : 3)
property bool isSmallScreen: (width || height) < units(400)
property double mousePointX
property double mousePointY
property var selectedFeature: null
property var varWMA: null
property var vardamageType: null
// property string inspectorname
// Create MapView that contains a Map with the Imagery Basemap
// Create MapView that contains a Map
MapView {
id: mapView
anchors.fill: parent
wrapAroundMode: Enums.WrapAroundModeDisabled
Map {
id:map
// Set the initial basemap to Streets
BasemapStreets { }
// set viewpoint over The United States
ViewpointCenter {
Point {
x: -10800000
y: 4500000
spatialReference: SpatialReference {
wkid: 102100
}
}
targetScale: 3e7
}
FeatureLayer {
id: featureLayer
selectionColor: "cyan"
selectionWidth: 3
// declare as child of feature layer, as featureTable is the default property
ServiceFeatureTable {
id: featureTable
//url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0"
url: "https://vafwisdev.dgif.virginia.gov/arcgis/rest/services/DGIF_Test/TestRegions/FeatureServer/0"
// make sure edits are successfully applied to the service
onApplyEditsStatusChanged: {
if (applyEditsStatus === Enums.TaskStatusCompleted) {
console.log("successfully updated feature");
}
}
// signal handler for the asynchronous updateFeature method
onUpdateFeatureStatusChanged: {
if (updateFeatureStatus === Enums.TaskStatusCompleted) {
// apply the edits to the service
featureTable.applyEdits();
}
}
}
// property var car: ({example: ''})
// signal handler for selecting features
onSelectFeaturesStatusChanged: {
if (selectFeaturesStatus === Enums.TaskStatusCompleted) {
if (!selectFeaturesResult.iterator.hasNext)
return;
selectedFeature = selectFeaturesResult.iterator.next();
//vardamageType = selectedFeature.attributes.attributeValue("City_Numbe");
varWMA = selectedFeature.attributes.attributeValue("Duplicate");
var valuevarWMA = selectedFeature.attributes.attributeValue("County_Nam");
//var varFGSymbol = selectedFeature.attributes.attributeValue("FG_Symbol");
console.log("=================================================");
console.log(varWMA);
console.log(valuevarWMA);
console.log(typeof valuevarWMA);
console.log("=================================================");
// show the callout
callout.x = mousePointX;
callout.y = mousePointY;
callout.visible = true;
// set the combo box's default value
//damageComboBox.currentIndex = featAttributes.indexOf(vardamageType);
notesfield.text = "Value is: " + varWMA;
notesfield2.text = "Value is: " + valuevarWMA;
}
}
}
}
QueryParameters {
id: params
maxFeatures: 1
}
// hide the callout after navigation
onViewpointChanged: {
callout.visible = false;
updateWindow.visible = false;
}
onMouseClicked: {
// reset the map callout and update window
featureLayer.clearSelection();
callout.visible = false;
updateWindow.visible = false;
mousePointX = mouse.x;
mousePointY = mouse.y - callout.height;
mapView.identifyLayerWithMaxResults(featureLayer, mouse.x, mouse.y, 10, false, 1);
}
onIdentifyLayerStatusChanged: {
if (identifyLayerStatus === Enums.TaskStatusCompleted) {
if (identifyLayerResult.geoElements.length > 0) {
// get the objectid of the identifed object
params.objectIds = [identifyLayerResult.geoElements[0].attributes.attributeValue("objectid")];
// query for the feature using the objectid
featureLayer.selectFeaturesWithQuery(params, Enums.SelectionModeNew);
}
}
}
//Busy Indicator
BusyIndicator {
anchors.centerIn: parent
height: 48 * scaleFactor
width: height
running: true
Material.accent:"#8f499c"
visible: (mapView.drawStatus === Enums.DrawStatusInProgress)
}
}
// map callout window
Rectangle {
id: callout
width: row.width + (10 * scaleFactor) // add 10 for padding
height: 40 * scaleFactor
radius: 5
border {
color: "lightgrey"
width: .5
}
visible: false
MouseArea {
anchors.fill: parent
onClicked: mouse.accepted = true
}
Row {
id: row
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
margins: 5 * scaleFactor
}
spacing: 10
// TEXT ON THE POPUP TO MODIFY THE RECORD
Text {
Material.accent: "#8f499c"
text: "damage type " + varWMA
font.pixelSize: 18 * scaleFactor
}
Rectangle {
radius: 100
width: 22 * scaleFactor
height: width
color: "transparent"
border.color: "blue"
antialiasing: true
Text {
anchors.centerIn: parent
text: "i"
font.pixelSize: 18 * scaleFactor
color: "blue"
}
// create a mouse area over the (i) text to open the update window
MouseArea {
anchors.fill: parent
onClicked: {
updateWindow.visible = true;
}
}
}
}
}
// Update Window
Rectangle {
id: updateWindow
anchors.centerIn: parent
width: 300 * scaleFactor
height: 300 * scaleFactor
radius: 10
visible: false
Material.accent: "#8f499c"
GaussianBlur {
anchors.fill: updateWindow
source: mapView
radius: 40
samples: 20
}
MouseArea {
anchors.fill: parent
onClicked: mouse.accepted = true
onWheel: wheel.accepted = true
}
Column {
anchors {
fill: parent
margins: 10 * scaleFactor
}
spacing: 10
Row {
anchors.horizontalCenter: parent.horizontalCenter
Text {
text: "Update Attribute"
font.pixelSize: 16 * scaleFactor
}
}
/*
ComboBox {
id: damageComboBox
width: updateWindow.width - (20 * scaleFactor)
model: featAttributes
}
*/
Text {
id: notesfield
//text: valuevarWMA
color: "blue"
width: updateWindow.width - (20 * scaleFactor)
}
TextField {
id: notesfield2
// text: varWMA
width: updateWindow.width - (20 * scaleFactor)
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 10
Button {
width: (updateWindow.width / 2) - (20 * scaleFactor)
text: "Update"
function doUpdateAttribute(){
if (selectedFeature.loadStatus === Enums.LoadStatusLoaded) {
selectedFeature.onLoadStatusChanged.disconnect(doUpdateAttribute);
// selectedFeature.attributes.replaceAttribute("TYPE", damageComboBox.currentText);
// selectedFeature.attributes.replaceAttribute("WMA", damageComboBox2.text);
// selectedFeature.attributes.replaceAttribute("WMA", "Amelia");
}
}
// once the update button is clicked, hide the windows, and fetch the currently selected features
onClicked: {
callout.visible = false;
updateWindow.visible = false;
selectedFeature.onLoadStatusChanged.connect(doUpdateAttribute);
selectedFeature.load();
}
}
Button {
width: (updateWindow.width / 2) - (20 * scaleFactor)
text: "Cancel"
// once the cancel button is clicked, hide the window
onClicked: updateWindow.visible = false;
}
}
}
}
} // End ITEM
... View more
06-13-2019
07:22 AM
|
0
|
2
|
2005
|
|
POST
|
Is there an identify on a Feature Layer Example? Can I do this?
... View more
06-12-2019
11:42 AM
|
0
|
3
|
1984
|
|
POST
|
or better yet....using a basemap and the feature layer....still cant identify.....anyone have any thoughts? Map{
BasemapTopographic {}
FeatureLayer {
ServiceFeatureTable {
url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/0"
//featureRequestMode: Enums.FeatureRequestModeOnInteractionNoCache
}
}
onLoadErrorChanged:{
console.log(mapView.map.loadError.additionalMessage)
}
}
... View more
06-11-2019
04:08 AM
|
0
|
4
|
1984
|
|
POST
|
I am using the Web Map template in AppStudio. The third sample in this template is "We Map Identify" I update the MAP section as seen below but the feature layer does not identify....Am I missing something???? In this .qml file is this code that seems to allow for the identify of a Feature Layer. // Signal handler for identify
onIdentifyLayersStatusChanged: {
if (identifyLayersStatus === Enums.TaskStatusCompleted) {
//SNIP OUT ALL THE CODE ABOVE TO MAKE SHORTER
}else{
// Results are from Feature Layer
// iterate through individual features of the feature Layer results
for(var f = 0; f < identifyLayerResult.popups.length; f++){
popup = identifyLayerResult.popups[f];
selectedFeature = popup.geoElement;
popupDef = popup.popupDefinition;
// Appending the result to the model
newPopup = ArcGISRuntimeEnvironment.createObject("Popup", {
initGeoElement: selectedFeature,
initPopupDefinition: popupDef
});
// create a popup manager
newPopupManager = ArcGISRuntimeEnvironment.createObject("PopupManager", {popup: newPopup});
popupListModel.append({'popupManager': newPopupManager});
}
}
} I updated the MAP section to this Map{
initUrl: "http://arcgis.com/sharing/rest/content/items/8ccfcc3a83d241ce9765ff4aea459617"
//initUrl: "https://vafwisdev.dgif.virginia.gov/arcgis/rest/services/DGIF_Test/BoatRampFacilities/FeatureServer/0"
FeatureLayer {
ServiceFeatureTable {
url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/0"
//featureRequestMode: Enums.FeatureRequestModeOnInteractionNoCache
}
}
onLoadErrorChanged:{
console.log(mapView.map.loadError.additionalMessage)
}
}
... View more
06-10-2019
10:07 AM
|
0
|
5
|
2222
|
|
POST
|
Think I figured it out...was testing and looking at other templates and one template had a Data Folder with some data in it. I created this Data folder at the root of my project like the template for testing. I just removed it and the upload went fine. Will just have to figure out why....
... View more
06-10-2019
05:26 AM
|
0
|
0
|
1330
|
|
POST
|
Good point...I tried 2 others and they upload fine...so seems to be the project...hmmmm trrying to figure out the last stuff I added...will have to look but does anything come to your mind? Maybe delete the Upload copy in AGOL then retry?
... View more
06-10-2019
05:18 AM
|
0
|
0
|
1330
|
|
POST
|
I am trying to upload my project as I have done a thousand times....keep getting this error Thoughts?
... View more
06-06-2019
12:24 PM
|
0
|
3
|
1429
|
|
POST
|
I don think this is bring the file local which is what I need......any thoughts on this...looks promising
... View more
06-05-2019
11:01 AM
|
0
|
0
|
844
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|