POST
|
You guys are right. I didn't realize this applyEdit function. Thanks!
... View more
01-23-2012
08:49 AM
|
0
|
0
|
298
|
POST
|
Hi, All, I have a quick question of how to call add Features function from my code. Anybody could share your code snippet would be greatly appreciated. I got error message saying parameters are not valid if I try this: request.features = {[ { "attributes" : { "req_id" : "508389", "req_type" : "Graffiti Complaint - Public Property", "req_date" : "09\/19\/2009", "req_time" : "18:44", "address" : "11TH ST and HARRISON ST", "x_coord" : "6008925.0", "y_coord" : "2108713.8", "district" : "6", "status" : 1 }, "geometry" : { "x" : -122.41247978999991, "y" : 37.770630098000083 } } ]}; url = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0/addFeatures"; getJson(request, url, handler, errorHandler); }; getJson: function (request, uri, handler, errorHandler) { request.f = "json"; dojo.io.script.get({ url: uri, content: request, callbackParamName: "callback", load: function (result, args) { cmp.util.handler(result, args, uri, handler, errorHandler); }, error: function (result, args) { cmp.util.errorHandler(result, args, uri, errorHandler); } }); } Should I use post method instead of get method even though my data is very small? Thanks, Gang
... View more
01-23-2012
06:27 AM
|
0
|
3
|
800
|
POST
|
I have a scenario where the users would like to be able to display on the map their current location from a GPS unit connected to the PC. Is this even possible? I looked through the API Reference and didn't see GPS related classes yet. Anyway, if it is possible, anybody have any pointers to get me started? Thanks, Gang
... View more
11-22-2011
10:22 AM
|
0
|
3
|
983
|
POST
|
Hi, Mike, The main issue is how to create a feature layer based on a table from a file GDB. I think in Runtime, the only way to editing a table is to create a feature layer for it, right? My mpk has a feature class included and I tried to create a feature layer based on the published map service url, but not success. See the attached code. I noticed that the table has been published to a url such as http://127.0.0.1:50001/HZzFyC/arcgis/rest/services/crashreporter66/FeatureServer/1[/url]. That is a Json format: { "capabilities": "Query,Editing,Create,Update,Delete,applyEdits,addAttachment,updateAttachment,deleteAttachments", "copyrightText": "", "currentVersion": 10.1, "description": "", "displayField": "P12_DriverName", "editFieldsInfo": null, "fields": [ { "alias": "OBJECTID", "domain": null, "editable": false, "name": "OBJECTID", "nullable": false, "type": "esriFieldTypeOID" },..... } Attached codes: using System.Windows; using ESRI.ArcGIS.Client.Local; using ESRI.ArcGIS.Client; using ESRI.ArcGIS.Client.Geometry; using ESRI.ArcGIS.Client.Symbols; using System.Windows.Media; using ESRI.ArcGIS.Client.Tasks; using System; using System.Collections.Generic; namespace test { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { ArcGISLocalFeatureLayer _LocalFeatureLayer; LocalFeatureService localFeatureService; FeatureLayer featureLayer; public MainWindow() { InitializeComponent(); localFeatureService = new LocalFeatureService() { Path = @"C:\temp\testRuntime\data\CrashReporter66.mpk", MaxRecords = 100000 }; localFeatureService.StartAsync(x => { _LocalFeatureLayer = new ArcGISLocalFeatureLayer() { LayerId = 0, Service = localFeatureService, ID = "EditLayer", OutFields = new ESRI.ArcGIS.Client.Tasks.OutFields() { "*" } }; SimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol() { Color = new SolidColorBrush(System.Windows.Media.Colors.Red), Size = 25, Style = SimpleMarkerSymbol.SimpleMarkerStyle.Circle }; _LocalFeatureLayer.Renderer = new SimpleRenderer() { Symbol = simpleMarkerSymbol }; Envelope initialExtent = new ESRI.ArcGIS.Client.Geometry.Envelope( new MapPoint(-8641480, 5334713.38), new MapPoint(-8638008.8, 5355748.8)); initialExtent.SpatialReference = new SpatialReference(102100); MapControl.Extent = initialExtent; MapControl.Layers.Add(_LocalFeatureLayer); }); } private void Button_Click(object sender, RoutedEventArgs e) { int count= _LocalFeatureLayer.Graphics.Count; FeatureLayer fl = new FeatureLayer(); fl.Url = localFeatureService.UrlFeatureService +"/1"; fl.Initialize(); fl.Initialized += (ss, ee) => { MessageBox.Show("Failed"); // Failed!!! }; } } } Any more idea?
... View more
11-16-2011
02:47 PM
|
0
|
0
|
358
|
POST
|
Hi, All, The question is about how to edit a table from mpk which is based on a file GDB. I tried to create a local map service with feature layer, but get an error saying it is a table, but not a feature layer. I notice a table layer in the published map services is a Joson format. I want to know what is the best way to write a new record to a table inside Runtime and how to read out the coded values out of a table easily? Thanks, Gang Attached code: localFeatureService = new LocalFeatureService() { Path = @"C:\temp\testRuntime\Data\CrashReporter.mpk" }; localFeatureService.StartAsync(x => { _LocalFeatureLayer = new ArcGISLocalFeatureLayer() { LayerId = 1, // a table Service = localFeatureService, ID = "EditLayer", Editable = true, AutoSave = false, Mode = FeatureLayer.QueryMode.Snapshot, DisableClientCaching = true, OutFields = new ESRI.ArcGIS.Client.Tasks.OutFields() { "*" }, }; ESRI.ArcGIS.Client.Geometry.Envelope initialExtent = new ESRI.ArcGIS.Client.Geometry.Envelope( new MapPoint(-8642235.3, 5329542.9), new MapPoint(-8641082.8, 5330365.3)); initialExtent.SpatialReference = new SpatialReference(102100); MapControl.Extent = initialExtent; MapControl.Layers.Add(_LocalFeatureLayer);
... View more
11-15-2011
10:54 AM
|
0
|
7
|
2243
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|