⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 arcmis是webgis网站的掩码
💻 TXT
字号:
仿google的放大缩小栏

adf有个zoomlevel控件,可惜这个控件只有和cache连用。不过这个控件也没有什么难的,其实很简单。一些大网站都已经实现了。我这里实现的是按一定缩放比例返回地图。

修改步骤如下:
.拷贝image到工程目录
.在MapFrame.htm中引用脚本zoom.js。
.在MapFrame.htm中添加脚本。
[code]
//设置缩放比
sZoomListBox.setExtentScale("3,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1");
//设置图像位置
sZoomListBox.setImgPath('image/zoom/');
	document.writeln('<style>');
	document.writeln(sZoomListBox.zoomListStyle);
	document.writeln('</style>');
//设置位置,在地图的那个位置
sZoomListBox.BoxTop=120;
//sZoomListBox.BoxLeft=mWidth-69;
sZoomListBox.BoxLeft=10;
//绘制
document.writeln('<div id="mZoomBox" style="Z-INDEX: 1; LEFT: 0px; VISIBILITY: visible; OVERFLOW: hidden; WIDTH: '+mWidth+'px; CURSOR: move; POSITION: absolute; TOP: -1px; HEIGHT: '+mHeight+'px">');
document.writeln(sZoomListBox.getDraw(1,'sZoomListBox'));
document.writeln('</div>');
[/code]
.修改鼠标移动事件
aimsClick.js文件的mapTool函数中添加
[code]
		var __bRun = true;
	if (sZoomListBox.getZoomLayer(event.x,event.y)){
		__bRun = false;
	}
	
	if ((theButton==leftButton)&&(__bRun)) {
[/code]

在aimsNavigation.js中添加事件
[code]
	if ((sZoomListBox.getZoomLayer(mouseX,mouseY))&&(sZoomListBox.bzoombox)){
		var _obj = document.getElementById(sZoomListBox.GFetchName);
		if (_obj!=null){
			_obj.style.top = sZoomListBox.ZoomBoxMove(mouseY);
		}
	}else{
		if ((mouseX>iWidth) || (mouseY>iHeight) || (mouseX<=0) ||(mouseY<=0) || ((hasOVMap) && (ovIsVisible) && (mouseX<i2Width+ovBoxSize) && (mouseY<i2Height+ovBoxSize) && (ovMapIsLayer))) {
			chkMouseUp(e);
		} else {
			mouseStuff();
		  
		}
	}
[/code]
.好了,可以试验了

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -