|
DOC
|
Robert -- we are looking for a way to force a specific Search Layer based upon a url parameter onOpen.
... View more
06-07-2018
12:04 PM
|
0
|
0
|
15416
|
|
DOC
|
Yes, our requirement was to only download the features after a saved date (which gets updated and saved in a config file each time this whole process is run so that the consecutive runs only pickup data from the last execution). Be sure to check your date formatting and also verify your token is being added. Here's an example of what we've implemented: #"CreationDate" is the date column to query on
def checkForUpdatedFS(taburl, uname, pword, inputDate):
if taburl != '':
try:
tokenURL = 'https://www.arcgis.com/sharing/rest/generateToken'
params = {'f': 'pjson', 'username': uname, 'password': pword, 'referer': 'http://www.arcgis.com'}
reqp = urllib2.Request(tokenURL, urllib.urlencode(params))
responsep = urllib2.urlopen(reqp)
datap = json.load(responsep)
token = datap['token']
except:
token = ''
params = urllib.urlencode({'f': 'pjson', 'where': "CreationDate>'{}'".format(inputDate), 'outFields': '*', 'token': token, 'returnGeometry': 'true'})
req = urllib2.Request(taburl + "/query", params)
gresp = urllib2.urlopen(req)
gdata = json.load(gresp)
rCount = (gdata['features'])
return len(rCount)
dFormat = '%Y-%m-%d %H:%M:%S'
writeDateVal = datetime.strptime(maxDateConfig, dFormat)
writeDateVal = writeDateVal + timedelta(seconds=1) #datetime.timedelta(0, 1) #add 1 second
writeDateValFinal = datetime.strftime(writeDateVal, dFormat) #wr
#test to see if we have any surveys to process using the last submitted date value
recChk = checkForUpdatedFS(serviceName, inputUsername, inputPswd , maxDateConfig)
if recChk>0:
print recChk
print 'There are {} surveys after {} to process.'.format(recChk, maxDateConfig)
... View more
06-05-2018
02:11 PM
|
0
|
0
|
18766
|
|
POST
|
Robert, Thanks again! I was struggling with making your solution/suggestion error-free and found the issue (pretty typical struggle for me, not sure how else to pick these out faster, I think I'm getting a bit better tho). It finally makes it to qStr and I believe sets the definitionExpression as desired: var geom = result; Should be var geom = result.geometry;
... View more
05-30-2018
12:51 PM
|
0
|
1
|
1539
|
|
POST
|
Robert -- I'm marking as correct cause I don't doubt this is what I need to implement. Still working thru a problem of "result" = undefined and causing an issue setting the wpGeometry var. I'll see if what I'm doing wrong there. def.then(lang.hitch(this, function(result){
debugger
if (result) {
var geom = result;
var wpGeometry = geometryEngine.geodesicBuffer(geom, -20, "meters");
var query = new Query();
query.outFields = ["*"];
query.returnGeometry = true;
query.outSpatialReference = this.map.spatialReference;
query.geometry = wpGeometry;
debugger
this.funcLocLayer.queryIds(query, lang.hitch(this, function (objectIds) {
var qStr = this.funcLocLayer.objectIdField + " IN(" + objectIds.join(',') + ")";
this.funcLocLayer.setDefinitionExpression(qStr);
}));
}
... View more
05-30-2018
07:22 AM
|
0
|
0
|
1539
|
|
POST
|
Thank you for that! I never would have thought to implement what you did there with the Deferred. So many unknowns. Overwhelming really. Is there an ending ")" missing for this? this.workplanBoundaryLayer.on("load" lang.hitch(this, function(){ I get an "expected ;" error here on the second ")": if(!this.workplanBoundaryLayer.loaded){ this.workplanBoundaryLayer.on("load" lang.hitch(this, function(){ def.resolve(this.workplanBoundaryLayer.graphics[0]); })); //error on this line says "expected ;" }else{ def.resolve(this.workplanBoundaryLayer.graphics[0]); }
... View more
05-30-2018
05:57 AM
|
0
|
2
|
2914
|
|
POST
|
It's very unclear to me how to .execute on the queryTask without having to jump to another showResult function. Also, I haven't found how to replace the query.where with a query.geometry property. Do you have any examples of querying with the geometry?
... View more
05-29-2018
01:26 PM
|
0
|
7
|
2914
|
|
POST
|
I have two polygon Feature Layers: FeatureLayer1 always has a single(1) polygon feature. FeatureLayer2 has thousands of polygon features. Requirement: Apply definition query/expression to FeatureLayer2 so that the only features available (throughout the entire session) in the map are those that intersect with the single polygon in FeatureLayer1.
... View more
05-29-2018
07:50 AM
|
0
|
10
|
2914
|
|
POST
|
hmm. So I will need to first select on funcLocLayer, collect OID's and then use those to setDefinitionExpression on that same FeatureLayer?
... View more
05-29-2018
07:25 AM
|
0
|
12
|
2914
|
|
POST
|
Probably multiple ways to handle this, but I need to set a definition expression on a polygon FeatureLayer using the intersection of another polygon FeatureLayer. I had been simply using a WHERE clause on an attribute, but the requirement has changed to use the geometry from a different FeatureLayer. Any help is appreciated. What I have so far: createFuncLocLayer: function () {
this.funcLocLayer = new FeatureLayer(this.config.functionalLocationLayer);
this.workplanBoundaryLayer.queryFeatures(this.queryWorkplanLayer(), lang.hitch(this, function (result) {
var wpGeometry = geometryEngine.geodesicBuffer(result.features[0].geometry, -20, "meters")
//How can I apply this.funcLocLayer.setDefinitionExpression to use the wpGeometry variable?
}));
... View more
05-29-2018
06:43 AM
|
0
|
15
|
4761
|
|
POST
|
You're an amazing resource. I was looking for a specific function in the WidgetManager to remove/destroy the widget, will have to take a bit to digest the solution you've provided! Much appreciated.
... View more
05-11-2018
01:01 PM
|
0
|
0
|
974
|
|
POST
|
Theme: Launchpad WabDev 2.7 Related Thread In addition to opening a particular widget from an existing widget (ScaleBar widget) when the app loads, I need to remove or disable another widget in the widgetpool. Remove it or disable it is fine, whichever is easiest. var widgetsConfig = this.appConfig.widgetPool.widgets;
var widgetId;
for (var i in widgetsConfig) {
if (widgetsConfig[i].name == "My Widget Name") {
widgetId = widgetsConfig[i].id;
break;
}
}
var abc = WidgetManager.getInstance().getWidgetsByName("AnchorBarController")[0];
abc.setOpenedIds([widgetId]); //this opens the desired widget
// I need to remove it from the Controller or just deactivate it somehow.
abc.removeFromController([widgetId]); //or some such thing
... View more
05-11-2018
11:27 AM
|
0
|
2
|
1076
|
|
POST
|
Sorry -- yes, Launchpad theme, WAB Dev 2.7 Also, I started a new thread so as to provide points for answers! https://community.esri.com/thread/214625-open-widget-from-scalebar-widget
... View more
05-11-2018
09:01 AM
|
0
|
0
|
1738
|
| 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
|