[英]leaflet container/layer points
Trying to make custom map. 试图制作自定义地图。
Here's simple example http://codepen.io/TrySound/pen/LZxZWR 这是一个简单的例子http://codepen.io/TrySound/pen/LZxZWR
const layerBottomRight = L.point(config.width, config.height);
const containerBottomRight = map.layerPointToContainerPoint(layerBottomRight);
console.log('layer bottom right', layerBottomRight.x, layerBottomRight.y);
console.log('container right bottom', containerBottomRight.x, containerBottomRight.y);
The problem is that container and layer points are the same on any zoom which is not what I expect. 问题是容器和图层点在任何缩放上都是相同的,这不是我期望的。 Am I missing something in configuration? 我在配置中缺少什么吗?
容器始终具有相同的大小(Div大小),为此更改:
console.log('container right bottom', map.getSize().x, map.getSize().y);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.