Gmap3 - Forum

Gmap3 exchange platform

You are not logged in.

Ads
(server costs 27.50€ per month)


#1 2012-11-04 22:24:09

jeffz2012
Member
Registered: 2012-11-01
Posts: 2

info window to open on load

how to make window auto-open onload in code below (help appreciated):

$('#googleMap')
	.gmap3(
	{ action:'init',
	    options:{
		center:[49.651626,2.145664],
		zoom: 15
	    }
	},
      
	{ action: 'addMarkers',
	    markers:[
			{lat:49.628059, lng:2.117512, data:"some infoWin lbl"},
			{lat:49.59558, lng:2.121529, data:"some other infoWin lbl"}
		    ], 
	    marker:{
		  options:{
		      draggable: false
		  },
		  events:{
		      click: function(marker, event, data){
			  
			  var map = $(this).gmap3('get'),
			  infowindow = $(this).gmap3({action:'get', name:'infowindow'});
			  if (infowindow){
			      infowindow.setOptions({maxWidth:250});
			      infowindow.open(map, marker);
			      infowindow.setContent(data);
			  } else {
			      $(this).gmap3({action:'addinfowindow', anchor:marker, options:{content: data,maxWidth:250}});
			    
			  }
		      }
		  }

	      }
	  }

	  ,{action:"autofit"}

      );

Offline

Ads
(server costs 27.50€ per month)


#2 2012-11-06 19:32:26

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

Re: info window to open on load

auto open on which marker ?

you may set the code bind into a function and then call it manually, this is just javascript code, not google maps feature

Offline

Board footer

Powered by FluxBB