久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Internet Explorer 中的 Google Maps JavaScript API 錯誤

Google Maps JavaScript API Error In Internet Explorer(Internet Explorer 中的 Google Maps JavaScript API 錯誤)
本文介紹了Internet Explorer 中的 Google Maps JavaScript API 錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我為 Google Maps JavaScript API v3 編寫了一個非常簡單的 jQuery 插件.

I have written a really simple jQuery Plugin for the Google Maps JavaScript API v3.

它適用于 Firefox、Chrome(等),但不適用于 Internet Explorer 8.

It is working in Firefox, Chrome (et al), but not Internet Explorer 8.

我得到的錯誤是下一行的對象不支持此屬性或方法"...

The error I get is "Object Doesn't Support This Property or Method" on the following line...

map = new google.maps.Map(mapContainer, myOptions);

我已經在網上發布了一個工作示例頁面來演示......我正在嘗試獲得白金漢宮!你可以在 jquery.simplemap.js 文件中看到后面的代碼,它沒有被縮小.

I have put a working example page online to demonstrate... I'm attempting to get Buckingham Palace! You can see the code behind in the jquery.simplemap.js file, it isn't minified.

http://www.stevefenton.co.uk/cmsfiles/資產/文件/simplemap.html

任何幫助將不勝感激.

更新

我已經通過這段代碼進行了詳細的調試,它實際上在 Google 代碼中出現了錯誤,該代碼被嚴重縮小并且完全難以辨認 - 這就是地圖加載的原因,因為錯誤是在地圖初始化之后出現的.等我知道了我會發更多的.

I have done a detailed debug through this code and it actually errors inside the Google code, which is heavily minified and entirely illegible - this is why the map loads, as the error is after the map is initialized. I will post more when I know it.

更新2

我在插件中重新排序了各種東西,這導致地圖顯示正確的位置,但由于地圖初始化時谷歌地圖 API 深處發生的錯誤,我無法添加標記或標注.

I have re-ordered various things in the plugin, which results in getting the map to show the correct location, but because of the error that occurs deep in the Google Maps API when the map is initialised, I cannot add the marker or callout.

推薦答案

好的,我已經找到了解決這個問題的方法.

Okay, I have found a solution to this problem.

Google Maps API 內部引發的錯誤是由用于存儲地圖的變量的范圍引起的.API 的所有示例都使用這樣的東西...

The error raised from inside the Google Maps API is caused by the scope of the variable being used to store the map. All of the examples for the API use something like this...

map = new google.maps.Map(mapContainer, myOptions);

請注意,地圖"是這些奇妙的神秘范圍變量之一……我在我的 jQuery 插件中運行所有這些代碼 - 所以最終結果是谷歌地圖 API 無法處理地圖變量.

Note that "map" is one of these wonderful mystery-scope variables... and I'm running all of this code inside of my jQuery Plugin - so the end result is that the Google Maps API cannot get a handle on the map variable.

通過將地圖聲明為全局變量,Google Maps API 可以訪問它,一切都神奇地開始完美運行.

By declaring map as a Global variable, Google Maps API can access it and everything magically starts working perfectly.

所以解決方法是聲明...

So the fix is to declare...

var map;

在全局范圍內,因此 API 可以訪問它.

In the Global scope, so the API can get to it.

這篇關于Internet Explorer 中的 Google Maps JavaScript API 錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

jQuery/JavaScript Library for avatar creation?(用于創建頭像的 jQuery/JavaScript 庫?)
How to do following mask input problem?(如何做以下掩碼輸入問題?)
Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 設置值/標簽的問題)
how to unit-test private methods in jquery plugins?(如何對 jquery 插件中的私有方法進行單元測試?)
stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 為垂直滾動網站配置偏移量/對齊元素?)
jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽輸入插件.當文本框獲得焦點時選擇所有內容)
主站蜘蛛池模板: 黄色片亚洲 | 国产激情91久久精品导航 | 精品在线免费观看视频 | 国产在线不卡视频 | 国产超碰人人爽人人做人人爱 | 成人免费观看视频 | 操操日| 久久精品16 | 亚洲97| xxx.在线观看| 亚洲乱码一区二区三区在线观看 | 国产色婷婷精品综合在线播放 | 日韩欧美国产精品 | 欧美日韩三区 | av网站免费观看 | 国产精品国产三级国产aⅴ浪潮 | 国产xxxx岁13xxxxhd | 麻豆av一区二区三区久久 | 成人在线视频一区 | 国产毛片毛片 | 亚洲色图婷婷 | 亚洲国产免费 | 天天曰夜夜 | h视频在线免费观看 | 国产成人精品一区二区三区在线观看 | 色婷婷综合网 | 九一国产精品 | 国产欧美日韩视频 | 精品日韩一区二区三区av动图 | 毛片在线看看 | 一级毛片视频在线 | 久久久久国产一区二区三区 | 91亚洲精品国偷拍自产在线观看 | 9999国产精品欧美久久久久久 | 久久综合伊人 | 中文字幕在线中文 | 在线第一页 | 中文一区| 亚洲国产一区在线 | 日韩欧美网 | 婷婷丁香在线视频 |