Google Maps JSv3 每 30 秒冻结几秒
Google Maps JSv3 Freezes for a few seconds every 30 seconds
如题,有谁知道为什么每30秒卡一次?
我认为这是某种带有 Google 地图的计时器,但找不到任何此类参考。
要重新创建,只需将完整的 html + javascript 复制到本地文件中:
https://developers.google.com/maps/documentation/javascript/examples/map-simple
打开本地 html 文件然后移动地图,它会在 30 秒内冻结。解冻后,它可以正常工作,直到 30 秒过去。
似乎只发生在 IE 中(我使用的是版本 11)。请注意,它不会在上面的 Google 示例页面中冻结。
如有任何帮助,我们将不胜感激。
我认为这与安全设置(对于本地文件)有关。
因为我在 github 上托管了完全相同的文件,而且它似乎工作正常。这两个文件之间的唯一区别是它们的存储位置。
如果你打开本地文件,它会说类似internet explorer restricted this webpage from running scripts or activex controls
,所以我会说这是本地文件的安全设置。
如果您尝试使用开发者工具从本地驱动器 运行 HTML,您会在下面的函数中收到错误 'Invalid Argument',然后您按 F5 键继续并地图最终呈现。希望这有帮助。
function dn(a,b){return a.setQuery=b}function en(a,b){return a.background=b}function fn(a,b){return a.tilt_changed=b}function gn(a,b){return a.bounds_changed=b}function hn(a,b){return a.getStatus=b}function jn(a,b){return a.getQuery=b}function kn(a,b){return a.projectionBounds_changed=b}function ln(a,b){return a.border=b}
这似乎是实验版本中的一个问题,目前是 3.20。
见versioning in the Developer's Guide
Versioning
The Google Maps API team will regularly update this Javascript API with new features, bug fixes, and performance improvements. All API changes will be backwards-compatible, ensuring that if you launch an application using the currently documented interfaces, that application will continue to work without modification as the API is updated. (Note: experimental features, documented in the Experimental API Reference are not covered by this guarantee. Features that are experimental will be clearly labeled in the API documentation.)
Types of Versions
You can indicate which version of the API to load within your application by specifying it using the v parameter of the Maps Javascript API bootstrap request. Three options are supported:
- The experimental version, specified with v=3.exp.
- The release version, specified with v=3 or v=3.19.
- A numbered version, specified with v=3.18.
- If you do not explicitly specify a version, you will receive the experimental version by default. Google Maps API for Work customers who specify a client ID will receive the release version by default.
The experimental version
The experimental version — currently 3.20 — contains the latest features and bug fixes as they are made publicly available. Changes made to the experimental version are not guaranteed to be feature stable. We encourage you to regularly test your applications with the experimental version, which you can do by adding v=3.20 when loading the Maps API. If you like to live on the edge, you can add v=3.exp to always receive the current experimental version with all of its latest features.
如题,有谁知道为什么每30秒卡一次? 我认为这是某种带有 Google 地图的计时器,但找不到任何此类参考。
要重新创建,只需将完整的 html + javascript 复制到本地文件中:
https://developers.google.com/maps/documentation/javascript/examples/map-simple
打开本地 html 文件然后移动地图,它会在 30 秒内冻结。解冻后,它可以正常工作,直到 30 秒过去。
似乎只发生在 IE 中(我使用的是版本 11)。请注意,它不会在上面的 Google 示例页面中冻结。
如有任何帮助,我们将不胜感激。
我认为这与安全设置(对于本地文件)有关。
因为我在 github 上托管了完全相同的文件,而且它似乎工作正常。这两个文件之间的唯一区别是它们的存储位置。
如果你打开本地文件,它会说类似internet explorer restricted this webpage from running scripts or activex controls
,所以我会说这是本地文件的安全设置。
如果您尝试使用开发者工具从本地驱动器 运行 HTML,您会在下面的函数中收到错误 'Invalid Argument',然后您按 F5 键继续并地图最终呈现。希望这有帮助。
function dn(a,b){return a.setQuery=b}function en(a,b){return a.background=b}function fn(a,b){return a.tilt_changed=b}function gn(a,b){return a.bounds_changed=b}function hn(a,b){return a.getStatus=b}function jn(a,b){return a.getQuery=b}function kn(a,b){return a.projectionBounds_changed=b}function ln(a,b){return a.border=b}
这似乎是实验版本中的一个问题,目前是 3.20。
见versioning in the Developer's Guide
Versioning
The Google Maps API team will regularly update this Javascript API with new features, bug fixes, and performance improvements. All API changes will be backwards-compatible, ensuring that if you launch an application using the currently documented interfaces, that application will continue to work without modification as the API is updated. (Note: experimental features, documented in the Experimental API Reference are not covered by this guarantee. Features that are experimental will be clearly labeled in the API documentation.)
Types of Versions
You can indicate which version of the API to load within your application by specifying it using the v parameter of the Maps Javascript API bootstrap request. Three options are supported:
- The experimental version, specified with v=3.exp.
- The release version, specified with v=3 or v=3.19.
- A numbered version, specified with v=3.18.
- If you do not explicitly specify a version, you will receive the experimental version by default. Google Maps API for Work customers who specify a client ID will receive the release version by default.
The experimental version
The experimental version — currently 3.20 — contains the latest features and bug fixes as they are made publicly available. Changes made to the experimental version are not guaranteed to be feature stable. We encourage you to regularly test your applications with the experimental version, which you can do by adding v=3.20 when loading the Maps API. If you like to live on the edge, you can add v=3.exp to always receive the current experimental version with all of its latest features.