简体   繁体   English

Adsense Google MAP API未显示MAP

[英]Adsense Google MAP API not showing up the MAP

I am following this link to create Adsense on GMAP https://developers.google.com/maps/documentation/javascript/examples/ads-adunit 我正在点击此链接以在GMAP上创建Adsense 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. 但是,当我在我的网站上仅将广告和MAP的某些部分仅突出显示时,我也尝试通过Firebug工具调试视图,但未发现任何隐藏的属性或错误。 The same code i have implemented. 我已经实现了相同的代码。

pastebin.com/AbEEExSa pastebin.com/AbEEExSa

GMAP

Since it shows grey color in the map-canvas , it seems to be a refresh problem. 由于它在map-canvas显示为灰色,因此似乎是一个刷新问题。 This can be solved by triggering the resize of the Google maps. 这可以通过触发Google地图的resize来解决。

google.maps.event.trigger(map, "resize");

Try adding this line after the completion of adunit API(success callback of this API). adunit API(此API的成功回调)完成后,尝试添加此行。

FYI: 供参考:
resize : Developers should trigger this event on the map when the div changes size: google.maps.event.trigger(map, 'resize') . resize :当div更改大小时,开发人员应在地图上触发此事件: google.maps.event.trigger(map, 'resize')

Updates: 更新:

I tried using the code that you have pasted in codebin, removing the php and parts that you have commented. 我尝试使用您粘贴在代码仓中的代码,删除了您已注释的php和部件。 It is working . 它正在工作 I'm not sure what your php code does. 我不确定您的php代码是做什么的。 So try debugging like in the fiddle. 因此,尝试像小提琴一样进行调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM