<div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); ">Oh, I forgot to put this part of the code, which is run just after the previous code:</span></div>
<div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); ">---------------------------8&lt;-</span><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); ">------------------------------</span><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); ">------------------------------</span><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); ">--------- </span></div>
<div>        entities.layer_office.events.on({</div><div>            &#39;featureselected&#39;: function (e) {onFeatureSelect(e.feature, entity.map, control)},</div><div>            &#39;featureunselected&#39;: function (evt) {onFeatureUnselect(evt.feature, entity.map) }</div>
<div>        });</div><div>... the same for suburbs.suburbs_layer...</div><div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); ">---------------------------8&lt;-</span><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); ">------------------------------</span><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); ">------------------------------</span><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); ">--------- </span></div>
<div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); "><br></span></div><div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: -moz-fixed; font-size: 12px; background-color: rgba(255, 255, 255, 0.917969); ">So, I create the control with the layers I want, and after that I use the layers.events.on to run something when the a feature is selected.</span></div>
<div><font class="Apple-style-span" color="#222222" face="-moz-fixed"><span class="Apple-style-span" style="font-size: 12px;">This is practically the same I saw in some examples. What could be wrong?</span></font></div><br>
<div class="gmail_quote">2011/12/3 emmexx <span dir="ltr">&lt;<a href="mailto:emmexx@tiscalinet.it">emmexx@tiscalinet.it</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Il 12/02/2011 01:45 AM, Diego Pasqualin scrisse:<br>
<div class="im"><br>
&gt; Any suggestion about what I might be doing wrong?<br>
<br>
</div>Try using eventListeners instead of OnSelect?<br>
Or layer.events.on().<br>
<br>
Bye<br>
        maxx<br>
</blockquote></div><br>