var map,layer,mapUrl,vector;
mapUrl = "http://103.254.67.167:8090/iserver/services/map-QuanGuoShuJu2/rest/maps/全国数据";
function init()
{
map = new SuperMap.Map("map",{projection: "EPSG:4326",controls:[
new SuperMap.Control.ScaleLine(),
new SuperMap.Control.Zoom(),
new SuperMap.Control.LayerSwitcher(),
new SuperMap.Control.Navigation({
dragPanOptions: {
enableKinetic: true
}
})
]});
layer= new SuperMap.Layer.TiledDynamicRESTLayer("China100", mapUrl, {transparent: true, cacheEnabled:true},{projection: "EPSG:4326",maxResolution:"auto"});
layer.events.on({"layerInitialized":addLayer});
vector = new SuperMap.Layer.Vector("vector");
}
function addLayer()
{
map.addLayers([layer,vector]);
//中心标记点
map.setCenter(new SuperMap.LonLat(116.658086,40.128387),2);
}
像这段代码, layer.events.on({"layerInitialized":addLayer}); 这句话就是执行不对,为什么,写了这么多jsp文件,第一次遇到这个问题,该怎么解决