1.leaflet加载超图自己发布的世界地图,可以正常加载并且显示。
var url1 = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
// var urlMap = "http://10.219.245.97:8090/iserver/services/map-DGGW/rest/maps/Map";
var urlMap = "http://10.219.245.128:8090/iserver/services/map-BSSGW0505/rest/maps/Map";
// TODO:0.初始化地图信息success
var map = L.map('mapContainer', {
crs: L.CRS.EPSG4326,
center: [0, 0],
maxZoom: 18,
zoom: 1
});
L.supermap.tiledMapLayer(url1).addTo(map);
2.自己发布的cgcs2000坐标系的地图,自定了坐标,但是leaflet一直提示没有加载地图。
1)我自己发布的地图
2)自定义leaflet坐标系,并且加载自定义地图,不显示,并且浏览器提示Error: No projection definition for code EPSG:4547。
var url1 = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
// var urlMap = "http://10.219.245.97:8090/iserver/services/map-DGGW/rest/maps/Map";
var urlMap = "http://10.219.245.128:8090/iserver/services/map-BSSGW0505/rest/maps/Map";
let proj4 = window.proj4;
proj4.defs("EPSG:4547","+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs");
var crs = L.Proj.CRS("EPSG:4547", {
origin: [508120.43 , 2522153.87],
scales: 0.000015895234,
});
var map = L.map('mapContainer', {
transparent: false,
crs: crs,
center: [114.07, 22.85],
maxZoom: 18,
zoom: 0
});
// 添加图层
L.supermap.tiledMapLayer(urlMap).addTo(map);
3)浏览器提示信息Error: No projection definition for code EPSG:4547:
4)我的Proj4.js库肯定是加载了。
问题1:leaflet是否支持proj4定义的平面坐标系???
问题2:如果支持自定义的坐标系,为什么上诉代码提示没有定义4547投影坐标系???是我的代码或者参数设置错误了吗???
问题3:leaflet有没有显示坐标的自定义控件??如果有,怎么添加呢???