On Mon, Apr 7, 2008 at 5:17 AM, Tara Athan <[EMAIL PROTECTED]> wrote:
> 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);
Hi, try "click" instead of "onclick" ?
--
Eric
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users