首页 / 浏览问题 / WebGIS / 问题详情
mapbox-gl-enhance 加载csgs2000瓦片失败
1EXP 2024年06月04日
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no'/>
<title data-i18n="resources.title_tiledMapLayer_china2000"></title>
<script type="text/javascript" include="mapbox-gl-enhance" src="dist/mapboxgl/include-mapboxgl.js"></script>
<style>
	body {
	margin:0;
	padding: 0;}
	#map{
	position: absolute;
	top:0;
	bottom:0;width: 100%;}
</style>
</head>
<body>
<div id='map'></div>
<script type="text/javascript">
var host = window.isLocal ? window.server : "http://localhost:8090";
var url = host + "/iserver/services/map-zjd/rest/maps/whgyrzcgcs2000";
var map = new mapboxgl.Map({
	container:'map',//container id
	style:{"version":8,
	"sources":{
		"raster-tiles":{
			"type": "raster",
			"tilesize": 256,
			"tiles": [url],
			"rasterSource": "iserver"
		}
	},
	"layers": [{
	"id":"simple-tiles",
	"type": "raster",
	"source":"raster-tiles",
	"minzoom":0,
	"maxzoom": 22
	}]
},
	crs:"EPSG:4490",
	center:[113.12 , 23.01],
	// center:[101.74721254733845, 32.5665352689922],
	zoom:3
});

console.log(url)
</script>
</body>

加载坐标系4490的瓦片失败,想问下url后的参数值可以自行修改吗,目前来看它是自己加的参数值

1个回答

您好,您的tileImage.png请求单独打开显示什么报错信息?在官网示例中将url换成您的服务后能不能正常显示?https://iclient.supermap.io/examples/mapboxgl/editor.html#01_tiledMapLayer_4490

971EXP 2024年06月04日

报错信息:

在官网改了后,也是一样的结果。我觉得是比例尺的原因,参数上的比例尺值和我发布服务的比例尺不同,但不知道怎么修改参数上的比例尺值。

...