0

I am a web programmer with no GIS experience and I am working with a GIS specialist with no web service experience. I am using the JavaScript API 3.7 but I am not very familiar with the API.

I have a select list containing unique identifiers for line segments within a layer. I can currently zoom to the location of the segment on change of the select but I would also like to highlight the selected segment on the map. I have set up a executeIdentifyTask on click of the map. I am not sure if I should call the click method and pass it the coordinates of the segment or if there is a different identify method that I should be using instead.

Chris W
15.8k2 gold badges30 silver badges47 bronze badges
asked Dec 10, 2013 at 0:43
1

1 Answer 1

1

You need to create a graphic. If you are already zooming to the feature you should have the feature's geometry. A basic graphic consists of a geometry and a symbol but can also include attributes and an infoTemplate. It might look like the following:

require (['esri/graphic','dojo/_base/Color'], function addGraphic(geometry)
{
 //assuming your 'segments' are polylines
 var graphic;
 if(geometry.type === 'polyline')
 {
 require(['esri/symbols/SimpleLineSymbol'],function()
 {
 var sls= new SimpleLineSymbol('STYLE_SOLID', new Color([255,0,0]), 2);
 graphic = new Graphic(geometry, sls);
 });
 }
 map.graphics.add(graphic);
});
answered Dec 31, 2013 at 20:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.