4

Background: I am dynamically populating a feature layer. On this feature layer I have set the symbol (as you can see) to a nice little .png image. Everything seems to work fine around the layer except there is a blue cross box around my selection. I have tried setting the feature layers selection symbol to no avail. After reading through the api docs I don't see what else it could be.

The blue cross box

Can someone please tell me:

  1. what this symbol is
  2. where it is coming from
  3. and possibly how to remove it

Here is my original code that isn't working as expected:

    var featureLayer = new esri.layers.FeatureLayer(featureCollection, {
    mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
    infoTemplate: template,
    outFields: ["Name"]
});

var infoSymbol = new esri.symbol.PictureMarkerSymbol({
    "angle": 0,
    "xoffset": 0,
    "yoffset": 12,
    "type": "esriPMS",
    "url": "/Images/map-marker.png",
    "contentType": "image/png",
    "width": 24,
    "height": 24
});

var renderer = new esri.renderer.SimpleRenderer(infoSymbol);
featureLayer.setRenderer(renderer);

var selectionSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE,
    10,
    new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255, 0, 0]), 2),
    new Color([255, 255, 0, 0.5])
    );
featureLayer.setSelectionSymbol(selectionSymbol);

2 Answers 2

1

From Arcmap Desktop this light blue is always the "selection" highlight color.

try changing the Color in this section of your code:

    var fieldsSelectionSymbol =
      new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
        new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT,
      new Color([255, 0, 0]), 2), new Color([255, 255, 0, 0.5]));

No Blue symbol http://maps.rosreestr.ru/arcgis_js_api/sdk/help/jssamples/fl_selectfeatures.html

Blue select symbol https://developers.arcgis.com/javascript/jssamples/fl_selectfeatures.html

3
  • In case he didn't set it originally. When you set up the FeatureLayer, you can add in the renderer for the the selected symbol. Ex.. YourFeatureLayerName.setSelectionSymbol(pass in the new symbol you want for selection). You might run into a conflict if you're setting the InfoTemplate on your map object, too.
    – Branco
    Nov 13, 2014 at 17:27
  • What kind of conflict should I be looking for with setting the InfoTemplate? Should I be setting the InfoTemplate a different way? I edited my post and added in my code if that is of any help. Nov 13, 2014 at 23:24
  • Pass a symbol to FeatureLayers setSelectionSymbol method, and set its opacity to 0. Dec 30, 2014 at 15:20
1
var selectionSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE,
    10,
    new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255, 0, 0]), 2),
    new Color([255, 255, 0, 0.5])
    );
featureLayer.setSelectionSymbol(selectionSymbol);
  1. this symbol is 'selectionSymbol' you defined as the above code
  2. you can try to remove featureLayer.setSelectionSymbol(selectionSymbol); and see what will happen.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.