Select to view content in your preferred language

display symbol (featurelayer) in infowindow ?

2073
1
09-11-2015 05:29 AM
VincentChoffrut
New Contributor

hello everyone,

thanx for your attention.

I'm programming a (simple) infowindow that displays the fields attributes of a featurelayer and I would like it to also display the symbol of the object.

here the code sample, it works very well but the symbol in the infowindow is undefined.

check on line 7 for ??? : that's where a little something is wrong (most probably), and I just can get my hand on it...

does anyone has a clue?

thanx again in advance!

greetings from France

IW_geol_reg = new FeatureLayer("http://194.57.254.69/arcgis/rest/services/AGES_carto/INFOWINDOW_THEME_1/MapServer/4",{opacity:0.8, outFields: ["OBJECT", "DESCRIPTION", "DATE"]});

// affichage infobulle :

IW_geol_reg.on("mouse-over", function(evt){

map.infoWindow.setTitle("<b>" + evt.graphic.attributes.OBJECT  + "</b>");

map.infoWindow.setContent("<b>" + evt.graphic.attributes.DESCRIPTION + "</b>" + "</br> <u>Datation</u> : <i>" +                       evt.graphic.attributes.DATE + "</i> </br>" + evt.graphic.symbol.???);

map.infoWindow.show(evt.mapPoint,InfoWindow.ANCHOR_UPPERLEFT);

});

IW_geol_reg.on("mouse-out", function(evt){

map.infoWindow.hide();

});

0 Kudos
1 Reply
JoshHevenor
Occasional Contributor II

I'm sure someone will have an easier way that I've missed.

If there's a mapservice along with your featureservice you can inspect the legend info:

..../arcgis/rest/services/layer/MapServer/legend?f=pjson

Filter the response by layerName and you can either construct the appropriate URL, or use the imageData to inline your image.

0 Kudos