[OpenLayers-Users] registering a click on a marker
Tara Athan
tara_athan at alt2is.com
Sun Apr 6 23:17:49 EDT 2008
I am confused about how to register an event on a marker.
I have a marker layer at a coarse resolution, with markers assigned to
different variables.
I would like to have a click on the marker cause a zoom in to that
location, plus a replacement of the makers with a new set of markers
that show more detail for that location. I am using code like this
function handleMarkerClickEU(evt) {
map.setCenter(new OpenLayers.LonLat(13.000000,51.000000), 3);
var vols_cyball = new OpenLayers.Layer.Markers( 'volunteers
living in Europe (balloons)');
var vols_cynumb = new OpenLayers.Layer.Markers( 'volunteers
living in Europe (numbers)');
var vols_cytext = new OpenLayers.Layer.Text( "text", {location:
"../data/volsTextCYEU_utf8.csv"});
map.addLayers([vols_cyball, vols_cynumb, vols_cytext]);
<?php include 'volsBalloonsAndNumbersCYEU_utf8.php'; ?>
map.removeLayer(vols_ctball);
map.removeLayer(vols_ctnumb);
}
var markerEU = new OpenLayers.Marker(new
OpenLayers.LonLat(13.000000,51.000000),icon);
vols_ctball.addMarker( markerEU);
markerEU.events.register("onclick" , markerEU, handleMarkerClickEU);
which doesn't show any errors, but nothing happens.
The event handler worked OK when I registered it to the map, but not
when I register it to a marker.
Thanks for your help, Tara
--
My e-mail delivery has been unreliable lately, so I am asking for
return receipts from all my email messages.
OK'ing the return receipt lets me know that my message was delivered.
Thank you.
Tara Athan
Principal, Alternatives to Invasive Species
tara_athan [AT] alt2is.com
707-485-1198
PO Box 415
Redwood Valley, CA 95470
More information about the Users
mailing list