图层是地图上的对象,包含一个或多个单独项,但可作为一个整体进行操作。图层通常反映了您添加到地图上方以指定共同关联的对象集合。Maps JavaScript API 会通过以下方法管理图层内对象的呈现方式:将图层的组成项呈现在一个对象(通常为图块叠加层)中并根据地图视口的变化情况进行显示。图层还可以改变地图自身的呈现图层,以契合图层的方式稍稍改变基本图块。请注意,从设计上讲,大部分图层可能无法通过各自的对象进行访问,而只能作为一个整体进行操作。
图层概览
Maps JavaScript API 有以下几种类型的图层:
Google 地图数据层提供了一个可用于存储任意地理空间数据的容器。您可以使用数据层存储自定义数据,也可以在 Google 地图上显示 GeoJSON 数据。
[[["易于理解","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):2024-12-22。"],[[["Layers in Maps JavaScript API are objects consisting of multiple items that are treated as a single unit and often represent collections of objects on the map."],["The API provides various layer types, including Data, Heatmap, KML, Traffic, Transit, and Bicycling layers, each serving a distinct purpose for displaying geospatial data."],["You can easily add or hide a layer by calling the `setMap()` method, providing the map object or `null` respectively."],["The example code demonstrates adding a Transit layer to a map centered on London."]]],[]]