Draw polyline and show map infowindow

500
3
09-03-2020 12:12 PM
KafilBaig
New Contributor III

In my custom widget i have a datagrid and on row click i am showing the location and infowindow on map. For Point and polygon the infowindow shows correctly but for polyline it doesn’t show infowindow or draw the polyline for the geometry returned . It blanks out the map. Please guide me if am doing something wrong. Please find the code below.

 

Var polylinesymbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0,255,0]), 5), new Color([255,255,0,0.25]));

 

var clickPointGraphics = new Graphics(featureSet.features[0].geometry, polylinesymbol);

clickPointGraphics.setInfoTemplate(InfoTemplate);

 

this.map.graphics.add(clickPointGraphics);

this.map.infoWindow.SetTitle(title);

this.map.infoWindow.SetContent(Content);

this.map.infoWindow.show(featureSet.features[0].geometry, this.map.getInfoWindowAnchor(featureSet.features[0].geometry));

 

var stateExtent = featureSet.features[0].geometry.getExtent().expand(5.0);

this.map.setExtent(stateExtent);

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Kafil,

   You are passing a Polyline to the map infowindow show method and it is expecting a point geometry.

<Point> location -  Required - An instance of esri.geometry.Point that represents the geographic location to display the popup.

0 Kudos
KafilBaig
New Contributor III

I am unable to highlight the polyline geometry retrieved from my service . 

Also is the code correct what am doing or should I modify anything 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Did you read my reply?..

You are are try to show the info window using a polyline geometry.

0 Kudos