Leaflet 传单圆半径根据y/lng坐标变化

Leaflet 传单圆半径根据y/lng坐标变化,leaflet,mapbox,Leaflet,Mapbox,我使用地图盒/传单显示人体图片,而不是常规地图 我使用传单绘制,我需要能够创建一个圆,并在保持其半径的同时移动它。但是,当我将其移到地图/屏幕的底部时,其大小将以指数方式增加。我希望它保持原样大小 我认为这与投影或CRS有关,但我不确定该怎么做才能阻止它 我的代码是: var mapMinZoom = 0; var mapMaxZoom = 4; var map = L.map('map', { maxZoom: mapMaxZoom, m

我使用地图盒/传单显示人体图片,而不是常规地图

我使用传单绘制,我需要能够创建一个圆,并在保持其半径的同时移动它。但是,当我将其移到地图/屏幕的底部时,其大小将以指数方式增加。我希望它保持原样大小

我认为这与投影或CRS有关,但我不确定该怎么做才能阻止它

我的代码是:

    var mapMinZoom = 0;
    var mapMaxZoom = 4;
    var map = L.map('map', {
        maxZoom: mapMaxZoom,
        minZoom: mapMinZoom,
        crs: L.CRS.Simple,
        noWrap: true,
        continuousWorld: true
    }).setView([0, 0], mapMaxZoom);

    var mapBounds = new L.LatLngBounds(
        map.unproject([0, 3840], mapMaxZoom),
        map.unproject([4096, 0], mapMaxZoom));

    map.fitBounds(mapBounds);
    L.tileLayer('/tiles/{z}/{x}/{y}.png', {
        minZoom: mapMinZoom, maxZoom: mapMaxZoom,
        bounds: mapBounds,
        attribution: 'Rendered with <a href="http://www.maptiler.com/">MapTiler</a>',
        noWrap: true,
        continuousWorld: true
    }).addTo(map);

     var touches;

     var featureGroup = L.featureGroup().addTo(map);

     var drawControl = new L.Control.Draw({
         edit: {
             featureGroup: featureGroup
         }
     }).addTo(map);

    map.on('draw:created', function (e) {
        featureGroup.addLayer(e.layer);
    });
var-mapMinZoom=0;
var mapMaxZoom=4;
var map=L.map('map'{
maxZoom:mapMaxZoom,
minZoom:mapMinZoom,
crs:L.crs.Simple,
诺拉普:没错,
连续世界:真的吗
}).setView([0,0],mapMaxZoom);
var mapBounds=新的L.LatLngBounds(
取消映射([03840],mapMaxZoom),
取消投影([4096,0],mapMaxZoom));
fitBounds(mapBounds);
L.tileLayer('/tiles/{z}/{x}/{y}.png'{
minZoom:mapMinZoom,maxZoom:mapMaxZoom,
边界:mapBounds,
属性:'使用',
诺拉普:没错,
连续世界:真的吗
}).addTo(地图);
var接触;
var featureGroup=L.featureGroup().addTo(映射);
var drawControl=新的L.Control.Draw({
编辑:{
功能组:功能组
}
}).addTo(地图);
地图上('draw:created',函数(e){
特性组。添加层(e层);
});
有什么想法吗?我不需要使用传单绘制,只要L.圆圈就可以了,但它有同样的问题

发行日期:


结果是,传单0.7代码中有大量待办事项。。。包括这个小宝石:

// TODO Earth hardcoded, move into projection code!

_getLatRadius: function () {
    return (this._mRadius / 40075017) * 360;
},

_getLngRadius: function () {
    return this._getLatRadius() / Math.cos(L.LatLng.DEG_TO_RAD * this._latlng.lat);
},
更新到0.8Dev,已经全部修复