Is there a way to turn off highlighting of borders when a graphic is clicked at the functional level?

I have a functional layer that clicks on a graphic, an info window appears with a summary that includes data from other graphic objects with the same "pond" name, the latest version of arcgis for javascript adds a function that underlines the border of the clicked graphic, then which I don't want as the pop-ups contain a summary of all graphics with the same attribute (pond name). Only highlighting an object with a click will cause confusion.

Is there a way to disable the top-level border of a clicked object?

+3


source to share


2 answers


Thanks for the answer. It was helpful. In my case, I had to use SimpleMarkerSymbol()

and SimpleLineSymbol()

, since I need to turn off highlighting for point and line functions. Here is my solution in case anyone else needs it:



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

      

+2


source


It's hard to tell without some code, but try this after instantiating the Map object:

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

      

This overrides the selection character used when the function 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>

      

+1


source







All Articles