<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I managed to close my active popups before doing the refresh.<br>
Here's what I did on my example:<br>
<br>
<tt>function updateMarkers(){ <br>
//see if we have an active marker opened<br>
var openMarker = null;<br>
if(markers.selectedFeatures.length == 1){<br>
//save the marker
details <br>
openMarker =
markers.selectedFeatures[0].attributes['description'];<br>
//close this
popup <br>
map.removePopup(document.getElementById("chicken")); <br>
markers.selectedFeatures[0].popup.destroy();
<br>
delete
markers.selectedFeatures[0].popup; <br>
select.unselectAll();<br>
}<br>
<br>
//do the refresh<br>
markers.refresh({force: true});<br>
}</tt><br>
<br>
Now, after the refresh is done, I would like to open again the popup. I
would prefer to generate a click event at the coordinates stored in <i>openMarker</i>
and let the click handler deal with popup creation. The idea is that
after refresh I might not get the popup at those coordinates, so the
click event would not do anything...<br>
<br>
Any ideas how I trigger a click at some specific coordinates? Or if
that's not possible - how can I find a marker (in the markers.features
array) which has my coordinates without going through the whole array?<br>
<br>
Thanks,<br>
Adrian<br>
<br>
Adrian Popa wrote:
<blockquote cite="mid:4A5B3A16.8060900@romtelecom.ro" type="cite">
<pre wrap="">Hi everyone,
I'd like your help with a javascript problem.
I want to draw markers from a script that generates KML output and I
have follows the sundials example:
<a class="moz-txt-link-freetext" href="http://openlayers.org/dev/examples/sundials-spherical-mercator.html">http://openlayers.org/dev/examples/sundials-spherical-mercator.html</a>
However, if I want to refresh the KML layer and I have an open popup,
the popup div will no longer close after the layer refresh. You can see
this problem for yourselves in the above example, by clicking on a
sundial and then issuing the command (in firebug):
map.layers[2].refresh({force:true});
This will cause the browser to re-get the KML data for the layer - and
the open popup will no longer respond to commands.
My question is - how can I close the popup and re-open it after refresh?
I understand that I will need to write some code for that to work - but
I would like to know if I can send click events so that the usual
functions will do what they need to do. Any help is appreciated.
Regards,
Adrian
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@openlayers.org">Users@openlayers.org</a>
<a class="moz-txt-link-freetext" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>