<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Christopher Schmidt ha scritto:
<blockquote cite="mid:20071210125808.GB17459@metacarta.com" type="cite">
  <pre wrap="">On Mon, Dec 10, 2007 at 12:28:51PM +0100, Walter Lorenzetti wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi everybody,

I've a problem with a GML layer:
I add to my map a new GML layer and for to put a icon istead the normal
vectorial circle
I extend default vector layer style:

 var style_mark = OpenLayers.Util.extend({},
OpenLayers.Feature.Vector.style['default']);
     style_mark.graphicWidth = 16;
     style_mark.graphicHeight = 16;
     style_mark.graphicOpacity = 1;
     style_mark.externalGraphic = "/webgis/openlayers/stable/icon.png";

Now I've to add I popup to this mark but I don't know I can...
Is possible to do that or is necessary parser the GML file and put n
markers with popup?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Looking at <a class="moz-txt-link-freetext" href="http://openlayers.org/dev/doc/examples.html">http://openlayers.org/dev/doc/examples.html</a>, we see:

61
Open Popup on Layer.Vector
select-feature-openpopup.html
Using a Control.SelectFeature, open a popup on click. 

<a class="moz-txt-link-freetext" href="http://openlayers.org/dev/examples/select-feature-openpopup.html">http://openlayers.org/dev/examples/select-feature-openpopup.html</a>

Regards,
  </pre>
</blockquote>
<tt>Thank you Christopher,<br>
<br>
now "onSelect" works fine:<br>
<br>
&nbsp;var control =&nbsp; new OpenLayers.Control.SelectFeature(gml,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {onSelect: function(feature){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; OpenLayers.Console.log(feature.attributes.company);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br>
<br>
map.addControl(control);<br>
control.activate();<br>
<br>
but sorry is possible to do that for "onClick" event?<br>
on class documentation I found only Control.SelectFeature,
.DrawFeature... etc.. but not ClickFeature...<br>
<br>
So for you is possible to do that with events.register function?<br>
I try it but my problem is to take the attributes of gml feature:<br>
<br>
gml.events.register('click',this,function(){ </tt><tt>OpenLayers.Console.log</tt><tt>(this);
})<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
</tt>thank you<br>
<br>
Walter<br>
<br>
<pre class="moz-signature" cols="72">-- 
Please no  .doc, .xls, .ppt, .dwg:
<a class="moz-txt-link-freetext" href="https://www.faunalia.it/dokuwiki/doku.php?id=public:OpenFormats">https://www.faunalia.it/dokuwiki/doku.php?id=public:OpenFormats</a>

Walter Lorenzetti
email+jabber: <a class="moz-txt-link-abbreviated" href="mailto:lorenzetti@faunalia.it">lorenzetti@faunalia.it</a>
<a class="moz-txt-link-abbreviated" href="http://www.faunalia.it">www.faunalia.it</a>
Cell: (+39) 347-6597931  Tel+Fax: (+39) 0587-213742
Piazza Garibaldi 5 - 56025 Pontedera (PI), Italy</pre>
</body>
</html>