Hi, 
I'm trying to use the OpenLayers.Event.observe(); function to integrate a
click event to a jQuery button but i don't know how to do:
That's what I'm doing:
1) 
I'm trying to integrate this fonction in the init() function:

mapelement1.addLayers([baselayer, wms1]); 
OpenLayers.Event.observe(OpenLayers.Util.getElement("boutton_map1"),
"onclick", alert(555));
} // End of init() function.

Then, I create the button in JQuery function:
$(document).ready(function()
{ 
        createmap1();
        // Create button:
        $('#boutton_map1').button();
}); // End JQuery function
}); // Fin JQ
 
Result: When the page start, I have the alert message 555 (I don't want
this!) but when I´m doing click on the button, noting occurs.

2) 
If I´m trying put the OpenLayers.Event.observe() function in the JQuery
function, it happens the same.

Two questions: 
1) what's wrong?
2) Is it possible to put the OpenLayers.Event.observe() function in the
JQuery function?

Thanks a lot, 

Pascal.




--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/OpenLayers-Event-observe-tp5022698.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to