Skip to content

设置地图经纬度范围≥0.11.5

loading

V0.11.5 地图增加了经纬度范围属性:bounds: [最小经度,最小纬度,最小经度,最大纬度]

设置地图经纬度范围属性 TileMap.bounds 后,地图仅下载和渲染 bounds 范围的数据,以减少地图下载量提高渲染速度。

该属性默认为 undefined,表示不对地图范围进行控制,即显示全球数据。

ts
// 创建地图
const map = tt.TileMap.create({
    // 影像数据源
    imgSource: new plugin.ArcGisSource(),
    // 地形数据源
    demSource: new plugin.ArcGisDemSource(),
    // 中央子午线经度
    lon0: 90,
    // 增加:地图经纬度范围 [最小经度,最小纬度,最小经度,最大纬度]
    bounds: [60, 0, 145, 60],
});

TIP

TileMap.bunds 属性是是设置整个地图的经纬度范围,如果要设置某一层数据经纬度范围,设置数据源的 bounds 属性来控制。

Released under the MIT License.