|
POST
|
Hi, I'm using esri.request method to do adds, deletes, edits to a feature service in my app. And to add attachments. The behavior I'm experiencing is that the callback functions I am defining are fired immediately instead of waiting for the request to complete. The callback function for successful requests is supposed to refresh the map service, which it does, but too soon, and thus does not display the new data. Also, the function for failed requests gets fired even on successful requests. Here is an example section of code: function delIncident() { var feature = map.infoWindow.getSelectedFeature(); var incidentID = feature.attributes.incidentID; var url = esri.urlToObject("http://.../FeatureServer/1/applyEdits?deletes=" + String(incidentID) + "&f=json"); var requestHandle = esri.request({ url: url.path, content: url.query }, {useProxy:true, usePost:true}); requestHandle.then(reqSucceeded('delIncident'), reqFailed('delIncident') ); } I can make this work by using the javascript setTimeout method (to have the callback methods called only after a short delay), but I believe I should not have to do this. The weird part is that this was all working as expected at one point. Perhaps something I changed in another part of the code caused this but I can't find it if so. Using AGS 10.0 and jsapi 2.8. Anyone have an idea what's wrong here? Thanks.
... View more
06-06-2013
08:35 PM
|
0
|
2
|
4137
|
|
POST
|
Ok, looks like I have a couple options. I'll investigate these. Thanks for your help.
... View more
05-15-2013
06:36 AM
|
0
|
0
|
2716
|
|
POST
|
No, the webmap is internal only, so I can't share the id with you. I checked out the api reference for infoTemplate. This looks fairly straight forward. Looks like I would define the template and then use infoWindow.setContent(template).... Is there a sample for querying the layer in the webmap? There is one potential hitch in the giddyup. I'm customizing the infoWindow to show an image gallery of attachments. It works by connecting to the onSelectionChanged event of the infoWindow - dojo.connect(map.infoWindow, "onSelectionChange", displayAttachments); displayAttachments is the function which modifieds the info window interface.... That's not working either, for the programmatically launched popup.
... View more
05-14-2013
03:18 PM
|
0
|
0
|
2716
|
|
POST
|
I'm using a query task. The query task parameters are like: var query = new esri.tasks.Query();
query.outFields = ["ASSETNUMBER","Description","DateDiscovered","Severity","incidentID"];
query.returnGeometry = true;
query.where = "ASSETNUMBER = '" + selItem + "'"
queryTask.execute(query,zoomExtent);
... View more
05-14-2013
02:53 PM
|
0
|
0
|
2716
|
|
POST
|
Kelly, thanks for reply. That's better, but not quite right. I'm now getting the highlighting behavior as desired, and the popup is no longer displaying info from the previous click, but there is no content. Here is screenshot: [ATTACH=CONFIG]24310[/ATTACH] I know there is a setContent method, but assuming I should not need to use this as the title and content should be read from the feature. Any thoughts?
... View more
05-14-2013
01:16 PM
|
0
|
0
|
2716
|
|
POST
|
Jerome, thanks for the info. I know about that documentation, but feel that it lacks a useful example for what I'm trying to do. I ended up switching tacks a bit and got this to work using the applyEdits operation on the feature service. The syntax is like: var url = esri.urlToObject("http://webservices.nwmaps.net/ArcGIS/rest/services/ArcGISOnline/FOGIncidents/FeatureServer/1/applyEdits?deletes=" + String(incidentID) + "&f=json"); incidentID in above code is an alias for objectid. ApplyEdits does either an add, edit or delete operation depending on the parameters so it gets what I'm after. Still would like to see this spelled out better in ESRI REST docs.
... View more
02-25-2013
02:08 PM
|
1
|
1
|
1169
|
|
POST
|
Hi, I'm using ajax to make requests to feature services to add, edit or delete. I have this working for adding features like this. urlParams = "[{'attributes' : {'AssetNumber' : '" + asset + "', 'Description' : '" + description + "'}}]";
var url = esri.urlToObject("http://xxxxx/ArcGIS/rest/services/ArcGISOnline/FOGIncidents/FeatureServer/1/addFeatures?features=" + urlParams + "&f=json");
var requestHandle = esri.request({
url: url.path,
content: url.query,
load: addFogRequestSucceeded,
error: addFogRequestFailed
}, {useProxy:true, usePost:true}); This works great. But when it comes to the delete operation, I'm having trouble figuring out the syntax. This is not really documented in enough detail to be useful. I know that I can either provide a where clause or a list of obectids, but I need the exact syntax. I think it would be something like: urlParams = "'where' : 'incidentID = 1'";
var url = esri.urlToObject("http://xxx/ArcGIS/rest/services/ArcGISOnline/FOGIncidents/FeatureServer/1/deleteFeatures?" + urlParams + "&f=json");
var requestHandle = esri.request({
url: url.path,
content: url.query,
//load: delFogRequestSucceeded,
//error: delFogRequestFailed
}, {useProxy:true, usePost:true}); Are examples documented anywhere? ESRI? Could also use help with edit, add attachment and delete attachment. Thanks.
... View more
02-25-2013
10:46 AM
|
0
|
4
|
5326
|
|
POST
|
Hi, I am working on a javascript api application that consumes a web map. The default popup is great, but I would like to add a button or a hyperlink to the bottom of it. What is the easiest way to do this? I would rather not re-create the popup from scratch as I need the features such as attachments, paging, etc... that come with the web map popup. Thanks.
... View more
02-19-2013
12:52 PM
|
0
|
8
|
2103
|
|
POST
|
Hi, I have a simple javascript application which was created by downloading and modifying the basic viewer from arcgis.com. The app uses an arcgis.com webmap which has a popup with multiple charts configured. When accessing the popup via arcgis.com, the first chart is displayed with a small black arrow to the right of it which can be clicked to see the next chart and so on. However when using the popup via the custom app I have created, the arrow image does not show up. A user can click where the arrow should be and go to the next image, but most users would not even know to try this. My thought is that the image was not included in the downloaded code from arcgis.com. I can find or create a new image, but not sure what it should be named or where in the file structure it needs to go. Any help would be appreciated. Thanks.
... View more
09-16-2012
03:05 PM
|
0
|
1
|
549
|
|
POST
|
Turns out that the legend works differently depending on the version of the map service. If the map service was published with arcgis server version 10 sp1 or later, then the legend widget uses the REST api and the legend will work even if the map service is only available on an internal network. If the service is published from version 10 with no sp, it uses arcgis.com legend service and restrictions apply. Check the rest endpoint for your service. If there is a not a link for "Legend", you are dealing with an older version map service using arcgis.com. To ensure use of the rest api, you must install current service pack (sp4), for arcgis server web services. Also need to re-run the post install for arcgis server.
... View more
05-29-2012
07:34 PM
|
0
|
0
|
4027
|
|
POST
|
Drew, Thanks for the response. I will try this approach.
... View more
05-15-2012
11:27 AM
|
0
|
0
|
1650
|
|
POST
|
Mike, Thanks for the info. I assume this is a technical limitation. Is there any plan to address this in the next version?
... View more
05-14-2012
11:24 AM
|
0
|
0
|
4027
|
|
POST
|
My web map will not display a legend. When it loads in the arcgis.com viewer, on the legend tab it displays "Creating Legend" for a moment, then displays "No Legend". The map is using a map service published to arcgis.com with my EDN license. Its only accessible on my internal network. The map service is based on an msd file with several layers. Any ideas? Is there some way I can debug the issue using firebug or the like? Thanks
... View more
05-12-2012
07:56 AM
|
0
|
6
|
4775
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-20-2016 08:32 AM | |
| 1 | 08-16-2017 03:34 PM | |
| 4 | 12-09-2013 12:15 PM | |
| 4 | 12-09-2013 12:15 PM | |
| 1 | 10-20-2016 01:38 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|