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

Fernando Norte fernando at globalgeo.com.br
Tue Dec 4 10:27:52 PST 2012


Hi Pascal,

Your solution seems to confused to me.

The OpenLayers.Map is applied to an HTML element, a DIV actually.
You can create the button in the HTML, instead to create a jQuery function
to do so.
You can create only the toggle to the click event on this button, to
show/hide the DIV that is applied the OL.map().

Give a try on this way,

 *Fernando Norte*

Desenvolvedor SIGWeb

tel.(31) 2533.9900

cel.(31) 9119.8814

skype: fernandoglobalgeo

Endereço: Alameda do Ingá, 88, 6º andar, Vale do Sereno

Nova Lima/MG - CEP: 34.000-000

www.globalgeo.com.br

"O presente documento pode conter material confidencial ou seu sigilo é
protegido por lei.
Quaisquer informações nele contida são destinadas exclusivamente ao(s)
seu(s) destinatário(s)
não devendo em nenhuma hipótese ser repassado a terceiros".




2012/12/4 pascal <pascal2833 at gmail.com>

> 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.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121204/9091184a/attachment.html>


More information about the Users mailing list