<div dir="ltr"><div>you can register this function for click event by replacing <font size="2">hover:true  with hover:false    </font><b><font color="#7f0055" size="2"><font color="#7f0055" size="2">  </font></font></b></div>


<div> </div>
<div> </div>
<div><br clear="all">Regards<br><br>Sajeer <br><br><br><br></div>
<div class="gmail_quote">On Thu, Jul 16, 2009 at 3:38 PM, Adrian Popa <span dir="ltr">&lt;<a href="mailto:adrian_gh.popa@romtelecom.ro">adrian_gh.popa@romtelecom.ro</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div text="#000000" bgcolor="#ffffff">Hello Sajeer,<br><br>How do you register your functions to events so that they are executed on mouse over instead of on click? Or is your popup created when you click a feature?<br><br>

Thanks,<br><font color="#888888">Adrian</font> 
<div>
<div></div>
<div class="h5"><br><br>Sajeer... wrote: 
<blockquote type="cite">
<div dir="ltr"><font size="2">
<div align="left"><font color="#3f7f5f" size="2"><font color="#3f7f5f" size="2"><font color="#000000"><b><font color="#7f0055" size="2"><font color="#7f0055" size="2">
<p align="left">Hi,</p>
<p align="left">try this one,</p>
<p align="left"> </p>
<p align="left"> </p>
<p align="left">function</p></font></font></b></font></font><font size="2">onFeatureSelect(feature) {</font><font size="2"> 
<p align="left">selectedFeature = feature;</p>
<p align="left">popup = </p></font><b><font color="#7f0055" size="2"><font color="#7f0055" size="2">new</font></font></b></font></div></font><font size="2">OpenLayers.Popup.FramedCloud(</font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">&quot;&quot;</font></font><font size="2">, 
<p align="left">feature.geometry.getBounds().getCenterLonLat(),</p></font><b><font color="#7f0055" size="2"><font color="#7f0055" size="2">new</font></font></b><font size="2"> OpenLayers.Size(100,100), </font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">&quot;&lt;div style=&#39;padding:15px 5px 5px 10px;&#39;&gt;&quot;</font></font><font size="2">+ </font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">&quot;&lt;table style=&#39;font-size:13px;color:red&#39;&gt;&quot;</font></font><font size="2">+ </font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">&quot;&lt;tr&gt;&quot;</font></font><font size="2">+ </font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">&quot;&lt;td width=&#39;40%&#39;&gt;Name&lt;/td&gt;&quot;</font></font><font size="2">+ </font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">&quot;&lt;td width=&#39;5%&#39;&gt;:&lt;/td&gt;&quot;</font></font><font size="2">+ </font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">&quot;&lt;td&gt;&quot;</font></font><font size="2">+feature.attributes.label+</font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">&quot;&lt;/td&gt;&quot;</font></font><font size="2">+ </font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">&quot;&lt;/tr&gt;&quot;</font></font><font size="2">+</font><font size="2"> </font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">&quot;&lt;/table&gt;&lt;/div&gt;&quot;</font></font><font size="2">, </font><b><font color="#7f0055" size="2"><font color="#7f0055" size="2">null</font></font></b><font size="2">, </font><b><font color="#7f0055" size="2"><font color="#7f0055" size="2">true</font></font></b><font size="2">, onPopupClose); 
<p align="left">feature.popup = popup;</p></font><font size="2">map.addPopup(popup); 
<p align="left">}</p></font><b><font color="#7f0055" size="2"><font color="#7f0055" size="2">function</font></font></b><font size="2"> onPopupClose(evt) { 
<p align="left">selectControl.unselect(selectedFeature);</p></font><font size="2">
<p align="left">}</p></font><b><font color="#7f0055" size="2"><font color="#7f0055" size="2">function</font></font></b><font size="2"> onFeatureUnselect(feature) {</font> 
<p align="left"><b><font color="#7f0055" size="2"><font color="#7f0055" size="2">      </font></font></b><font size="2">map.removePopup(feature.popup);</font></p>
<p align="left">feature.popup.destroy();</p>
<p align="left">feature.popup = <b><font color="#7f0055" size="2"><font color="#7f0055" size="2">null</font></font></b><font size="2">;</font></p>
<p>}</p>
<p align="left"><font color="#000000">var</font><font color="#000000">  kmlLayer = new OpenLayers.Layer.</font><font color="#000000">GML(.............);</font></p><font size="2"></font></div>
<div align="left">  </div>
<div align="left">var selectControl = <b><font color="#7f0055" size="2"><font color="#7f0055" size="2">new</font></font></b><font size="2"> OpenLayers.Control.SelectFeature(kmlLayer,</font></div>
<p align="left">{hover: <b><font color="#7f0055" size="2"><font color="#7f0055" size="2">true</font></font></b><font size="2">,onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});</font></p><font size="2">
<p align="left">map.addControl(selectControl);</p>
<p>selectControl.activate();</p></font>
<div><br clear="all">Regards<br><br>Sajeer</div>
<div><br><br> </div>
<div class="gmail_quote">On Thu, Jul 16, 2009 at 3:07 PM, Adrian Popa <span dir="ltr">&lt;<a href="mailto:adrian_gh.popa@romtelecom.ro" target="_blank">adrian_gh.popa@romtelecom.ro</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div text="#000000" bgcolor="#ffffff">Hello Pavel,<br><br>Great idea... However - I would like to keep popups for when I click on an item. <br>Would it be possible to do something like:<br><br>layer.events.on({ &quot;featureselected&quot;: onLocationSelect, &quot;featureunselected&quot;: onLocationUnselect,  //open regular popups<br>

                                  &quot;onMouseOver&quot;: onLocationMouseOver, &quot;onMouseOut&quot;: onLocationMouseOut<br> });?<br><br>Problem is - I don&#39;t see those kinds of events on my layer. These are the event types for a vector layer:<br>

<span>0 &quot;beforefeatureadded&quot;</span> 
<div>1 &quot;beforefeaturesadded&quot;</div><span></span>
<div>2 &quot;featureadded&quot;</div><span></span>
<div>3 &quot;featuresadded&quot;</div><span></span>
<div>4 &quot;beforefeatureremoved&quot;</div><span></span>
<div>5 &quot;featureremoved&quot;</div><span></span>
<div>6 &quot;featuresremoved&quot;</div><span></span>
<div>7 &quot;beforefeatureselected&quot;</div><span></span>
<div>8 &quot;featureselected&quot;</div><span></span>
<div>9 &quot;featureunselected&quot;</div><span></span>
<div>10 &quot;beforefeaturemodified&quot;</div><span></span>
<div>11 &quot;featuremodified&quot;</div><span></span>
<div>12 &quot;afterfeaturemodified&quot;</div><span></span>
<div>13 &quot;vertexmodified&quot;</div><span></span>
<div>14 &quot;sketchstarted&quot;</div><span></span>
<div>15 &quot;sketchmodified&quot;</div><span></span>
<div>16 &quot;sketchcomplete&quot;</div><span></span>
<div>17 &quot;refresh&quot;</div><span></span>
<div>18 &quot;loadstart&quot;</div><span></span>
<div>19 &quot;loadend&quot;</div><span></span>
<div>20 &quot;loadcancel&quot;</div><span></span>
<div>21 &quot;visibilitychanged&quot;</div><span></span>
<div>22 &quot;move&quot;</div><span></span>
<div>23 <span>&quot;moveend&quot;</span><br></div><br>Any idea what the events would be? If they are supported?<br><br>Pavel Iacovlev wrote: 
<blockquote type="cite"><pre>There many possible ways around this problem.

One is rewrite/extend your popup code. Popup is triggered on mouseover
and on mouseout popup is hidden. You can style the popup so it looks
more like a tooltip/label.

On Thu, Jul 16, 2009 at 2:34 PM, Adrian
Popa<a href="mailto:adrian_gh.popa@romtelecom.ro" target="_blank">&lt;adrian_gh.popa@romtelecom.ro&gt;</a> wrote:
  </pre>
<div>
<div>
<blockquote type="cite"><pre>Hi,

Just a quick question - my users want to see the name of the city when
they are hovering over points loaded through KML in a vector layer. I
know this isn&#39;t supported, but are there plans to support such labels?

I&#39;m thinking a different strategy might be to override/inherit the
OpenLayers.Control.MousePosition class and based on coordinate changes,
load the name from the closest KML feature. It doesn&#39;t need to be too
accurate, but it can&#39;t be an exact match, because the mouse will never
get that close to the KML coordinates.
However this solution will be costly - because on every mouse move you
would have to go through all the KML items and see which match...

What are your ideas regarding this subject?

---

Adrian Popa
NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP &amp; Metro
Compartiment IP Core &amp; Backbone
Phone: +40 21 400 3099

_______________________________________________
Users mailing list
<a href="mailto:Users@openlayers.org" target="_blank">Users@openlayers.org</a>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a>

    </pre></blockquote><pre>  </pre></div></div></blockquote><br><br><pre cols="72">-- 
--- 
Adrian Popa
NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP &amp; Metro
Compartiment IP Core &amp; Backbone
Phone: +40 21 400 3099
    </pre></div><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openlayers.org" target="_blank">Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>

<br></blockquote></div><br></blockquote><br></div></div></div></blockquote></div><br></div>