var map, navToolbar, editToolbar, tileLayer, toolbar;
//var mapBaseUrl = "http://localhost:8399/arcgis/rest/services/pdsTile/MapServer";
//var mapDyUrl = "http://localhost:8399/arcgis/rest/services/pds/MapServer";
//var mapDyUrl = "http://10.19.110.130:8080/arcgis/rest/services/BaseMAP/MapServer";
var mapDyUrl = "http://10.19.110.130:8080/arcgis/rest/services/baseMAP/MapServer";
var mapBjUrl = "http://10.19.110.130:8080/arcgis/rest/services/YCBJ/MapServer";
var dynamicMapServiceLayerBj;
function init() {
try{
map = new esri.Map("map");
//tileLayer = new esri.layers.ArcGISTiledMapServiceLayer(mapBaseUrl);
//map.addLayer(tileLayer);
var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer(mapDyUrl);
map.addLayer(dynamicMapServiceLayer);
dynamicMapServiceLayerBj = new esri.layers.ArcGISDynamicMapServiceLayer(mapBjUrl);
map.addLayer(dynamicMapServiceLayerBj);
//初始化
dojo.connect(map, "onLoad", dxInit);
}catch(e){alert("地图初始化失败:"+e.message);}
}
function dxInit()
{
try{
//alert(map.isDoubleClickZoom);
//map.disableDoubleClickZoom();
//比例尺显示
//window.setTimeout("queryMapScale.init(map);", 1000);
//禁止双击放大
map.disableDoubleClickZoom();
//初始化导航工具条
navToolbar = new esri.toolbars.Navigation(map);
dojo.connect(navToolbar, "onExtentHistoryChange", extentHistoryChangeHandler);
//初始化在线编辑工具条
editToolbar = new esri.toolbars.Edit(map);
dojo.connect(map.graphics, "onClick", function(evt) {
dojo.stopEvent(evt);
activateToolbar(evt.graphic);
});
//初始化绘制工具条
toolbar = new esri.toolbars.Draw(map);
//dojo.connect(toolbar, "onDrawEnd", addToMap);
//显示坐标
dojo.connect(map, "onMouseMove", showCoordinates);
dojo.connect(map, "onMouseOut", hideCoordinates);
//加载鹰眼图、加载图层列表
dojo.connect(map, "onLayerAdd", showLayers);
//加载之前记录标注
//window.setTimeout("getBz();", 1000);------------------------------
//地图窗口更新
//alert(document.getElementById('map1'));
resizeMap();
dojo.connect(document.getElementById('map1'), 'resize', resizeMap);
//双击map,定位街景
dojo.connect(map, 'onDblClick', zoomTo3D);
//图层控制
layersCotrol([0]);
}catch(e){
alert("
//var mapBaseUrl = "http://localhost:8399/arcgis/rest/services/pdsTile/MapServer";
//var mapDyUrl = "http://localhost:8399/arcgis/rest/services/pds/MapServer";
//var mapDyUrl = "http://10.19.110.130:8080/arcgis/rest/services/BaseMAP/MapServer";
var mapDyUrl = "http://10.19.110.130:8080/arcgis/rest/services/baseMAP/MapServer";
var mapBjUrl = "http://10.19.110.130:8080/arcgis/rest/services/YCBJ/MapServer";
var dynamicMapServiceLayerBj;
function init() {
try{
map = new esri.Map("map");
//tileLayer = new esri.layers.ArcGISTiledMapServiceLayer(mapBaseUrl);
//map.addLayer(tileLayer);
var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer(mapDyUrl);
map.addLayer(dynamicMapServiceLayer);
dynamicMapServiceLayerBj = new esri.layers.ArcGISDynamicMapServiceLayer(mapBjUrl);
map.addLayer(dynamicMapServiceLayerBj);
//初始化
dojo.connect(map, "onLoad", dxInit);
}catch(e){alert("地图初始化失败:"+e.message);}
}
function dxInit()
{
try{
//alert(map.isDoubleClickZoom);
//map.disableDoubleClickZoom();
//比例尺显示
//window.setTimeout("queryMapScale.init(map);", 1000);
//禁止双击放大
map.disableDoubleClickZoom();
//初始化导航工具条
navToolbar = new esri.toolbars.Navigation(map);
dojo.connect(navToolbar, "onExtentHistoryChange", extentHistoryChangeHandler);
//初始化在线编辑工具条
editToolbar = new esri.toolbars.Edit(map);
dojo.connect(map.graphics, "onClick", function(evt) {
dojo.stopEvent(evt);
activateToolbar(evt.graphic);
});
//初始化绘制工具条
toolbar = new esri.toolbars.Draw(map);
//dojo.connect(toolbar, "onDrawEnd", addToMap);
//显示坐标
dojo.connect(map, "onMouseMove", showCoordinates);
dojo.connect(map, "onMouseOut", hideCoordinates);
//加载鹰眼图、加载图层列表
dojo.connect(map, "onLayerAdd", showLayers);
//加载之前记录标注
//window.setTimeout("getBz();", 1000);------------------------------
//地图窗口更新
//alert(document.getElementById('map1'));
resizeMap();
dojo.connect(document.getElementById('map1'), 'resize', resizeMap);
//双击map,定位街景
dojo.connect(map, 'onDblClick', zoomTo3D);
//图层控制
layersCotrol([0]);
}catch(e){
alert("