Gmap3 - Forum

Gmap3 exchange platform

You are not logged in.

Ads
(server costs 27.50€ per month)


#1 2011-11-24 17:55:50

stick
Member
Registered: 2011-11-24
Posts: 2

[solved] Close all infowindows before opening a new one

Hi all,

How can I can close all infowindows before opening a new one ?

I'm having 2 issues because of this :
- multiple click is allowed on a single marker, so the infowindow shadow appears several times
- user can open 10 infowindows simulteanously, he needs to close each window individually

Any idea about this please ?

Last edited by stick (2011-11-24 20:11:15)

Offline

Ads
(server costs 27.50€ per month)


#2 2011-11-24 20:01:14

jbdemonte
Administrator
From: Pourrières, France
Registered: 2011-11-21
Posts: 580

Re: [solved] Close all infowindows before opening a new one

using the function clear

Offline

#3 2011-11-24 20:10:56

stick
Member
Registered: 2011-11-24
Posts: 2

Re: [solved] Close all infowindows before opening a new one

I resolved this using the code above :

             events : {
	            click : function(marker, event) {
	            var infowindow = $(this).gmap3({
	                    action : 'get', name : 'infowindow'
	                });
	                if (infowindow) {
	                    infowindow.close();
	                }
	                // other code deleted here
	            },

Last edited by jbdemonte (2011-11-24 20:22:40)

Offline

#4 2011-11-24 20:22:11

jbdemonte
Administrator
From: Pourrières, France
Registered: 2011-11-21
Posts: 580

Re: [solved] Close all infowindows before opening a new one

Too long wink

events : {
    click : function(marker, event) {
        $(this).gmap3({action : 'clear', name : 'infowindow'});
        // other code deleted here
    },

PLease use BBCode to display code

Offline

#5 2012-10-10 08:16:44

resse
Member
Registered: 2012-10-10
Posts: 1

Re: [solved] Close all infowindows before opening a new one

the following are my question regarding poloygon

  1.) Is it possible to add multiple paths? then loop using .each or maybe similar to (i,marker)
  2.) Can I add mouseover and mouseout function to polygon? I want dynamically apply the polygon options during mousehover and mouseout.
 

action: 'addPolygon',
paths:[
	   [8.94879,125.53779],[8.94876,125.53871],[8.94814,125.53863],[8.94825,125.53773],[8.94879,125.53779],
        ],
events:{
 	 click: function(polygon,event){

                     $(this).gmap3({action : 'clear', name : 'infowindow'});

                      $(this).gmap3({
				  action:'addInfoWindow',
				  latLng:event.latLng, 
				  infowindow:{
						options:{
					       content: '<b> hello world </b>'
							    }
					         }
				});


             }
          }

Offline

Board footer

Powered by FluxBB