[OpenLayers-Users] Show and hide maps with a button in OpenLayers

pascal pascal2833 at gmail.com
Tue Dec 4 09:56:10 PST 2012


Hi, 

I want to show/not show a map in Open Layer by the use of a button (create
with JQuery).
This is my code  (espace_map1 = id create by var map_element1= new
OpenLayers.Map("espace_map1") ).

// Create button: 
$('#button_map1').button(); 
// TOGGLE /BOUTTON 1: 
var clic_b1= function click_b1(){createmap1();}; 
var clic2_b1= function click2_b1(){$("#espace_map1").remove();}; 
 
$(function toggle_fonct() 
{ 
$("#boutton_map1").toggle(click_b1,click2_b1); 
}); // end toogle fonction

•	The toogle function works (if click2_b1 = alert(« something ») ; these
lines create the map and then write something and then create the map etc …
•	But in this case, i can't see the map after the click2. I've tried with
.hide() (and not remove) but it's the same.
How can i solve this problem ? 
Thanks a lot !

Pascal.




--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Show-and-hide-maps-with-a-button-in-OpenLayers-tp5020705.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list