I'm using the gmap3 jQuery panel to load a map and putting a marker onto the map. I'd like to retrieve additional data when clicking on a marker. I have a side div called #panel
and a div for the map, called #mappa
. When the map is initialized, I add a marker with this code:
$('#mappa').gmap3({
marker:{
values:[{ latLng:[48.8620722, 2.352047], id:"1" }],
events: {
click: function() {
$('#panel').load('ajax/test.html')
}
}
}
});
This is working quite well, but now, being a jQuery newbie, have to ask some help. The id
value of the marker is the id
of a wordpress post that contains additional info about the marker's place. I'd like to call, via AJAX, the post with id=somenumber
and load it into the panel. I don't understand how to reference to the marker id
inside the function, though.