Hi everyone,
I have users that request features to be created from when they "Identify" a feature in a map service. I am familiar with leveraging the arcpy FeatureSet class to obtain a json expression and forming features via that method, but from Operations supported in a REST interface. Would there be a way to capture the results of an Identify event when a user selects a feature on a map, and recording those results, so that they can be passed into the FeatureSet?
Are you working in ArcMap or a web app with ArcGIS Javascript API?
Webapp. When I enable a popup, and click on a point on the map that falls within the feature layer, the service returns the attributes associated with that feature. I'm trying to come up with a way to do it by leveraging a script, so that the feature and its attributes may be copied to a fgdb feature class.
You might have to make your own geoprocessing service and call it with ArcGIS API for JavaScript
first add a button on the pop - up info in order to fire the creation
statsLink = dojo.create("a", {
"class": "action",
"innerHTML": "<img id='popupVSinfo' style ='WIDTH: 20px; HEIGHT: 20px' title='Create New Feature' src='images/InfoToolArea.png' >",
"href": "javascript:void(0);"
}, dojo.query(".actionList", map.infoWindow.domNode)[0] );
assign a function on this button
dojo.connect(statsLink, "onclick", CreateNewFeature);
inside the function get the selected feature
var graphic = map.infoWindow.getSelectedFeature();
and continue to apply edits on your feature service
FeatureLayer | API Reference | ArcGIS API for JavaScript
require([
"esri/layers/FeatureLayer", ...
], function(FeatureLayer, ... ) {
var firePerimeterFL = new FeatureLayer( ... );
var targetGraphic = firePerimeterFL.getSelectedFeatures()[0].setGeometry(reshapedGeometry);
firePerimeterFL.applyEdits(null, [targetGraphic], null);
...
});
Thanks, but I'm working with a map service, not a feature service. So, would the getSelectedFeature() command still work?
pop - up can be enabled to Dynamic and Feature Services.
Try to use it because the selected coming from the infowindow
map.infoWindow.getSelectedFeature();