|
POST
|
WAB Dev 2.19 Lauchpad Theme Trying to resize an entire custom widget to maximize it's height property. Already attempted to set position{} properties in the config.json with no affect. However if I inspect the widget in DevTools and manually adjust the height value to 80% it looks like what I want but unsure how to achieve this: <div class="jimu-panel jimu-launchpad-panel" id="widgets_Pega WU Tool_Widget_43_panel" widgetid="widgets_Pega WU Tool_Widget_43_panel" style="inset: 120px auto auto 60px; width: 350px; height: 80%; padding: 0px; margin: auto; z-index: 101; position: absolute; opacity: 1;"></div> I also tried to implement PanelManger in the Widget.js file itself in an onOpen() function but ran into errors.
... View more
05-26-2022
02:01 PM
|
0
|
5
|
1395
|
|
POST
|
Yeah, was my oversight when first attempt at this then realized that layer.layerObject is a view only service in the webmap source to this WAB app. serverSideScratchLayerFacs is the edit service to the same data source. I still think its close because it does in fact applyEdits and adds the selGraphic point feature with attributes! But I'm not seeing why features[0] is not getting deleted at the same time. Thanks again, I'm making progress with you're input! Edit: final change works to setup applyEdits with the update instead of add/delete. Ken I used all of your input/posts to solve this so I just marked the one that was super useful to get the correct workflow. Much appreciated! This is the last change that worked: serverSideScratchLayerFacs.applyEdits(null, [selGraphic], null)
... View more
05-18-2022
06:31 AM
|
0
|
0
|
1616
|
|
POST
|
Great idea. Thanks for that. Looks like I'm close -- there is a new point feature created with all of the correct attributes, however the original point feature that I started with is not deleted. reply_click: function (e) {
console.log(e.target.id)
this.map.itemInfo.itemData.operationalLayers.forEach(layer => {
if (layer.layerObject) {
if (layer.title === "Water Use Application Facilities") {
var queryTask = new QueryTask(layer.layerObject)
var query = new Query();
query.returnGeometry = true;
query.outFields = ['*']
query.where = "facilityId = '" + e.target.id + "'"
layer.layerObject.selectFeatures(query).then(function (features) {
if (layer.layerObject.geometryType === 'esriGeometryPoint' && features.length === 1) {
//var feat = layer.layerObject.getSelectedFeatures();
//console.log(features[0])
this.map.centerAt(features[0].geometry);
this.map.graphics.clear();
var selSymbolJson = {
"color": [
0,
0,
0,
0
],
"size": 30.5,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"type": "esriSMS",
"style": "esriSMSCircle",
"outline": {
"color": [
0,
255,
250,
255
],
"width": 2.50,
"type": "esriSLS",
"style": "esriSLSSolid"
}
}
var attributes = {};
attributes['appId'] = features[0]['attributes'].appId //this.appId
attributes['reviewStatus'] = features[0]['attributes'].reviewStatus
attributes['facilityId'] = features[0]['attributes'].facilityId
attributes['facilityType'] = features[0]['attributes'].facilityType
attributes['facilityName'] = features[0]['attributes'].facilityName
attributes['permitId'] = features[0]['attributes'].permitId
attributes['OBJECTID'] = features[0]['attributes'].OBJECTID
this.selGraphic = new Graphic(features[0].geometry, symbolJsonUtils.fromJson(selSymbolJson), attributes)
this.map.graphics.clear();
this.map.graphics.add(selGraphic);
this.editToolbar = new Edit(this.map);
this.editToolbar.activate(Edit.MOVE, selGraphic);
this.editToolbar.on('graphic-move-stop', function (evt) {
var serverSideScratchLayerFacs = new FeatureLayer("urlToEditableFeatureService/FeatureServer/0" + '?token=uV6qzrCtV3hX_4XCqy_u9u3sVAb3QxuT86L1mTwlHdu1lcfPjOrer2vpjXoi61Y3wh8Fz82hsjqlosBKnOsdPF5m3wTW6wF9GmlRLgaPUQk.'); // + window.atob(tok));
var scratchQueryFacs = new Query();
scratchQueryFacs.where = "facilityId = '" + e.target.id + "'"
serverSideScratchLayerFacs.queryFeatures(scratchQueryFacs);
serverSideScratchLayerFacs.selectFeatures(scratchQueryFacs).then(function (features) {
serverSideScratchLayerFacs.applyEdits([selGraphic], null, [features[0]])
this.editToolbar.deactivate()
layer.layerObject.refresh()
})
})
}
});
}
}
})
},
... View more
05-17-2022
01:24 PM
|
0
|
2
|
1622
|
|
POST
|
Ken -- thanks for the input. I don't have the full workflow correct I'm sure. The way I have it currently once the selection is applied the selected feature/graphic is moveable and the new location has the symbology of the graphic (all good so far). Then when the user click elsewhere (not on the selected graphic), I want the applyEdits to immediately update the feature service with the new point location of the graphic and it's attributes (deleting the original point feature) and the underlying feature service to show the new point. Edit: I'm not sure that simply clicking off / on the map to applyEdits is the best idea. I mean, that would get invoked anytime a click (identify feature for ex). I think ideally, I just want to apply the edit immediately after the graphic has been moved. Hope that makes sense but this is how I understood the various samples out there. I'm all ears for guidance! Thanks again.
... View more
05-16-2022
05:21 PM
|
0
|
4
|
1637
|
|
POST
|
WAB Dev 2.19 / JavaScript 3.x I have a custom widget with a button click that attaches to the reply_click() function below. It successfully applies a query to select the feature (via attribute query), sets up a graphic to act as a highlight around the selected point feature and I can confirm the "selGraphic" that is created has the correct geometry and attributes. What I am trying to implement is a way for the user to edit ("move" only) that selected graphic and then update the underlying layer.layerObject.selectFeatures with the graphic that was "moved" by the user. I'm not getting any errors and the layer.layerObject.applyEdits() doesn't seem to choke or have any issues, however no edits are actually applied. I've tried several variations of the applyEdits() method with similar results, all of these do nothing: layer.layerObject.applyEdits(selGraphic, null, features[0]) layer.layerObject.applyEdits([selGraphic], null, features[0]) layer.layerObject.applyEdits([selGraphic], [], features[0]) layer.layerObject.applyEdits([selGraphic], null, [features[0]]) Any guidance is appreciated! reply_click: function (e) {
//console.log(e.target.id)
this.map.itemInfo.itemData.operationalLayers.forEach(layer => {
if (layer.layerObject) {
if (layer.title === "Water Use Application Facilities") {
var queryTask = new QueryTask(layer.layerObject)
var query = new Query();
query.returnGeometry = true;
query.outFields = ['*']
query.where = "facilityId = '" + e.target.id + "'"
layer.layerObject.selectFeatures(query).then(function (features) {
if (layer.layerObject.geometryType === 'esriGeometryPoint' && features.length === 1) {
this.map.centerAt(features[0].geometry);
this.map.graphics.clear();
var selSymbolJson = {
"color": [
0,
0,
0,
0
],
"size": 30.5,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"type": "esriSMS",
"style": "esriSMSCircle",
"outline": {
"color": [
0,
255,
250,
255
],
"width": 2.50,
"type": "esriSLS",
"style": "esriSLSSolid"
}
}
var attributes = {};
attributes['appId'] = features[0]['attributes'].appId //this.appId
attributes['facilityId'] = features[0]['attributes'].facilityId
attributes['facilityType'] = features[0]['attributes'].facilityType
attributes['facilityName'] = features[0]['attributes'].facilityName
attributes['permitId'] = features[0]['attributes'].permitId
var selGraphic = new Graphic(features[0].geometry, symbolJsonUtils.fromJson(selSymbolJson), attributes)
console.log(features[0].geometry)
map.graphics.clear();
map.graphics.add(selGraphic);
this.editToolbar = new Edit(this.map, { allowAddVertices: false });
this.editToolbar.activate(Edit.MOVE, selGraphic);
this.map.on("click", function (evt) {
layer.layerObject.applyEdits(selGraphic, null, features[0])
map.graphics.clear();
map.graphics.add(selGraphic);
})
}
});
}
}
})
}
... View more
05-16-2022
01:49 PM
|
0
|
6
|
1696
|
|
POST
|
Was tired of banging my head against the wall on that setSelectionsSysmbol and just implemented a simply selection Graphic that is added to the map. I supposed if I have other graphics to deal with then the wholesale map.graphics.clear() that I do prior to each call would need to change but for now this will work I think.
... View more
04-19-2022
08:23 AM
|
0
|
1
|
1376
|
|
POST
|
Hi Robert -- thanks for the reply. I still don't see any change in symbol on the selected feature. In an attempt to simplify, I just added the SimpleMarkerSymbol reference directly in the code to see if that would work but still not getting the symbology to change. I thought perhaps a layer.refresh() was needed but it has no affect. var selSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([255, 0, 0]), 1),
new Color([0, 255, 0, 0.25]));
console.log(e.target.id)
this.map.itemInfo.itemData.operationalLayers.forEach(layer => {
if (layer.layerObject) {
if (layer.title === "Water Use Application Facilities") {
var queryTask = new QueryTask(layer.layerObject)
var query = new Query();
query.returnGeometry = true;
query.outFields = ['*']
query.where = "facilityId = '" + e.target.id + "'"
//layer.layerObject.setSelectionSymbol(new SimpleMarkerSymbol(this.config.selectionSymbol));
var selSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0]), 1),new Color([0, 255, 0, 0.25]));
layer.layerObject.setSelectionSymbol(selSymbol);
layer.layerObject.selectFeatures(query).then(function (features) {
if (layer.layerObject.geometryType === 'esriGeometryPoint' && features.length === 1) {
this.map.centerAt(features[0].geometry);
//layer.layerObject.setSelectionSymbol(symbolJsonUtils.fromJson(selSymbol));
layer.layerObject.setSelectionSymbol(selSymbol);
layer.layerObject.refresh();
}
});
}
}
}) Just for reference, query.where is getting built with the e.target.id and seems to work fine because the map.centerAt() functions correctly when I click the specific item on the widget (e.target.id is the facilityId property found on the grid within the widget).
... View more
04-19-2022
07:28 AM
|
0
|
0
|
1383
|
|
POST
|
I'm trying to perform a selection from an attribute query, center the map and apply a symbol to the selection. I know I'm selecting the correct point feature, the map centers on it, but I'm not sure how to change the symbol of that selected feature. I'm applying the query on a feature layer in the source webmap. e.target.id is just sending the value for the where of the query. reply_click: function (e) {
console.log(e.target.id)
this.map.itemInfo.itemData.operationalLayers.forEach(layer => {
if (layer.layerObject) {
if (layer.title === "Water Use Application Facilities") {
var queryTask = new QueryTask(layer.layerObject)
var query = new Query();
query.returnGeometry = true;
query.outFields = ['*']
query.where = "facilityId = '" + e.target.id + "'"
layer.layerObject.setSelectionSymbol(new SimpleMarkerSymbol(this.config.selectionSymbol));
layer.layerObject.selectFeatures(query).then(function (features) {
if (layer.layerObject.geometryType === 'esriGeometryPoint' && features.length === 1) {
this.map.centerAt(features[0].geometry); //correctly centers
}
});
}
}
})
}, symbology is defined in the config.json file of the widget: "selectionSymbol": {
"color": [
0,
0,
0,
0
],
"size": 20.5,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"type": "esriSMS",
"style": "esriSMSCircle",
"outline": {
"color": [
0,
255,
250,
255
],
"width": 1.50,
"type": "esriSLS",
"style": "esriSLSSolid"
}
}
... View more
04-18-2022
12:54 PM
|
0
|
5
|
1429
|
|
POST
|
heh.... No problem. Actually I think I've worked it out. But yep my squigglies perception is about maxed out for the day! Thanks for the answer it helped.
... View more
03-02-2022
12:15 PM
|
0
|
0
|
2006
|
|
POST
|
Well... if you're up to taking a stab at my list-build problem I can keep this thread going! 🙂
... View more
03-02-2022
12:02 PM
|
0
|
2
|
2012
|
|
POST
|
Good eye. Thank you! I'm attempting to transform a XML response from a non-spatial api that I've got to basically rebuild into well-formatted json and it looks like I've got an improper list-build process going on somewhere that generates the json. Your correction looks like it should work.
... View more
03-02-2022
11:54 AM
|
0
|
4
|
2015
|
|
POST
|
Can anyone spot the issue with this input .json file? arcpy.JSONToFeatures_conversion fails in both a .py script and in ArcGIS Desktop 10.8.1 JSONToFeatures toolbox. py script error: "EOFError: [Errno 10054] An existing connection was forcibly closed by the remote host" Toolbox error: no message specified but the process fails with the Background Processing window appearing stating the operations did not complete successfully due to error and to tell ESRI's GP team about it. {
"features": [
[
{
"geometry": {
"y": -81.3515715,
"x": 27.941971
},
"attributes": {
"location_timestamp": 1646081377,
"vehicleName": "Truck1",
"deviceId": "350200694388663"
}
}
],
[
{
"geometry": {
"y": -81.3515715,
"x": 27.941971
},
"attributes": {
"location_timestamp": 1646081388,
"vehicleName": "Truck1",
"deviceId": "350200694388663"
}
}
]
],
"fieldAliases": {
"location_timestamp": "location_timestamp",
"vehicleName": "vehicleName",
"deviceId": "deviceId",
"OBJECTID": "OBJECTID"
},
"fields": [
{
"alias": "OBJECTID",
"type": "esriFieldTypeOID",
"name": "OBJECTID"
},
{
"alias": "deviceId",
"length": 50,
"type": "esriFieldTypeString",
"name": "deviceId"
},
{
"alias": "vehicleName",
"length": 50,
"type": "esriFieldTypeString",
"name": "vehicleName"
},
{
"alias": "location_timestamp",
"length": 8,
"type": "esriFieldTypeDate",
"name": "location_timestamp"
}
],
"displayFieldName": "vehicleName",
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
},
"geometryType": "esriGeometryPoint"
}
... View more
03-02-2022
08:50 AM
|
1
|
6
|
2054
|
|
POST
|
Having some difficulty deploying an Experience created and downloaded from ExB Developer v1.7 I ran thru THIS guide, created the item and registered it to our org AGO site (just like we do with our WAB apps). Updated the cliendId in the config.json, etc.. all that stuff. However when the Experience is unzipped and copied to the directory that the webserver uses (a virtual directory mounted on a remote filesystem), this is what I get in dev tools: The AGO Web Mapping Application Item details: URL: https://ourdomain/WAB/ExB/ODSS/index.html Redirect URI's: https://ourdomain/WAB/ExB/ODSS, https://ourdomain/WAB/ExB/ODSS/index.html It looks like there's multiple cdn directories trying to be access? Not sure what I'm doing wrong!
... View more
02-15-2022
07:49 AM
|
0
|
0
|
649
|
|
POST
|
These are geometries created by web tools, unvalidated / uncontrolled (the users can create any kind of whacked-out polygon imaginable) so I think I may have to just pursue getting out of reading ring coordinate all together and just convert the JSON to a feature class. Then reading geometries via da.cursor is probably going to be much easier/cleaner way.
... View more
02-04-2022
01:35 PM
|
0
|
1
|
1273
|
|
POST
|
Is direction guaranteed and how is direction determined? Does it matter how the polygon was digitized (ie. an island polygon that was digitized clockwise)? Thanks Josh! Thanks!
... View more
02-04-2022
12:56 PM
|
0
|
3
|
1278
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-17-2020 10:47 AM | |
| 1 | 10-25-2022 11:46 AM | |
| 1 | 08-08-2022 01:40 PM | |
| 1 | 02-15-2019 08:21 AM | |
| 2 | 08-14-2023 07:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
01-22-2025
02:28 PM
|