Domanda

Please provide some help regarding :

I have created a map using esri.geometry.Multipoint, i want to change the color of particular marker onClick event. I hav tried ,but its changing the all the marker color i.e applied on a full layer.

I am using arcgis javascript api3.5

   layer.add(graphic);
    map.addLayer(layer);
    dojo.connect(layer,'onClick',layer,function(evt)
    {
        var g = this.graphics[0];
        var symbolchange = esri.symbol.PictureMarkerSymbol('http://../resource/images/location.png', 50, 50);
        g.setSymbol(symbolchange);
    });

Thanx in advance....................

È stato utile?

Soluzione

if you add a graphics to map you can use this event

dojo.connect(map.graphics,'onClick',function(evt){});

but if you want do this with already layer you can use it for 'featureLayer'

dojo.connect(layername, "onSelectionComplete", function (evt) {});
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top