Highlight SimpleMarkerSymbol when item on data grid is clicked (ArcGis - esri)

StackOverflow https://stackoverflow.com/questions/21910808

  •  14-10-2022
  •  | 
  •  

문제

Ideally what I'd like to happen is when an item from the data grid is clicked, the corresponding map icon would get a "halo" around it making it stand out from the other markers.

This is what I have based on Esri's exmaples but I'm missing something...

var sms = new esri.symbol.SimpleMarkerSymbol(
    esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE,
    new esri.symbol.SimpleLineSymbol(
        esri.symbol.SimpleLineSymbol.STYLE_SOLID,
        new dojo.Color([111, 0, 255]),
        2
    ),
    new dojo.Color([111, 0, 255, 0.15])
);  

this.map.graphics.add(new esri.Graphic(data.geometry, sms, { "type": "parcel-highlight" }));

I'm wondering if I'm using the wrong method here to accomplish what I'm trying to accomplish. There are no errors generated - the desired effect just isn't happening is all (well, nothing is happening actually).

도움이 되었습니까?

해결책

I was able to speak to the original developer who pointed me to the Esri legacy samples which provided the syntax for what I was trying to do.

var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([255,0,0]), 1),
new dojo.Color([0,255,0,0.25]));  
App.map.graphics.add(new esri.Graphic(queryResults[0].feature.geometry, symbol));
App.vent.trigger('Search:ShowIdentifyResult', [queryResults.features[0]]);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top