4

I have a feature layer, which click a graphic object, an info window pops up with a summary that include the data of other graphic objects with same "pond" name, the latest arcgis for javascript version adds a feature which highlights the boundary of clicked graphic object, that's what I don't want since the popups contains the summary of all graphic objects with same attribute(pond name). Only highlight the clicked object will cause confusion.

Is there a way to disable the hightlight boundary of the clicked object?

Vikash Pandey
  • 5,407
  • 6
  • 41
  • 42

2 Answers2

2

Thanks for the answer. It was helpful. In my case, I had to use SimpleMarkerSymbol() and SimpleLineSymbol() since I need to turn off the highlights for point and line features. Here is my solution if anyone else needs:

require(["esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol",], function(SimpleMarkerSymbol, SimpleLineSymbol))
{
  map.infoWindow.markerSymbol = new SimpleMarkerSymbol().setSize("0");
  map.infoWindow.lineSymbol = new SimpleLineSymbol().setWidth(0);
}
Cem
  • 21
  • 3
1

It's hard to say without any code, but try this after you instantiate your Map object:

map.infoWindow.fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_NULL);

That overrides the highlight symbol used when a feature is clicked.

Here's a complete example:

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
        <title>Disable Highlighting</title>
        <link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
        <style>
            html, body, #map {
                height: 100%;
                width: 100%;
                margin: 0;
                padding: 0;
            }
            body {
                background-color: #FFF;
                overflow: hidden;
                font-family: "Trebuchet MS";
            }
        </style>
        <script src="http://js.arcgis.com/3.14/"></script>
        <script>
            var map;
            var featureLayer;

            require(["esri/map", "esri/layers/FeatureLayer", "esri/InfoTemplate",
                    "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/Color",
                    "dojo/domReady!"],
            function(Map, FeatureLayer, InfoTemplate,
                    SimpleFillSymbol, SimpleLineSymbol, Color) {
                map = new Map("map", {
                    basemap: "topo",
                    center: [-122.45, 37.75],
                    zoom: 4
                });

                featureLayer = new FeatureLayer("http://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/CDC_Weekly_Flu_Surveillance_Map/FeatureServer/0", {
                    infoTemplate: new InfoTemplate()
                });
                //The following line overrides the highlight symbol used when a feature is clicked.
                map.infoWindow.fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_NULL);
                map.addLayer(featureLayer);
            });
        </script>
    </head>

    <body>
        <div id="map"></div>
    </body>
</html>
Gary Sheppard
  • 4,764
  • 3
  • 25
  • 35