ArcGIS api for javascript——1,2,3综合
2024-08-30 09:07:18
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>Directions方位展示</title>
<!-- <link rel="stylesheet" type="text/css" href="http://localhost:8080//arcgis_js_api/library/3.18/3.18/dijit/themes/tundra/tundra.css"> -->
<!-- <link rel="stylesheet" type="text/css" href="http://localhost:8080//arcgis_js_api/library/3.18/3.18/dijit/themes/claro/claro.css"> -->
<!-- <link rel="stylesheet" type="text/css" href="http://localhost:8080//arcgis_js_api/library/3.18/3.18/init.js"> -->
<!-- <link rel="stylesheet" type="text/css" href="js/dojo.js"> -->
<link rel="stylesheet" href="http://localhost:8080/arcgis_js_v311_api/arcgis_js_api/library/3.11/3.11/esri/css/esri.css"/>
<link rel="stylesheet" href="http://localhost:8080/arcgis_js_v311_api/arcgis_js_api/library/3.11/3.11/dijit/themes/claro/claro.css"/>
<script type="text/javascript" src="http://localhost:8080/arcgis_js_v311_api/arcgis_js_api/library/3.11/3.11/init.js"></script> <!-- <link rel="stylesheet" type="text/css" href="js/jquery-1.8.3.min.js"> -->
<script type="text/javascript">
dojo.require("esri.map");//类似引入命名空间
//var map = [];
function init(){
esri.config.defaults.io.proxyUrl = "/proxy/proxy.ashx";
var map = new esri.Map("map", {
extent:new esri.geometry.Extent({ xmin:110, ymin:31, xmax:117, ymax:37, spatialReference:{ wkid:4326 } })//选取的空间坐标系范围
});
var henan = new esri.layers.ArcGISTiledMapServiceLayer("http://124.200.40.4:6080/arcgis/rest/services/hnxzqh/MapServer");
//dynamicMapServiceLayer.setOpacity(0.5);//不透明度设置
map.addLayer(henan);
dojo.connect(map,"onExtentChange",showExtent);
dojo.connect(map,"onLoad",function(){
dojo.connect(map,"onMouseMove",showCoordinates);
dojo.connect(map,"onMouseDrag",showCoordinates);
});
}
function showExtent(extent){//显示地图范围(经纬度坐标)
var s="extent<br/>XMin:"+extent.xmin+"<br/>YMin:"+extent.ymin+"<br/>XMax:"+extent.xmax +"<br/>YMax:"+extent.ymax;
dojo.byId("info").innerHTML=s;
}
function showCoordinates(event){//显示坐标
var mp=event.mapPoint;
var mp2=event.screenPoint;
dojo.byId("info2").innerHTML="mapPoint"+mp.x+","+mp.y+"<br/>screenPoint"+mp2.x+","+mp2.y;
}
dojo.addOnLoad(init);
</script>
</head>
<body>
<table>
<tr>
<td><div id="map" style="width:600px; height:450px; border:1px solid #000;"></div></td>
<!-- 设置垂直对齐位置: -->
<td valign="top">
<div id="info"></div>
<div id="info2"></div>
</td>
</tr>
</table>
</body>
</html>
最新文章
- IOS9.0中hash值的bug与解决方案
- 两个list取不同值
- Python基础1:if条件判断 break/continue语句
- 当 IDENTITY_INSERT 设置为 OFF 时,不能为表‘XXX’中的标识列插入显式值。
- 转载-Web API 入门
- hdu3264Open-air shopping malls(二分)
- Flash AS 响应双击事件MouseEvent.DOUBLE_CLICK
- Linux/Unix shell 自动发送AWR report
- P1023 奶牛的锻炼
- CoreAnimation4-隐式动画和显式动画
- JavaScript超大整数加法
- nodeJS之流stream
- 4.2 js没有块级作用域
- 51 nod 1439 互质对(Moblus容斥)
- layui 的 GitHub 及 Gitee (码云) 仓库
- Android Studio 下载与安装配置
- 18.Mysql SQL优化
- 前端开发 - HTML/CSS
- Common Gateway Interface Python CGI编程
- windows-x64 php5.6+apache2.4+mysql配置