You can see below, my code to show a map and markers (from Json):
$('#map_canvas').gmap().bind('init', function() {
$.getJSON( '../js/locate.php', function(data) {
$.each( data.markers, function(i, marker) {
var mapvalue=new google.maps.LatLng(marker.latitude, marker.longitude);
$('#map_canvas').gmap('addMarker', {
'tags': [''+marker.category+''],
'position': mapvalue,
'bounds': true,
'icon':'../images/'+marker.category+'.png',
'animation':google.maps.Animation.DROP
}).click(function() {
$('#map_canvas').gmap('openInfoWindow', { 'content': ''+marker.category+'<BR><div id="cust_content"></div>' }, this);
setTimeout("opencust(\'" +marker.id+"\');",100);
});
});
});
});
How can I include the new adsense script on my map: https://developers.google.com/maps/documentation/javascript/advertising#AdvertisingAdUnit
Thanks for your help!
After a little research I made it work with few changes. You need to perform the following steps.
First include Adsense in your Google Maps JS. Notice the addition of libraries=adsense&
Modify your JS as below. Notice $(‘#map_canvas’).gmap(‘get’,’map’)