测试"Hello World"样例中,layerInitialized事件没有发生导致addLayer没有被调用、没有取地图
var map, layer;
var url = "http://localhost:8090/iserver/services/map-World/rest/maps/World";
function init() {
map = new SuperMap.Map ("map");
layer = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, null, {maxResolution:"auto"});
layer.events.on({"layerInitialized": addLayer});
}
function addLayer() {
map.addLayer(layer);
map.setCenter(new SuperMap.LonLat(0, 0), 0);
}