-
Notifications
You must be signed in to change notification settings - Fork 382
Add Google Adsense to Google Maps
apneadiving edited this page May 1, 2012
·
2 revisions
<%= gmaps({
...
"map_options" => {"libraries" => ["adsense"] },
...
})
%>
Gmaps.map.callback = function() {
var adUnitDiv, adUnitOptions;
adUnitDiv = document.createElement("div");
adUnitOptions = {
format: google.maps.adsense.AdFormat.HALF_BANNER,
position: google.maps.ControlPosition.RIGHT_BOTTOM,
map: Gmaps.map.serviceObject,
visible: true,
publisherId: "ca-pub-3964215240206120"
};
new google.maps.adsense.AdUnit(adUnitDiv, adUnitOptions);
};
Documentation: http://code.google.com/intl/en/apis/maps/documentation/javascript/advertising.html