|
POST
|
Javascript API Version 3.16 I have an issue with the applyEdits method on a Feature Layer when creating new features. I'm trying to get the GlobalID that is automatically generated. The REST response shows that the globalID did successfully get created but my attempts to get it via javascript keep resulting in 'undefined'. I'm wondering if there's a timing issue with when the globalID actually gets created? I've tried this with two approaches, neither successful: First approach app.projectLayer.applyEdits([projectPoly], null, null).then(function(response) { app.map.graphics.remove(projectPoly); app.projectLayer.refresh(); }); app.projectLayer.on('edits-complete', function(result){ var projectObjId = result.adds[0].objectId; var projects = app.projectLayer.graphics; for (var i = 0, len = projects.length; i < len; i++) { console.log(projects.attributes.GlobalID); } Second approach app.projectLayer.applyEdits([projectPoly], null, null).then(function(response) { var projectObjId = response[0].objectId; var projects = app.projectLayer.graphics; for (var i = 0, len = projects.length; i < len; i++) { if(projects.attributes.OBJECTID == projectObjId){ console.log(projects.attributes.GlobalID); } } app.map.graphics.remove(projectPoly); app.projectLayer.refresh(); }); In both of these cases the console.log statement returns undefined. However if i set it to console.log(projects[i-1].attributes.GlobalID);, I get the GlobalID of the next-to-last feature, as expected. Why is it returning undefined for the newly created feature, especially when the REST response shows that the GlobalID was successfully created?
... View more
07-27-2016
11:53 AM
|
1
|
16
|
7972
|
|
POST
|
Thanks for following up, I figured it out. I wasn't setting the 'label' parameter in the renderer. After adding that, it worked.
... View more
07-08-2016
06:00 AM
|
0
|
0
|
2745
|
|
POST
|
I figured this out in case anyone else has this issue. The problem was that I was not setting a 'label' value for each of the UniqueValues in my renderer. It isn't totally obvious, but that 'label' value is required for the legend to display.
... View more
07-08-2016
05:59 AM
|
2
|
0
|
2745
|
|
POST
|
I have an application I'm building with version 3.16 of the API. One of the features is the ability to switch between 3 different symbology sets. Each of these 3 is created using the UniqueValueRenderer and updating the FeatureLayer's renderer when a specific option is chosen. Works great. The problem I'm having is that I want the legend in the application to update when a new renderer is applied, but I haven't been able to figure it out. I've tried: app.legend.refresh(); I've also tried writing and calling a function that should destroy any existing legend and create a new one: function updateLegend(map, fl) { // destroy previous legend, if present if ( app.hasOwnProperty("legend") ) { app.legend.destroy(); domConstruct.destroy(dojo.byId("legend")); } // create a new div for the legend var legendDiv = domConstruct.create("div", { id: "legend" }, dom.byId("legendWrapper")); app.legend = new Legend({ map : map, layerInfos : [{ layer : fl, title: 'Stormwater Service Requests' }] }, legendDiv); app.legend.startup(); } But neither of these updates the legend. In fact, all I get is a message where the legend should be that says "Creating Legend..." If I have my browser console open, an error is thrown (with both of these options): Object doesn't support property or method 'replace' File: 3.16, Line:1715, Column: 514 It looks like the error is being thrown in the API code, not the code for my app. Does anyone have any insight on what this error might be, and what I can do to get the legend to update properly?
... View more
07-07-2016
01:27 PM
|
0
|
7
|
5201
|
|
POST
|
Thank you! I was using the Attribute editing - mobile sample and trying to modify for Bootstrap, which is exactly what the github repo you linked does. That should definitely move me down the right path.
... View more
05-18-2016
12:19 PM
|
0
|
0
|
503
|
|
POST
|
I am currently using the AttributeInspector widget for editing the attributes of a feature service, but I am not thrilled with the layout of the fields. From what I can tell with the AttributeInspector, all fields display in a single column and there is no way to rearrange them. If there is a way to control the layout of the AttributeInspector, please let me know. I'd like a nicer looking edit form, where I have control over the size of the field input element and can place two or more fields next to each other horizontally on a row. Something more like: I would probably use Bootstrap to design a form, but I'm not sure how to bind the form inputs to the fields of the feature service. Any suggestions would be much appreciated!
... View more
05-18-2016
10:48 AM
|
0
|
2
|
3748
|
|
POST
|
Thanks. My relationship is 1:1, so the worry about which child to display isn't relevant. As stated, AGOL already supports this functionality, so having it in Collector also shouldn't be that difficult.
... View more
04-04-2016
06:05 AM
|
0
|
0
|
437
|
|
POST
|
Your best bet for automatically generating a unique ID using Collector for ArcGIS, is to use a GlobalID-type field for the ID. That is the only field type that will auto-populate in Collector. Other methods used throughout the ESRI ecosystem for generating unique ID's rely on coding/scripting that cannot be applied in Collector.
... View more
03-31-2016
08:17 AM
|
2
|
0
|
661
|
|
POST
|
In the ArcGIS Online web map application, we can add fields from related tables into the main feature popup simply by referencing the relationship like so: {relationships/xx/fieldname}, where xx = an integer that represents the specific relationship as shown in the layer's Description and fieldname is the name of a field in the related table. This works very well in web maps, but in Collector it does not seem to work. The placeholder for the field is there, but no data is populated. It would be nice to view some related table fields in the main Collector popup without having to dig into the actual related table. Is this possible at the moment?
... View more
03-31-2016
06:40 AM
|
0
|
2
|
3287
|
|
POST
|
Would you mind sharing the solution you came up with?
... View more
02-02-2016
07:02 PM
|
0
|
1
|
708
|
|
POST
|
Same issue here. It's odd because this particular custom form/project combo has been in use for several months and this issue just popped up for me in the last month. The only difference is that I was on Windows XP when I first started and am now using Windows 7 to check-out and transfer the data to a Trimble GeoXH 6000 series. Before, I was able to collect hundreds of points with no memory issues, now it seems like I can only collect about 25 before the low memory messages. Anyone that has any ideas on how to prevent this, I'm all ears. All unnecessary ArcPad extensions are off and no other programs are running on the mobile unit.
... View more
05-30-2014
09:07 AM
|
0
|
0
|
355
|
|
POST
|
In the config file for the Water Utility Profiling Tool, we are given the option to set a Point Layer (e.g. Manholes) to use to set the upstream and downstream ends of the profile graph. My stormwater network is comprised of several point types - catch basins, manholes, etc. Is it possible to choose multiple point layers to be considered by the Profiling tool, or should I do something to merge the layers prior to running the tool?
... View more
04-24-2014
07:50 AM
|
0
|
1
|
1837
|
|
POST
|
I recently ran into this same problem, and agree that the CAD feature type is missing from the ListDatasets function in arcpy. However, I found a workaround that I think will work better than using the older arcgisscripting toolset. The following code is an example: Set the workspace using sys.argv, create an empty list, use the arcpy.Describe method and then loop through the dataTypes in the directory. You can use a conditional statement to append only the CAD datasets to the list: import sys, arcpy arcpy.env.workspace = sys.argv[1] #User will enter a file path for a directory of CAD files files = arcpy.ListDatasets() #List all datasets. CADfiles = [] #Create an empty list to store CAD files for f in files:[INDENT]desc = arcpy.Describe(f) if desc.dataType == "CadDrawingDataset":[INDENT]CADfiles.append(f)[/INDENT][/INDENT] You can also use arcpy.ListDatasets("", "Feature") - this will return all coverage, CAD, and geodatabase feature datasets. You'd still need to do the conditional statement, so this wouldn't really be necessary.
... View more
11-11-2011
08:43 AM
|
0
|
0
|
509
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-23-2022 09:40 AM | |
| 1 | 02-23-2022 06:49 AM | |
| 1 | 02-23-2022 09:32 AM | |
| 2 | 07-08-2016 05:59 AM | |
| 6 | 05-22-2018 07:01 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-02-2022
05:16 PM
|