1

I have a map service that has 2 layers. One is a polygon layer that contains a combination of polygons, and the other is a point layer that contains many points located both inside and outside of the large polygon in the form of a graphic layer.

How to highlight the polygon layer within the point layer(in graphic form). using ArcGIS server and ArcGIS javascript api,

1 Answer 1

1

First define a hightlightening style to the polygons layer, with a selection symbol.

Then select a polygon, using an intersection between Polygons and Points.

var selectionSymbol = new SimpleFillSymbol().setColor(new Color([255,255,0,0.5]));
polygonsLayer.setSelectionSymbol(selectionSymbol);

var query = new Query();
query.geometry = a_point_geometry;
query.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;
polygonsLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, function (feature) {
  map.centerAt(feature[0].geometry.getCentroid());
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.