How to highlight feature on one of the map layers

3395
1
12-31-2014 12:11 AM
Labels (1)
AnatoliiTerentiev
Occasional Contributor III

Dear Gurus!

Now I use next xaml :

 

        <esri:Map x:Name="myMap">             <esri:ArcGISDynamicMapServiceLayer ID="BaseLayer"                              Url="http://localhost:6080/ArcGIS/rest/services/streetRK/MapServer" />                 <esri:FeatureLayer    ID="routes_osm"                              Url="http://localhost:6080/ArcGIS/rest/services/streetRK/MapServer/1">                 </esri:FeatureLayer>             </esri:Map>

 

and next c#:

 

        public void OnLightRoadEvent(string code)         {             feature_code = code;             FeatureLayer featureLayer = myMap.Layers["routes_osm"] as FeatureLayer;             foreach (Graphic p in featureLayer.Graphics)             {                 if (p.Attributes["REF"].ToString() == feature_code)                     p.Selected = true;                 else                     p.Selected = false;             }         }

How to solve this problem only with the help of BaseLayer, without using additional routes_osm  layer?

andand next  next c#

anans

0 Kudos
1 Reply
nakulmanocha
Esri Regular Contributor

You can add Featurelayer in selection mode and then select or highlight features as shown in an example

Selecting a FeatureLayer Online

0 Kudos