Gmap3 - Forum

Gmap3 exchange platform

You are not logged in.

Ads
(server costs 27.50€ per month)


#1 2014-09-10 10:27:19

vlowe
Member
Registered: 2012-07-04
Posts: 15

accessing marker data

Hi,

I am adding markers with tags and data attributes like this:

$('#map').gmap3({
		action: 'addMarker',
		lat: lati,
		lng: longi,
		tag: name,
		data: name,
		options: {  .............

I then want to loop over my markers and access these attributes but i cannot? How can i do that?

var markers = $('#map').gmap3({action:'get',name:'marker',all:true})
for( var i = 0; i < markers.length; i++ ) {
    console.log(i.tag);
}

Thanks

Last edited by vlowe (2014-09-10 10:29:50)

Offline

Ads
(server costs 27.50€ per month)


#2 2014-09-10 12:18:36

vlowe
Member
Registered: 2012-07-04
Posts: 15

Re: accessing marker data

Hi, just an update

I set the attribute again in the callback and now it works.

callback: function (marker) {
	marker['tag'] = name;
}

Offline

Board footer

Powered by FluxBB