使用超图的示例加载天地图的地图服务,地图只能放大到15级,但是天地图提供有18级,请问相关参数需要如何设置?
<script type="text/javascript">
var map, tiandituLayer, marker, markers, tianMarkerLayer;
map = new SuperMap.Map("map", {
controls: [
new SuperMap.Control.Navigation(),
new SuperMap.Control.Zoom(),
new SuperMap.Control.LayerSwitcher()
], allOverlays: true
});
tiandituLayer = new SuperMap.Layer.WMTS({
name: "vec",
url: "http://t0.tianditu.com/vec_c/wmts?tk=1d109683f4d84198e37a38c442d68311",
layer: "vec",
style: "default",
matrixSet: "c",
format: "tiles",
opacity: 1,
requestEncoding: "KVP"
});
tianMarkerLayer = new SuperMap.Layer.WMTS({
name: "vec",
url: "http://t0.tianditu.com/cva_c/wmts?tk=1d109683f4d84198e37a38c442d68311",
layer: "cva",
style: "default",
matrixSet: "c",
format: "tiles",
opacity: 1,
requestEncoding: "KVP"
});
tianMarkerLayer.layerType = "cva";
tianMarkerLayer.isLabel = true;
map.addControl(new SuperMap.Control.MousePosition());
markers = new SuperMap.Layer.Markers("Markers");
map.addLayers([tiandituLayer, markers, tianMarkerLayer]);
map.setCenter(new SuperMap.LonLat(23, 37), 3);
addMarker();
var infowin = null;
//定义mouseClickHandler函数,触发click事件会调用此函数
function mouseClickHandler(event) {
closeInfoWin();
//初始化popup类
popup = new SuperMap.Popup(
"chicken",
marker.getLonLat(),
new SuperMap.Size(220, 140),
'<img src="images/xila.jpg">',
true,
null
);
infowin = popup;
//添加弹窗到map图层
map.addPopup(popup);
}
function closeInfoWin() {
if (infowin) {
try {
infowin.hide();
infowin.destroy();
}
catch (e) {
}
}
}
function addMarker() {
size = new SuperMap.Size(50, 50);
offset = new SuperMap.Pixel(-(size.w / 2), -size.h);
icon = new SuperMap.Icon('../img/markerbig_select.png', size, offset);
//初始化标记覆盖物类
marker = new SuperMap.Marker(new SuperMap.LonLat(23.6530190, 37.9439259), icon);
//添加覆盖物到标记图层
markers.addMarker(marker);
//注册 click 事件,触发 mouseClickHandler()方法
marker.events.on({
"click": mouseClickHandler,
"touchstart": mouseClickHandler //假如要在移动端的浏览器也实现点击弹框,则在注册touch类事件
});
}
</script>