Maps JavaScript API 仅适用于标准的 ECMAScript 和 W3C DOM 环境。这意味着,如果修改或替换浏览器所提供的内置类和对象的行为,则可能会导致 Maps JavaScript API 无法正常运行。有时,其他库可能会与 Maps JavaScript API 冲突,它们会更改浏览器的行为,使其不再是标准的 ECMAScript 环境。Maps JavaScript API 与这些库不兼容。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-06-13。"],[[["Avoid using JavaScript libraries like Prototype, MooTools (older versions), and DateJS (older versions) as they can conflict with the Maps JavaScript API due to their non-standard overrides of built-in browser functionalities."],["Prevent CSS conflicts by following specificity rules and avoiding direct references to Maps JavaScript API class names or internal DOM elements; instead, use custom CSS classes as containers for your map."],["If using CSS frameworks or components that cause conflicts, consider a box-sizing override: set the `\u003chtml\u003e` element to `border-box`, use `box-sizing: inherit` for other elements, and reset `box-sizing` to `initial` for your custom map container."],["Common CSS elements like `img`, `button`, and `a` can be overwritten by page styles, potentially causing distorted or hidden map components; adjust styles accordingly, for example, setting `max-width: none` for map images to avoid issues."]]],["The Maps JavaScript API may conflict with other libraries that modify browser behavior, notably Prototype, older MooTools, and older DateJS versions. CSS conflicts arise when page styles, frameworks, or JavaScript components override map styles. To prevent issues, use CSS specificity rules, avoid referencing internal API class names, and update elements like `img` to `max-width: none`. A workaround for `box-sizing` conflicts is to set `\u003chtml\u003e` to `border-box`, other elements to `inherit`, and map containers to `initial`.\n"]]