在传单上使用自定义地图投影

Aar*_*ong 5 javascript gis openlayers leaflet

我有一个显示 EPSG:3414 地图的应用程序,该应用程序在Openlayers 上运行 - jsfiddle 工作示例,可以正常工作。

我正在尝试在Leaflet - jsfiddle non-working上实现相同的功能,它不起作用,因为我可能遗漏了一些东西或者可能弄错了一些概念。

不幸的是,我很不熟悉,并且正在弄清楚如何让它发挥作用。

欢迎任何帮助。谢谢!

更新:

  1. 地图是使用 ZYX 和 SVY21 投影的 ESRI 类型):
  2. 这里更新了代码(JS小提琴未更新)
  3. 地图 XY 不是从 0/0 开始,它们是其他一些数字,所以它变得更加复杂,我必须为每个级别做一些神奇的数字偏移,这有点工作,但并不理想,因为位置不准确,接近但不够准确。

传单样本:

var proj = new L.Proj.CRS.TMS('EPSG:3414', "+proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m +no_defs",
    [4257.9355, 11470.3186, 64359.3062, 49067.5413], 
    {
        resolutions:[76.4372195411057,38.2186097705529,19.1093048852764,9.55465244263822,4.77732622131911,2.38866311065955,1.19433155532978,0.597165777664889,0.298450596901194]
    }
);

var map = L.map('my_map', {
    crs: proj,
    continuousWorld: true,
    worldCopyJump: false
});

map.addLayer(new L.Proj.TileLayer.TMS('http://{s}.onemap.sg/ArcGIS/rest/services/basemap/MapServer/tile/{z}/{y}/{x}', proj, {
    subdomains: ['t1', 't2'],
    tms: true,
    continuousWorld: true
}));
Run Code Online (Sandbox Code Playgroud)

The*_*ve0 1

这个例子有没有

http://esri.github.io/esri-leaflet/examples/non-mercator-projection.html

或者这个例子帮助

http://blog.thematicmapping.org/2012/07/using-custom-projections-with-tilecache.html

我会在示例中使用 firefox 中的 firebug,然后查看控制台中是否有错误消息。

另外,在将其放入 JS Fiddle 之前,我会在直接的网页上尝试它。只是少了一件可能会干扰的事情。