说明:有关该示例中怎么引用部署在iis上的离线arcgis api请参考我前面的博文

1、运行效果

2、HTML代码

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Non graphic info window</title> <link rel="stylesheet" type="text/css" href="http://localhost/arcgis_js_api/library/3.3/jsapi/js/esri/css/esri.css" />
<style>
html, body, #map{
height: 100%;
margin: 0;
padding: 0;
} .esriPopup .titlePane
{
background-color: rgba(64,64,64,0.8); }
.esriPopup .contentPane
{
background-color: rgba(64,64,64,0.8);
color: #FFFFFF;
}
.esriPopup .actionsPane
{
background-color: rgba(64,64,64,0.8);
}
</style> <script type="text/Javascript" src="http://localhost/arcgis_js_api/library/3.3/jsapi/init.js"></script>
<script>
var map;
require([
"esri/map" ], function (
Map
) {
map = new esri.Map("map", {
basemap: "satellite",
center: [-116.96, 33.184],
zoom: 7
}); map.on("load", function () {
map.infoWindow.resize(250, 100);
}); map.on("click", addPoint); function addPoint(evt) {
var latitude = evt.mapPoint.getLatitude();
var longitude = evt.mapPoint.getLongitude();
map.infoWindow.setTitle("Coordinates");
map.infoWindow.setContent(
'<div style="background-color:lightblue;color:white;">' +
"lat/lon : " + latitude.toFixed(2) + ", " + longitude.toFixed(2) +
"<br>screen x/y : " + evt.screenPoint.x + ", " + evt.screenPoint.y+'</div>'
);
map.infoWindow.show(evt.mapPoint, map.getInfoWindowAnchor(evt.screenPoint));
}
}); </script>
</head>
<body>
<div id="map"></div>
</body>
</html>

其中的代码

   map = new esri.Map("map", {
basemap: "satellite",
center: [-116.96, 33.184],
zoom: 7
});
也可以替换为下面的形式:

map = new esri.Map("map", { center: [-116.96, 33.184], zoom: 4 });

MyTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer

("http://localhost/arcgis/rest/services/DZDT2012/MapServer");
map.addLayer(MyTiledMapServiceLayer);

最新文章

  1. Drupal8重命名上传的中文名文件
  2. big-endian和little-endian
  3. zTree的内核
  4. 【洛谷P3143】Diamond Collector
  5. vue.js+boostrap最佳实践
  6. chroot 命令实例讲解
  7. C#.NET学习笔记11,12---布尔表达式2组合,if语句
  8. mysql Group By
  9. C#中调用HttpWebRequest类中Get/Post请求无故失效的诡异问题
  10. 《SpringMVC从入门到放肆》五、SpringMVC配置式开发(处理器适配器)
  11. Vue组件间传值 v-model
  12. PWM实现ADC和DAC
  13. 【Java】NO.83.Tool.1.GlassFish.1.001-【GlassFish 5 安装使用】-
  14. 前端-toggleClass(效果切换,如果存在移除,如果不存在展示)
  15. Linux.Centos安装scp反复失败的解决方式
  16. 随机数类Random
  17. Linux的Application 内存模型---
  18. Nginx 安装成Windows 服务方法
  19. 删除 list 集合中的元素
  20. CodeForces 35D Animals

热门文章

  1. Spring注释事务失效及解决办法
  2. 《深入理解Android 卷III》第二章 深入理解Java Binder和MessageQueue
  3. acd - 1403 - Graph Game(博弈 + 二分图最大匹配)
  4. 可移动磁盘显示0kb打不开怎么办
  5. KeePass 不能复制账号密码
  6. DB2 锁问题分析与解释
  7. c多线程学习
  8. 企业级分布式存储应用与实战MogileFS、FastDFS
  9. C#CRC16 Modbus 效验算法
  10. SVN版本控制图标未显示或显示异常