没有合适的资源?快使用搜索试试~ 我知道了~
ArcGIS JavaScript API 开发实例
5星 · 超过95%的资源 需积分: 10 40 下载量 99 浏览量
2009-03-10
20:07:23
上传
评论
收藏 524KB PDF 举报
温馨提示
试读
79页
arcgis 官方网站上的 实例,有利于初学者的学习和认识ArcGIS Javascript API 的开发。
资源推荐
资源详情
资源评论
JavaScript API Samples
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm[2009-3-10 15:27:16]
Customer Care Support Careers
ArcGIS Server » Web Applications » Javascript APIs » ArcGIS
Resources Gateway Concepts Samples Reference Community
JavaScript API Samples
Samples Overview
Map
Add a map
Add map and show current map extent
Add a map and show x,y coordinates
Add a dynamic map
Add two dynamic maps
Combine tiled and dynamic layers
Combine two ArcGIS Online services
Show an info window
Show loading icon
Set visible scales
Set custom extent and spatial referenc
Show map properties
Set map extent using second service
Show map using layer definitions
Dynamically create layer list
Explicitly create layer list
Switch layer when zoomed in
Display multiple ArcGIS Online services
Map Configuration
Layers
Graphics
Query Task
Identify Task
Find Task
Geocode Task
Geoprocessor Task
Toolbars
Utilities
Add a dynamic map
View live sample
Description
This sample demonstrates adding a map that is drawn by the server each time the user zooms or pans. Such a map does not have a cache of
tiles and is called a dynamic map service layer. In the ArcGIS JavaScript API dynamic map services are represented by
ArcGISDynamicMapServiceLayer.
Dynamic map services perform slower than tiled map services. Only use dynamic map services if you are unable to create a cache of tiles. You
might not be able to create a cache if your data changes faster than you can update the cache, or if you require real-time display of your data.
The following line creates the map:
var map = new esri.Map("map");
"Map" appears three times in the above line. The first (var map) is the name of the object, the second (esri.Map) is the name of the class, and
the third ("map") is the name of the div which will contain the map.
Notice that the constructor for the dynamic map service layer requires the URL of the service's REST endpoint
(http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer). You can use the
Services
Directory to find out the URLs for your map services.
Notice that the layer is made partially transparent using its
setOpacity method. Then the map's addLayer method adds the layer to the map.
dynamicMapServiceLayer.setOpacity(0.5);
map.addLayer(dynamicMapServiceLayer);
Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Create Map</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.3/js/dojo/dijit/themes/tundra/tundra.css">
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.3"></script>
<script type="text/javascript">
dojo.require("esri.map");
function init() {
var map = new esri.Map("map");
var imageParameters = new esri.layers.ImageParameters();
imageParameters.format = "png24"; //set the image type to PNG24, note default is PNG8.
//Takes a URL to a non cached map service.
var dynamicMapServiceLayer = new
esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer"
{"opacity":0.5, "imageParameters":imageParameters});
map.addLayer(dynamicMapServiceLayer);
}
dojo.addOnLoad(init);
</script>
</head>
<body class="tundra">
<div id="map" style="width:900px; height:600px; border:1px solid #000;"></div>
Creates a map and adds an ArcGISDynamicMapServiceLayer.<br />
Map navigation using mouse:
<ul>
<li>Drag to pan</li>
<li>SHIFT + Click to recenter</li>
<li>SHIFT + Drag to zoom in</li>
<li>SHIFT + CTRL + Drag to zoom out</li>
<li>Mouse Scroll Forward to zoom in</li>
<li>Mouse Scroll Backward to zoom out</li>
<li>Use Arrow keys to pan</li>
<li>+ key to zoom in a level</li>
<li>- key to zoom out a level</li>
<li>Double Click to Center and Zoom in</li>
</ul>
</body>
Search
Login
JavaScript API Samples
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm[2009-3-10 15:27:16]
JavaScript API Samples
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm[2009-3-10 15:27:16]
JavaScript API Samples
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm[2009-3-10 15:27:16]
剩余78页未读,继续阅读
资源评论
- ZuoRuoJingHong2013-10-20这个资源真是太好了,很实用对初学者
fengyunshen
- 粉丝: 5
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- tensorflow-gpu-2.7.3-cp39-cp39-manylinux2010-x86-64.whl
- tensorflow-2.8.0-cp37-cp37m-manylinux2010-x86-64.whl
- tensorflow-2.7.4-cp39-cp39-manylinux2010-x86-64.whl
- 个人资料-1111相关内容
- # C 语言介绍与使用技巧 ## C 语言简介:
- 3、高质量汽车租赁系统+layui)
- 介绍 Python 的一些基本信息,并分享一些使用技巧
- Qt的tcp网络编程(客户端和服务器)
- 当谈到 Linux 常用命令时,有很多命令可以提及 以下是一些常见的 Linux 命令及其功能:
- Sora AI Video Preview Case Sora AI 视频模版项目,React全栈快速部署.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功