I am following this link to create Adsense on GMAP https://developers.google.com/maps/documentation/javascript/examples/ads-adunit
But when i implemented it on my website only ads and some part of MAP only highlighted, I also tried to debug the view from the firebug tool but not found any hidden property or error. The same code i have implemented.
Since it shows grey color in the map-canvas
, it seems to be a refresh problem. This can be solved by triggering the resize
of the Google maps.
google.maps.event.trigger(map, "resize");
Try adding this line after the completion of adunit
API(success callback of this API).
FYI:
resize
: Developers should trigger this event on the map when the div changes size:google.maps.event.trigger(map, 'resize')
.
I tried using the code that you have pasted in codebin, removing the php and parts that you have commented. It is working . I'm not sure what your php code does. So try debugging like in the fiddle.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.