console
const baiduCrs = new L.Proj.CRS(
"EPSG:900913",
"+proj=merc +a=6378206 +b=6356584.314245179 +lat_ts=0.0 +lon_0=0.0 +x_0=0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs",
{
resolutions: (function() {
level = 19;
var res = [];
res[0] = Math.pow(2, 18);
for (var i = 1; i < level; i++) {
res[i] = Math.pow(2, 18 - i);
}
return res;
})(),
origin: [0, 0],
bounds: L.bounds([20037508.342789244, 0], [0, 20037508.342789244])
}
);
let map = L.map('map-container', {
zoomControl: false,
attributionControl: false,
crs: baiduCrs
});
map.setView([30.67, 104.07], 12);
// const url_temp = 'http://192.168.0.87:18131/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}';
const url_temp = 'http://192.168.0.173:8888/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}';
L.tileLayer( url_temp).addTo(map);
<div id="map-container"></div>
html, body {
width: 100%;
height: 100%;
}
#map-container {
width: 100%;
height: 100%;
}