POST
|
Noah, Same operation on a FeatureLayer from a FeatureService works like a charm. Thanks for helping me get to the bottom of it! Dave
... View more
01-16-2014
09:29 AM
|
0
|
0
|
1162
|
POST
|
Noah - the Apply Edits is not listed as a Supported Operation. I'll look into your suggestion and get back ASAP. Thanks! Dave
... View more
01-15-2014
03:04 PM
|
0
|
0
|
1162
|
POST
|
Noah, There's not much to it. Here is the web page:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestSaveDelete.aspx.vb" Inherits="HilandWeb.TestSaveDelete" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test Save and Delete Functions</title>
<script src="Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="http://js.arcgis.com/3.7/" type="text/javascript"></script>
<script type="text/javascript">
var ROWLayer;
var q;
require([
"esri/config",
"esri/layers/FeatureLayer",
"esri/geometry",
"esri/tasks/query",
"dojo/domReady!"
], function (
esriConfig,
FeatureLayer,
Geometry,
Query
) {
esriConfig.defaults.io.proxyUrl = "proxy.ashx";
esriConfig.defaults.io.alwaysUseProxy = true;
ROWLayer = new FeatureLayer("http://thegisserver/arcgis/rest/services/Hiland/ROW/MapServer/0",
{ outFields: ["*"] });
q = new Query();
});
function update() {
q.objectIds = [2395];
ROWLayer.queryFeatures(q, function (featureSet) {
if (featureSet.features.length == 1) {
var thisFeature = featureSet.features[0];
thisFeature.attributes.ContactName = 'Jake Lowther';
ROWLayer.applyEdits(null, [thisFeature], null);
}
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" onclick="javascript:update();" />
</div>
</form>
</body>
</html>
I'm using the proxy.ashx provided by ESRI. My config looks like this: <?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig mustMatch="false">
<serverUrls>
<serverUrl url="http://thegisserver/arcgis/rest/services/"
matchAll="true" token="FykBFF29p8_4Gt2nTw57Eh2G_yows8koT--8Z7Q__34cf6gQQDwGp1H59EZrBc1h "></serverUrl>
</serverUrls>
</ProxyConfig> When the page loads there is a successful call to the layer to establish the FeatureLayer (everything in the query string): GET /arcgis/rest/services/Hiland/ROW/MapServer/0?f=json&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback&token=FykBFF29p8_4Gt2nTw57Eh2G_yows8koT--8Z7Q__34cf6gQQDwGp1H59EZrBc1h HTTP/1.1 When the button is clicked the first call (queryFeatures) is successful (everything in the query string): GET /arcgis/rest/services/Hiland/ROW/MapServer/0/query?f=json&returnGeometry=true&spatialRel=esriSpatialRelIntersects&objectIds=2395&outFields=*&callback=dojo.io.script.jsonp_dojoIoScript2._jsonpCallback&token=FykBFF29p8_4Gt2nTw57Eh2G_yows8koT--8Z7Q__34cf6gQQDwGp1H59EZrBc1h HTTP/1.1 The the applyEdits call looks like this (token in the query string, f and updates in the body): POST /arcgis/rest/services/Hiland/ROW/MapServer/0/applyEdits?token=FykBFF29p8_4Gt2nTw57Eh2G_yows8koT--8Z7Q__34cf6gQQDwGp1H59EZrBc1h HTTP/1.1 But the result of the applyEdits is shown below (clearly not an applyEdits result...): [ATTACH=CONFIG]30505[/ATTACH] I believe that if you attempted to applyEdits to any secured FeatureLayer via the proxy using a token you would see similar results. Can you confirm? Thanks again, Dave
... View more
01-14-2014
02:30 PM
|
0
|
0
|
1162
|
POST
|
Noah, Thanks for the quick response. If I make the request without the proxy I receive a Login page in response (which makes sense, but tells me nothing about whether the request would be correct if it made it through). I am watching the requests and responses using Fiddler. Dave
... View more
01-14-2014
12:02 PM
|
0
|
0
|
1162
|
POST
|
I have configured the proxy.ashx with my URL and token and am successfully using it for GET requests (DynamicMapServiceLayer drawing and FeatureLayer.queryFeatures). When I try an operation that requires POST, things do not go as well. I'm attempting to call FeatureLayer.applyEdits as follows: ROWLayer.queryFeatures(q, function (featureSet) { if (featureSet.features.length == 1) { var thisFeature = featureSet.features[0]; thisFeature.attributes.ContactName = 'Some Body'; ROWLayer.applyEdits(null, [thisFeature], null); } }); The proxy appends the token to the URL which (I guess?) makes the POST request invalid or incorrect. The response I receive is the JSON version of the FeatureLayer info page. Can anyone tell me what I am doing wrong? Thanks in advance, Dave
... View more
01-14-2014
10:56 AM
|
0
|
9
|
1632
|
POST
|
Thanks Morten and Jennifer for your responses. I ended up using the REST API to get this information because I am using a 9.3 AGS.
... View more
08-26-2010
09:06 AM
|
0
|
0
|
178
|
POST
|
I am executing various queries against FeatureLayers and DynamicMapServiceLayers. My results (QueryEventArgs) include a FeatureSet. Digging into that you end up with a Graphic with Attributes. My question: How do I know the data type of a given attribute column? I initially thought I could just do theGraphic.Attributes(colName).GetType.FullName, but I have seen that the object will change from System.Int32 to System.Decimal within a column. This happens when the first value is 2335 and the second is 2335.5. I've considered hitting the REST service for the layer, but that seems like overkill when I see that the API has a Field class and FieldType enumeration that seem to be purposed with my question in mind. The only trouble is I cannot find where they are used or available. Thoughts?
... View more
08-24-2010
02:52 AM
|
0
|
3
|
528
|
POST
|
Jennifer, Thanks for the reply. I think you are exactly right, that there must be some version issue. The odd thing is that the solutions build with no trouble on my colleague's machine (clean, rebuild, clean, delete debug/obj folders, rebuild, etc...)! I have checked into a supposed issue with the HintPath setting VS2010/Silverlight in the vbproj file and added HintPath settings to my references - but I still believe that things are not lining up. Does anyone at ESRI know at what version(s) of the API the LayerInfo was added or modified? Thanks, Dave
... View more
08-10-2010
02:39 AM
|
0
|
0
|
205
|
POST
|
Why not just setup a timer in the Silverlight app and update your features every so often? You could even display a progress bar in your app informing the user how long until the next update.
... View more
08-09-2010
11:20 AM
|
0
|
0
|
137
|
POST
|
Hello All, Thanks in advance for your assistance with what is inevitably a user/installation issue. I have a Silverlight 4 application that uses the ESRI.ArcGIS assemblies. It runs as intended in my development environment, but not in my colleague's, and not on the development server. I have a feeling it could be because the codebase on my machine is using a different version of the assemblies, but I have done everything I can think of to ensure they are the same. The reason I suspect version difference is because the error message I get on the dev server is: Method not found: 'ESRI.ArcGIS.Client.FeatureLayerInfo ESRI.ArcGIS.Client.FeatureLayer.get_LayerInfo()'. To me, it seems like Visual Studio would never allow compilation if this method were missing and in fact shows no error on the only line referencing FeatureLayerInfo: For Each fName As String In (From f In CType(l, FeatureLayer).LayerInfo.Fields Select f.Name).ToList() lOutFields.Add(fName) Next Object Browser says that the FeatureLayerInfo resides in the ESRI.ArcGIS.Client assembly which, as referenced in my project (and on my colleague's project, AND the dev server), is 2.0.0.290. It feels like a wild goose chase. Any ideas what I am overlooking here? Thanks,
... View more
08-09-2010
11:05 AM
|
0
|
3
|
2015
|
POST
|
Cool, thanks for that tip Dave! And thanks for yours. I am going to go find that setting and get rid of all this excess code I've written, cool or not!
... View more
06-28-2010
08:07 AM
|
0
|
0
|
417
|
POST
|
You can use the approach applied here: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SDSMap The basic idea is to keep doing queries for the next 500 points until you don't get any more results back, and populate them in a graphics layer. I put this into place and it worked well. One tweak I would offer is to update the FeatureLayer instead of an associated GraphicsLayer. This is troublesome if you use the Initialized event because you get the first 500 points twice (once by default FeatureLayer bahvior and once in the LoadFeatures). I modified it to use the UpdateCompleted event so the timer does not begin firing until after the first 500 are back - then I get the best of all worlds.
... View more
06-28-2010
05:40 AM
|
0
|
0
|
417
|
POST
|
I considered adding a FullExtent DP to the Navigator control. Probably easier to do what you describe... Thanks
... View more
06-23-2010
04:03 PM
|
0
|
0
|
171
|
POST
|
Is there any way to specify the extent that the Navigation control uses for full extent either by using the ConstrainExtentBehavior or some other method?
... View more
06-23-2010
10:51 AM
|
0
|
3
|
576
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|