Select to view content in your preferred language

Editor: Cut Visible Sample with FeatureCollection

2395
15
08-05-2013 12:12 PM
DerivenC
New Contributor II
There used to be an example where you could cut features with the edit tools.  It has since been removed but still exists in the archives (and works):

http://developers.arcgis.com/en/javascript/samples/ed_editing_widget/index.html

A
nd the option in the configuration still exists by setting cutVisible to true:

https://developers.arcgis.com/en/javascript/jsapi/editor.html

M
y question is: can I use this option against a FeatureLayer that is constructed by a feature collection?
https://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#featurelayer2

I
can perform a union but the cut doesn't seem to work.  And without any documentation on the cut, I'm not sure if it ever worked for this type of scenario.

We are using ArcGIS for Server 10.0 and ArcGIS for JS 3.5.
0 Kudos
15 Replies
derekswingley1
Frequent Contributor II
When I noticed the lag, that told me that the cut tool didn't work.  I cannot recall if I tried my "bug fix" with a feature layer.  Maybe it works?


I didn't explicitly state it, but your bug fix is not necessary when using a feature layer that uses a layer from a feature service.

I appreciate the background and additional info about your app and system, but I'm still interested in answers to the questions from my previous post.

I also discussed using a feature layer from a feature collection with the editor and we are going to add better error messaging to components of the editor. In its current state, the editor allows certain operations to fail silently (as you've found).


Blame Kelly for opening my eyes to feature collections.  They are amazingly useful!


Agreed, feature layers from feature collections are a great thing but they are limiting when your app requires editing and/or advanced querying capabilities.
0 Kudos
KenBuja
MVP Esteemed Contributor
Agreed, feature layers from feature collections are a great thing but they are limiting when your app requires editing and/or advanced querying capabilities.


Is there information in the documentation about what makes feature layers from feature collections so great?
0 Kudos
derekswingley1
Frequent Contributor II
Is there information in the documentation about what makes feature layers from feature collections so great?


You get a feature layer w/o having to publish an arcgis server map or feature service. That may or may not appeal to you...the main sample in the SDK that does this takes data from a 3rd party (flickr) and creates a feature layer from it:  https://developers.arcgis.com/en/javascript/jssamples/fl_featureCollection.html
0 Kudos
DerivenC
New Contributor II
You get a feature layer w/o having to publish an arcgis server map or feature service. That may or may not appeal to you...the main sample in the SDK that does this takes data from a 3rd party (flickr) and creates a feature layer from it:  https://developers.arcgis.com/en/javascript/jssamples/fl_featureCollection.html


@kenbuja Replace everywhere Derek mentions "feature layer" with "feature collection".

@swingley I'll do my best to answer your questions.


  • how long are you waiting for the cut operation to complete?

For the ESRI samples, right now it takes about 2-3 seconds for the cut process to complete.  It takes about a second to start displaying any change.

  • do you see a request to the cut endpoint on tasks.arcgisonline.com?

I'm guessing this is in reference to my personal project.  No.  I use my own GeometryService from my own ArcGIS Server.

  • do you have a proxy set up when running this sample locally?

The sample, no.  Proxy within my personal project for layers, yes.  Even the GeometryService is proxied.  Interestingly, all of my cut requests are instantaneous.  No lag.
0 Kudos
derekswingley1
Frequent Contributor II


  • how long are you waiting for the cut operation to complete?

For the ESRI samples, right now it takes about 2-3 seconds for the cut process to complete.  It takes about a second to start displaying any change.

  • do you see a request to the cut endpoint on tasks.arcgisonline.com?

I'm guessing this is in reference to my personal project.  No.  I use my own GeometryService from my own ArcGIS Server.

  • do you have a proxy set up when running this sample locally?

The sample, no.  Proxy within my personal project for layers, yes.  Even the GeometryService is proxied.  Interestingly, all of my cut requests are instantaneous.  No lag.


Thanks. Since the sample in question doesn't include cut, you need to modify it and run it locally. When you do this, you have to have a proxy configured on the web server where you run the sample if you want to successfully use services on tasks.arcgisonline.com and sampleserver3.

I don't know where this leaves us...there are a number of moving parts here but I'll try to summarize:

  • the editor with cutVisible: true works as designed but requires a proxy on the web server where your app runs

  • the editor's cut tool is not supported with feature layers from feature collections and we'll do a better job of indicating this in the docs as well via a message logged to the browser's console when you try to do this

0 Kudos
DerivenC
New Contributor II
Thanks. Since the sample in question doesn't include cut, you need to modify it and run it locally. When you do this, you have to have a proxy configured on the web server where you run the sample if you want to successfully use services on tasks.arcgisonline.com and sampleserver3.

I don't know where this leaves us...there are a number of moving parts here but I'll try to summarize:

  • the editor with cutVisible: true works as designed but requires a proxy on the web server where your app runs

  • the editor's cut tool is not supported with feature layers from feature collections and we'll do a better job of indicating this in the docs as well via a message logged to the browser's console when you try to do this



Actually there is a sample that does it.  It's in the OP...
http://developers.arcgis.com/en/javascript/samples/ed_editing_widget/index.html

A
lso you don't need to alter the code and test locally.  That's what the ArcGIS sandbox is for.  I mention this in this thread and include the code to do so.  (I always CYA as best I can before posting here. heh)  It doesn't require a proxy.  Unless the sandbox is altering the code given it.

Even though it is not supported, I hope I can continue altering the API to support it.
0 Kudos