地图option项设置allOverlays: true,地图显示不出来,鹰眼出的地图也显示不出来,但是位置和地图是同步的。如果设置成allOverlays: false或者直接删掉allOverlays: true,地图能显示出来,但是鹰眼显示出现问题,不能和地图同步,直觉显示在‘非洲’。请问大神这是怎么回事。
1.allOverlays: true
2.allOverlays: false
你好这是全部代码: /** * Created by liuyang on 2017/12/14 0014. */ var BZMapModule = (function () { var bzmap = {}; //相当于 var bzmap = new Object() //本地化语言 bzmap.Lang = "Lang_CN"; var mapName = "bz-map" //私有变量,地图名称 bzmap.initMap = function (divId) { bzmap.mapDiv = document.getElementById(divId); var options = { controls: [new SuperMap.Control.Navigation()], allOverlays: false, //units: 'm', //projection: "EPSG:3857", //numZoomLevels: 16//{Integer} 用于地图实例化的时候设置地图缩放级别的数量。默认值16,当需要的时候可以在地图选项中设置 其他的值。 }; //创建地图 bzmap.map = new SuperMap.Map(divId, options); //初始化矢量图层 initVectorLayer(); //初始化地图基本控件 initControls(); //MapConfig.serverType = "WMS" if (MapConfig.serverType == "WMS") { //OGC-WMS bzmap.baseLayer = new SuperMap.Layer.Baidu(); initLayer(); } else if (MapConfig.serverType == "REST") { //SuperMap REST bzmap.baseLayer = new SuperMap.Layer.TiledDynamicRESTLayer(mapName, MapConfig.mapUrl, { transparent: false, cacheEnabled: true }, {maxResolution: "auto"}); //为图层初始化完毕添加layerInitialized事件 bzmap.baseLayer.events.on({"layerInitialized": initLayer}); //bzmap.map.setLayerIndex(bzmap.baseLayer,0) //bzmap.map.setBaseLayer(bzmap.baseLayer); } //bzmap.map.events.on({"click": callbackFunction});//添加click事件 //Util.mousemoveGetlonlat(bzmap.map,"showLon","showLat") //Util.mouseClickGetLonLat(bzmap.map) }; /*初始化控件*/ function initControls() { //bzmap.map.addControl(new SuperMap.Control.LayerSwitcher()); bzmap.map.addControl(new SuperMap.Control.ScaleLine());//比例尺控件 //属性minRectSize:鹰眼范围矩形边框的最小的宽度和高度。默认为8pixels bzmap.overviewmap = new SuperMap.Control.OverviewMap({maximized: true}); bzmap.overviewmap.minRectSize = 8; bzmap.map.addControl(bzmap.overviewmap);//比例尺控件 } //定义addLayer函数,触发 layerInitialized事件会调用此函数 function initLayer() { //map上添加分块动态REST图层和标记图层 bzmap.map.addLayers([bzmap.baseLayer, bzmap.markertag, bzmap.circleLayer]); bzmap.map.setCenter(new SuperMap.LonLat(MapConfig.initLon, MapConfig.initLat), MapConfig.initLevel); } function initVectorLayer() { bzmap.circleLayer = new SuperMap.Layer.Vector("vector");//矢量图层 bzmap.markertag = new SuperMap.Layer.Markers("markertag"); } return bzmap; }());