Leaflet.js 禁用重复的世界地图 [英] leaflet.js disable duplicated world maps

查看:40
本文介绍了Leaflet.js 禁用重复的世界地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要禁用默认显示的主世界地图左右两侧的重复世界地图.问题是我们需要精确的缩放级别,有时传单显示重复......是否可以完全删除重复项?

We need to disable duplicated world maps at the left and right side of the main world map, which is showing by default. Problem is that we need exact zoom level there and sometimes leaflet showing duplicates... Is it possible to remove duplicates at all?

推荐答案

您将禁用 TiledLayernoWrap 属性(它扩展了 GridLayer).文档这里

You will disable the noWrap property of your TiledLayer (which extends GridLayer). Documentation here

var layer = new L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
    noWrap: true
});

这篇关于Leaflet.js 禁用重复的世界地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆