Change default of identified feature

3043
5
Jump to solution
01-11-2016 11:21 AM
JohnPreston
Occasional Contributor

Hi, I am using IdentifyTask with map.onclick then display attributes in a popup. Everything works great, however I would like to change the default color of found feature (right now it is default to a cyan). How can I do that?

var deferred = identifyTask                           

.execute(identifyParams)                           

.addCallback(function (response) {                               

     return arrayUtils.map(response, function (result) {                                   

     var feature = result.feature;                                                                     

     var layerName = result.layerName;                                   

     var idTemplate = new InfoTemplate();                                   

     idTemplate.setContent("Parcel ID:" + feature.attributes['PID_NUM'] + "
" +                                                 "Address:" + feature.attributes['site_address'] + "
" +                                                 "Owner:" + feature.attributes['owner_name'] + ");                                           

idTemplate.setTitle("Parcel");                                           

feature.setInfoTemplate(idTemplate);                                   

return feature;                               

});                           

});                 

map.infoWindow.setFeatures([deferred]);                 

map.infoWindow.show(evt.mapPoint);

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

John,

   The maps InfoWindow use PopUp dijit by default and the link I provided to to the properties of the PopUp dijit. Something as simple as:

map.infoWindow.markerSymbol = new MarkerSymbol();

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Emeritus

John,

   You set the markerSymbol or lineSymbol or fillSymbol on the map.infoWindow

0 Kudos
Ryan_Galbraith
New Contributor III

Thanks for that - I was just working on something very similar.

0 Kudos
JohnPreston
Occasional Contributor

Thank you Robert,

Do you have an example? I don't see those properties for map.infoWindow

John

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

John,

   The maps InfoWindow use PopUp dijit by default and the link I provided to to the properties of the PopUp dijit. Something as simple as:

map.infoWindow.markerSymbol = new MarkerSymbol();

JohnPreston
Occasional Contributor

Perfect! Thank you!

0 Kudos