Highlight point features

This device does not support 3D.

View the system requirements for more information.

This sample shows how to highlight features in a layer. Features in SceneLayer, FeatureLayer, CSVLayer, GeoRSSLayer and GraphicsLayer can be highlighted.

To highlight a feature, call the highlight method of the feature's corresponding layerView with the feature or its objectID as parameter. When passing features as parameters, they need to have an objectID.

view.whenLayerView(layer)
  .then(function(lyrView) {

    // if a feature is already highlighted, then remove the highlight
    if (highlightSelect) {
      highlightSelect.remove();
    }

    // set the highlight on the first feature returned by the query
    highlightSelect = lyrView.highlight(feature);
  });

Sample search results

TitleSample

There were no match results from your search criteria.