Google地图无法正常运行

时间:2009-10-13 23:19:07

标签: javascript dom google-maps maps

我的Google地图代码全部平方且有效,但不会在页面上加载。这是有问题的页面,我有完整的代码可用性,不知道它为什么会破坏:

http://whs.rjuhsd.us/calendar/map

Gmaps JS位于标题中,带有正确的密钥。传感器设置为true,元素在文档中定义,正确显示,位于正确位置并可供用户使用。

HALP?

3 个答案:

答案 0 :(得分:3)

看起来你在jQuery和Prototype之间存在冲突。

使用jQuery的noConflict模式。

PS:你为什么要同时使用它们?

答案 1 :(得分:1)

Chetan是对的,你遇到了jquery和Prototype之间的冲突。我看到你已经调用了jquery.noConflict()一次,但之后又将jquery导入到你的文档中,从而撤消了noConflict:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">
</script>
        ... snip ...
        <!-- following scripts are for the jwPlayer installations oct.09 -->
        <script type="text/javascript" src="/scripts/swfobject.js"></script>
        <script type="text/javascript" src="scripts/jwplaylist/jquery-1.3.2.min.js">
    </script>

有没有理由不更新swfobject.js以使用早期版本的jquery?

答案 2 :(得分:0)

我看到了谷歌地图的两个链接,但我想你想在这个页面中显示一个谷歌地图吗?

页面上有一个空的DIV:

<div id="map_canvas" style="width: 500px; height: 300px;"></div>

也许这是您打算嵌入地图的地方?如果是这样,您可以尝试使用以下内容替换它:

<div id="map_canvas" style="width: 500px; height: 300px;"><iframe width="500" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=2551+Woodcreek+Oaks+Blvd.+Roseville,+CA,+95747&amp;sll=37.0625,-95.677068&amp;sspn=41.767874,58.535156&amp;safe=on&amp;ie=UTF8&amp;t=h&amp;hq=&amp;hnear=2551+Woodcreek+Oaks+Blvd,+Roseville,+Placer,+California+95747&amp;ll=38.764056,-121.330884&amp;spn=0.015209,0.020106&amp;z=16&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=2551+Woodcreek+Oaks+Blvd.+Roseville,+CA,+95747&amp;sll=37.0625,-95.677068&amp;sspn=41.767874,58.535156&amp;safe=on&amp;ie=UTF8&amp;t=h&amp;hq=&amp;hnear=2551+Woodcreek+Oaks+Blvd,+Roseville,+Placer,+California+95747&amp;ll=38.764056,-121.330884&amp;spn=0.015209,0.020106&amp;z=16" style="color:#0000FF;text-align:left">View Larger Map</a></small></div>