arcgis地图窗口操作
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>地图窗口操作</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/tundra/tundra.css" />
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
<style type="text/css">
html, body, #main {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
}
</style>
<script src="http://js.arcgis.com/3.9/"></script>
<script type="text/javascript">
var map, navToolbar;
var navOption; // 当前选择的操作
require(["dojo/parser", "esri/map", "esri/layers/ArcGISTiledMapServiceLayer", "esri/toolbars/navigation",
"dojo/query", 'dojo/_base/fx', "dojo/fx/easing", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!"],
function (parser, Map, ArcGISTiledMapServiceLayer, Navigation, query, fx, easing) {
parser.parse(); map = new Map("mapDiv", {
logo: false,
sliderStyle: "large"
});
var agoServiceURL = "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer";
var agoLayer = new ArcGISTiledMapServiceLayer(agoServiceURL);
map.addLayer(agoLayer); map.on('load', setupNavBar); function setupNavBar() {
navToolbar = new Navigation(map); query(".navItem img").onmouseover(function (evt) {
fx.anim(evt.target.parentNode, {
backgroundColor: '#CCCCCC'
}, 200, easing.bounceOut);
}).onmouseout(function (evt) {
if (evt.target.parentNode.id != navOption) {
fx.anim(evt.target.parentNode, {
backgroundColor: '#FFFFFF'
});
}
else {
fx.anim(evt.target.parentNode, {
backgroundColor: '#DADADA'
});
}
}).onclick(function (evt) { fx.anim(evt.target.parentNode, {
backgroundColor: '#999999'
}, 200, easing.linear, function () {
dojo.anim(evt.target.parentNode, {
backgroundColor: '#CCCCCC'
}, 0);
});
navEvent(evt.target.parentNode.id);
}); // 将漫游设置为默认操作
navEvent('deactivate');
} function navEvent(id) {
switch (id) {
case 'pan':
map.enablePan();
navToolbar.activate(Navigation.PAN); if (navOption) {
fx.anim(document.getElementById(navOption), {
backgroundColor: '#FFFFFF'
});
}
navOption = id;
break;
case 'zoomprev':
navToolbar.zoomToPrevExtent();
break;
case 'zoomnext':
navToolbar.zoomToNextExtent();
break;
case 'extent':
navToolbar.zoomToFullExtent();
break;
case 'zoomin':
navToolbar.activate(Navigation.ZOOM_IN);
if (navOption) {
fx.anim(document.getElementById(navOption), {
backgroundColor: '#FFFFFF'
});
}
navOption = id;
break;
case 'zoomout':
navToolbar.activate(Navigation.ZOOM_OUT);
if (navOption) {
fx.anim(document.getElementById(navOption), {
backgroundColor: '#FFFFFF'
});
}
navOption = id;
break;
case 'deactivate':
navToolbar.deactivate();
if (navOption) {
fx.anim(document.getElementById(navOption), {
backgroundColor: '#FFFFFF'
});
}
navOption = id;
break;
}
}
});
</script>
</head>
<body class="tundra">
<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline'" id="main">
<div id="navDiv1" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'left', splitter:'false'" style="width: 44px; overflow: hidden; padding: 0px; border: 0px; ">
<div id="zoomin" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;">
<img class="navItem" src="data:images/zoomin.gif" title="Zoom In: Drag a zoom rectangle on-map to zoom in" />
</div>
<div id="zoomout" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;">
<img class="navItem" src="data:images/zoomout.gif" title="Zoom Out: Drag a zoom rectangle on-map to zoom out and center" />
</div>
<div id="extent" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;">
<img class="navItem" src="data:images/web.gif" title="Full Extent: Zoom out to Full Extent" />
</div>
<div id="zoomprev" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;">
<img class="navItem" src="data:images/left.gif" title="前一视图" />
</div>
<div id="zoomnext" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;">
<img class="navItem" src="data:images/right.gif" title="后一视图" />
</div>
<div id="pan" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;">
<img class="navItem" title="漫游" src="data:images/hand.gif" />
</div>
<div id="deactivate" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; background-color:#DADADA; vertical-align : middle; overflow: hidden;">
<img class="navItem" src="data:images/minus.gif" title="返回标准控制" />
</div>
</div>
<div id="mapDiv" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'"
style="background-color: #f5ffbf; padding: 10px;">
</div>
</div>
</body>
</html>
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>地图窗口操作</title> <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/tundra/tundra.css" /> <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css"> <style type="text/css"> html, body, #main { padding: 0; margin: 0; width: 100%; height: 100%; } </style> <script src="http://js.arcgis.com/3.9/"></script> <script type="text/javascript"> var map, navToolbar; var navOption; // 当前选择的操作 require(["dojo/parser", "esri/map", "esri/layers/ArcGISTiledMapServiceLayer", "esri/toolbars/navigation", "dojo/query", 'dojo/_base/fx', "dojo/fx/easing", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!"], function (parser, Map, ArcGISTiledMapServiceLayer, Navigation, query, fx, easing) { parser.parse();
map = new Map("mapDiv", { logo: false, sliderStyle: "large" }); var agoServiceURL = "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"; var agoLayer = new ArcGISTiledMapServiceLayer(agoServiceURL); map.addLayer(agoLayer);
map.on('load', setupNavBar);
function setupNavBar() { navToolbar = new Navigation(map);
query(".navItem img").onmouseover(function (evt) { fx.anim(evt.target.parentNode, { backgroundColor: '#CCCCCC' }, 200, easing.bounceOut); }).onmouseout(function (evt) { if (evt.target.parentNode.id != navOption) { fx.anim(evt.target.parentNode, { backgroundColor: '#FFFFFF' }); } else { fx.anim(evt.target.parentNode, { backgroundColor: '#DADADA' }); } }).onclick(function (evt) {
fx.anim(evt.target.parentNode, { backgroundColor: '#999999' }, 200, easing.linear, function () { dojo.anim(evt.target.parentNode, { backgroundColor: '#CCCCCC' }, 0); }); navEvent(evt.target.parentNode.id); });
// 将漫游设置为默认操作 navEvent('deactivate'); }
function navEvent(id) { switch (id) { case 'pan': map.enablePan(); navToolbar.activate(Navigation.PAN);
if (navOption) { fx.anim(document.getElementById(navOption), { backgroundColor: '#FFFFFF' }); } navOption = id; break; case 'zoomprev': navToolbar.zoomToPrevExtent(); break; case 'zoomnext': navToolbar.zoomToNextExtent(); break; case 'extent': navToolbar.zoomToFullExtent(); break; case 'zoomin': navToolbar.activate(Navigation.ZOOM_IN); if (navOption) { fx.anim(document.getElementById(navOption), { backgroundColor: '#FFFFFF' }); } navOption = id; break; case 'zoomout': navToolbar.activate(Navigation.ZOOM_OUT); if (navOption) { fx.anim(document.getElementById(navOption), { backgroundColor: '#FFFFFF' }); } navOption = id; break; case 'deactivate': navToolbar.deactivate(); if (navOption) { fx.anim(document.getElementById(navOption), { backgroundColor: '#FFFFFF' }); } navOption = id; break; } } }); </script></head><body class="tundra"> <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline'" id="main"> <div id="navDiv1" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'left', splitter:'false'" style="width: 44px; overflow: hidden; padding: 0px; border: 0px; "> <div id="zoomin" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;"> <img class="navItem" src="data:images/zoomin.gif" title="Zoom In: Drag a zoom rectangle on-map to zoom in" /> </div> <div id="zoomout" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;"> <img class="navItem" src="data:images/zoomout.gif" title="Zoom Out: Drag a zoom rectangle on-map to zoom out and center" /> </div> <div id="extent" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;"> <img class="navItem" src="data:images/web.gif" title="Full Extent: Zoom out to Full Extent" /> </div> <div id="zoomprev" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;"> <img class="navItem" src="data:images/left.gif" title="前一视图" /> </div> <div id="zoomnext" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;"> <img class="navItem" src="data:images/right.gif" title="后一视图" /> </div> <div id="pan" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; vertical-align : middle; overflow: hidden;"> <img class="navItem" title="漫游" src="data:images/hand.gif" /> </div> <div id="deactivate" data-dojo-type="dijit/layout/ContentPane" class="navItem" data-dojo-props="splitter:'false'" style="height: 30px; border: 1px solid #DADADA; padding: 5px; margin-bottom: 3px; background-color:#DADADA; vertical-align : middle; overflow: hidden;"> <img class="navItem" src="data:images/minus.gif" title="返回标准控制" /> </div> </div> <div id="mapDiv" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'" style="background-color: #f5ffbf; padding: 10px;"> </div> </div></body></html>
arcgis地图窗口操作的更多相关文章
- arcgis地图服务之 identify 服务
arcgis地图服务之 identify 服务 在近期的一次开发过程中,利用IdentityTask工具查询图层的时候,请求的参数中ImageDisplay的参数出现了错误,导致查询直接不能执行,百度 ...
- arcgis地图数据集合
一.全国的ArcGIS地图SHP格式数据,覆盖的图层信息量基本齐全,除了ArcGIS之外,其他GIS软件(superMap和MapGIS.MapInfo等等)也是用之,适合为GIS开发提供数据素材. ...
- ArcEngine地图窗口指定区域导出指定DPI多格式---delphi/C#实现
delphi/C#实现,其他语言稍微改下就行了.AE的编码各个语言都差不多,这里也没用到某一语言的特性. 函数特点: 1.可以精确导出指定范围的图形要素 2.支持多格式.TIF, .EMF,.GIF, ...
- 【转】ArcGIS地图缓存制作简介
[PDF]ArcGIS 地图缓存制作简介 - Esri中国 ArcGIS地图缓存制作简介 制作好的电子地图只有发布为服务后才能为更多的用户所查看与使用.ArcGIS Server 为共享 GIS 资源 ...
- uCGUI窗口操作要点
uCGUI窗口操作要点 1. 创建一个窗口的时候,会给此窗口发送“创建(WM_CREATE)”消息,从而执行它的回调函数:如果创建窗口的标志带有“可视标志(WM_CF_SHOW)”,那么在后续执行GU ...
- Structured-Streaming之窗口操作
Structured Streaming 之窗口事件时间聚合操作 Spark Streaming 中 Exactly Once 指的是: 每条数据从输入源传递到 Spark 应用程序 Exactly ...
- WPF: WpfWindowToolkit 一个窗口操作库的介绍
在 XAML 应用的开发过程中,使用MVVM 框架能够极大地提高软件的可测试性.可维护性.MVVM的核心思想是关注点分离,使得业务逻辑从 View 中分离出来到 ViewModel 以及 Model ...
- 使用cmd命令行窗口操作SqlServer
本文主要介绍使用windows下的使用cmd命令行窗口操作Sqlserver, 首先我们可以运行 osql ?/ ,这样就把所有可以通过CMD命令行操作sqlserver的命令显示出来 (有图有 ...
- streaming窗口操作
之前一直对窗口操作不太理解.认为spark streaming本身已经是分片计算,还需要窗口操作干啥. 窗口操作最为简单易懂的场景就是,在M时间间隔计算一次N时间内的热搜.当M=N的时候,就像上述所说 ...
随机推荐
- SPRINGBOOT配置MYSQL,MYBATIS,DRUID
配置 DRUID连接池 MYSQL数据库 MYBATIS持久层框架 添加依赖 <dependency> <groupId>mysql</groupId> <a ...
- [转]C#中用NamedPipe进程间通信
转自:http://blog.csdn.net/jinjazz/archive/2009/02/03/3861143.aspx 本文只是一个测试例子,核心代码是kernel32.dll中的一组wind ...
- HZOI20190821模拟28题解
题面:https://www.cnblogs.com/Juve/articles/11390839.html 所有官方正解在我的文件里 A. 虎 算法1:我们发现非关键边与黑色边去掉以后,答案就是将所 ...
- DSMM之数据处理安全
一.背景 数据安全生命周期分为采集.传输.存储.处理.交换.销毁几个阶段,其中数据处理阶段是整个周期的核心阶段,数据处理安全与否直接关系到整体数据安全.那么今天分享内容就是数据处理安全的相关要求和实现 ...
- ArcMap应用——三维场景中井盖的属性配置
在精细三维场景中,有地面(包括道路面.马路牙子).有部件数据(包括井盖).我们会发现有马路牙子的地方比道路面要高出一部分,比如0.1米,但是雨水井盖却有些在路面上.有些在道路以外.就是说在道路面上的井 ...
- python 日记 day1
1.python2 与 python3 的区别: a. python2 源码不标准,混乱,重复代码太多.默认方式是ascii码,解决方式:#-*- encoding:utf-8 -*- b. ...
- MySql存储过程批量删除多个数据库中同名表中的指定字段
1. 创建存储过程batchDeleteField:删除所有名称为"MyDB_"开头的数据库中的指定字段 -- ---------------------------- -- Pr ...
- java求1000以内的水仙花数
水仙花数是指一个 n 位数 ( n>=3 ),它的每个位上的数字的 n 次幂之和等于它本身.(例如:1^3 + 5^3 + 3^3 = 153) 三位的水仙花数共有4个,分别为:153.370. ...
- Acesrc and Travel
Acesrc and Travel 时间限制: 1 Sec 内存限制: 128 MB 题目描述 Acesrc is a famous tourist at Nanjing University se ...
- Codeforces 899F Letters Removing 线段树/树状数组
虽然每次给一个区间,但是可以看作在区间内进行数个点操作,同样数列下标是动态变化的,如果我们将每个字符出现看作1,被删除看作0,则通过统计前缀和就能轻松计算出两个端点的位置了!这正是经典的树状数组操作 ...