Tag Info

New answers tagged

1

The legend's layerInfos property has to be an array. You are passing in a function. You're also attempting to create the legend on each loop iteration. What you want to do is loop through your feature layers and create an array that you can pass to layerInfos. The basic legend widget sample shows this using dojo.map. Adapting your code to do this would look ...


0

The answer is to put the dojo.requires outside of the function instead of inside.


1

There may be an easier way of going about this - but the only way I have found to label vector layers in a GeoExt LegendPanel is to give them a style rule with a name. So for styles that dont require rules, i just add one elseFilter rule (so it will always match) and put the name of the layer / feature in its rule oject: new OpenLayers.Style( { ...


0

This is the final code: function init() { //some code here dojo.connect(map, "onLayersAddResult", updateSlider); dojo.connect(map, "onLayersAddResult", initLegend); } //Inicializacia legendy po starte. function initLegend(results){ var layerInfo = dojo.map(results, ...



Top 50 recent answers are included