Selection only mode does not initially request any features. Features are added only when a selection is made. This mode is useful when you cannot or do not want to bring all features into the client, but you want to highlight one or more features for a certain reason.
For example, suppose you have a roads layer that's configured to use cartographic representations, which are not supported for display using a feature layer. You want to perform some Web editing on the roads, but that requires a feature layer. What do you do?
In this scenario, you configure a dynamic map service to show the roads, then use a feature layer with selection only mode to display just the road currently being edited. This selected road is drawn using a simple client-side symbol. Once the edit is applied, you can clear the selection and refresh the dynamic map service to see the updated roads.
I have a DMS setup to display 15 different layers... I would now like to add the function of displaying attributes about the features in an info window. It seems as if this isn't possible with a DMS, but is the purpose of Feature Layers...
queryTask = new esri.tasks.QueryTask("http://server/ArcGIS/rest/services/features/MapServer/0"); queryFilter = new esri.tasks.Query(); queryFilter.returnGeometry = true; queryFilter.maxAllowableOffset = 50; queryFilter.outFields = ["FEAT_NAME"]; queryFilter.geometry = evt.mapPoint; queryTask.execute(queryFilter,function(featureSet){ if (featureSet.features.length === 1){ showFeature(featureSet.features[0], evt); } else if (featureSet.features.length !== 0){ alert("Please Select a Single Feature."); } });
I'm having issues retrieving information from points and polylinesqueryFilter.geometry = evt.mapPoint;
Does this imply that a separate query/query execution/info window would need to be created for each separate layer? Are there best practices/methods of achieving this?
... when I query a point or polyline (and alter the /MapServer/# and the outFields accordingly), my query returns 0 results (it is a valid query). I'm wondering if it has something to do with the spatial relationship? I've attempted to max out the maxAllowableOffset, but that doesn't seem to alter anything. Does anyone have any ideas on this?
var pixelWidth = map.extent.getWidth() / map.width, queryTolerance = pixelWidth * 3, queryGeom = new esri.geometry.Extent({ 'xmin': evt.mapPoint.x - queryTolerance, 'ymin': evt.mapPoint.y - queryTolerance, 'xmax': evt.mapPoint.x + queryTolerance, 'ymax': evt.mapPoint.y + queryTolerance }); queryFilter.geometry = queryGeom;