【一】ArcGIS Silverlight 客户端 1-2-3

news/2024/5/19 18:18:47 标签: Silverlight, REST, Bing, Blend, Flex
[b]题记[/b]

ArcGIS之所以比较普及,特点之一就是它能紧跟计算机发展的趋势。推出适合各种平台的API比如JavaScript API,Java API,Flex API,Siverlight API,后二者是现在RIA的主流代表,开发工具、设计工具一应俱全,至于这些API如何取舍,其实并不重要,临渊思鱼,不如退而结网。

取这个题目,是因为当年我很喜欢lotus 1-2-3。

[b]准备工具[/b]

假设你已经安装了Visual Studio 2010 (最新版本嘛,至少以后几年你翻我的文章还不会过期)的任何一个版本,建议安装Blend设计工具,它可以用来设计非常酷的Silverlight画面。

SL需要另外安装工程插件,Silverlight 4的Visual studio工程插件,可以在[url="http://www.microsoft.com/downloads/details.aspx?familyid=BF5AB940-C011-4BD1-AD98-DA671E491009&displaylang=en"]这里[/url]下载。

最后我们需要ArcGIS SL 客户端API,你需要自己注册一个ESRI Global账户,登陆后,就可以在[url=http://www.esri.com/products/index.html#developer_tools_panel"]这里[/url]下载。

[b]Hello,World[/b]

安装好上面的SL4插件和ArcGIS Client,就可以创建一个Silverlight Application工程了,并添加ESRI.ArcGIS.Client(版本1.2)的引用。

ArcGIS客户端包括4个Dll:
[list]
ESRI.ArcGIS.Client.dll 是主要用到的核心类库,地图,图层,查询等相关类都在这里面.
ESRI.ArcGIS.Client.Bing.dll 是用来使用微软Bing的地图和服务。
ESRI.ArcGIS.Client.Toolkit.dll 工具类库,一些常用的工具如放大缩小就在里面。
ESRI.ArcGIS.Client.Behaviors.dll库,充分利用Silverlight 3的Behavior特性,封装一些常用的鼠标操作,降低开发难度和工作量。
[/list]

一般学习程序都是从最简单的"Hello,World"开始,我们也不例外。打开工程里的MainPage.XAML:

<UserControl x:Class="GisDemo.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">

<Grid x:Name="LayoutRoot" Background="White">
<esri:Map x:Name="mymap">
<esri:Map.Layers>
<esri:ArcGISTiledMapServiceLayer ID="layerworldmap"

Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer" />

</esri:Map.Layers>

</esri:Map>

</Grid>
</UserControl>


这里添加了一个地图控件并给应该地图添加了一个瓷砖类型的图层(ArcGISTiledMapServiceLayer),访问的是ESRI公司所提供的免费地图资源,简单的的一些说明:

usercontrol标签是页面的根元素,下面的几句引入了xml的特定命名空间,里面包括了我们的ESRI.ArcGIS.Client.

Grid标签是布局控件,可以进行灵活的页面布局,xaml中常用的布局控件还有Canvas和StackPanel;

之后是我们的主角-- Map标签(继承自xaml的Control)它相当于一个Map控件,可以在其中加入地图的图层;

这里我们添加了一个ArcGISTiledMapServiceLayer瓷砖图层,URL的内容便是ArcGIS Online的一个世界地图资源。

运行这个例子,我们就得到一个真正的"您好,世界”了:

[img]http://dl.iteye.com/upload/attachment/247530/fbac739a-d363-3faa-a9f2-0060589fc5cf.png[/img]

这个地图虽然简单,但是在拖曳、放大等操作速度已经远远胜过javascript版本的google map了。

[b]ArcGis的地图资源[/b]
ArcGis提供了许多免费和收费的地图资源,这里列了一些:
1. [url="http://www.arcgisonline.com/home/item.html?id=3b93337983e9436f8db950e38a8629af"]World_Street_Map[/url](比例尺1:591,657,528 到 1:4,514)
REST资源:http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer
2. [url="http://www.arcgisonline.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9"]World Imagery[/url] (比例尺1:591,657,528 到1:1,128)
REST资源:
http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer
3.[url="http://www.arcgisonline.com/home/item.html?id=f2498e3d0ff642bfb4b155828351ef0e"]World Topographic Map[/url](比例尺1:591,657,528 到 1:1,128)
REST资源:
http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer
4.[url="http://www.arcgisonline.com/home/item.html?id=9c5370d0b54f4de1b48a3792d7377ff2"]World Shaded Relief[/url] (比例尺1:591,657,528 到 1:72,224)
REST资源:
http://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServe
5.[url="http://www.arcgisonline.com/home/item.html?id=c4ec722a1cd34cf0a23904aadf8923a0"]World Physical Map[/url](比例尺1:591,657,528 到 1:2,311,162)
REST资源: http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer
6.[url="http://www.arcgisonline.com/home/item.html?id=c61ad8ab017d49e1a82f580ee1298931"]World Terrain Base[/url] (1:591,657,528 到 1:72,224)
REST资源:
http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer
7.[url="http://www.arcgisonline.com/home/item.html?id=99cd5fbd98934028802b4f797c4b1732"]USA Topographic Maps[/url](1:591,657,528 到 1:18,056)
REST资源:
http://server.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer

更多地图类型可以参考[url="http://www.esri.com/software/arcgis/arcgisonline/standard-maps.html"]ESRI官方站[/url]

http://www.niftyadmin.cn/n/1702878.html

相关文章

ListCollectionView SortDescription ListSortDirection

public enum ListSortDirection Ascending0 按升序排序。 Descending1 按降序排序。 ListCollectionView cv (ListCollectionView)CollectionViewSource.GetDefaultView(listobject); cv.Filter new Predicate<object>(IsBool); cv.SortDescriptions.Add(new SortDesc…

分享一个超炫HTML5开发的jQuery进度条插件 - percentageloader

在线演示 本地下载 今天我们分享一个超酷的使用HTML5画布技术开发的进度条插件 - percentageloader。这个插件比普通的水平进度条使用更加炫酷的效果&#xff0c;图形效果类似以前我们介绍的jQuery knob插件 &#xff0c;这个插件使用快捷简单&#xff0c;可以非常好的应用到…

【乌龟爬】之.NET中的嵌入语言与宿主的交互

这个题目已经弄清楚了&#xff0c;可以研究一下进阶阶段的内容了&#xff0c;所以改了题目&#xff0c;作为好好讨论的东西了。玩过魔兽或者Office的人都对嵌入式语言有一定了解&#xff0c;通过lua或者VBA&#xff0c;你可以操作宿主语言里的物件&#xff0c;可能是一个人物角…

ObservableCollection OrderByDescending 多重条件排序

ThenByDescending 根据某个键按降序对序列中的元素执行后续排序 InfoModel new ObservableCollection<InfoModel>(nfoModels.OrderByDescending(v>v.Date).ThenByDescending(v>v.No));

【二】ArcGIS Silverlight 客户端 1-2-3

在ArcGIS API 里已经定义了多种类型的地图层&#xff08;这里避免用图层以免和SL的cavas混淆&#xff09;&#xff0c;它们都可以直接添加到地图控件里&#xff0c;这些地图层的地图资源可以是来自上一篇罗列的ESRI公司的免费地图&#xff0c;也可以是自己用arcgis server 发布…

网页的浏览器兼容性设计

1. <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]--> 2. <!--[if IE]> 所有的IE可识别 <![endif]--> 3. <!--[if IE 5.0]> 只有IE5.0可以识别 <![endif]--> 4. <!--[if IE 5]> 仅IE5.0与IE5.5可以识别 <![endif]--&…

[Err] 1146 [Err] 1682

[Err] 1146 - Table performance_schema.session_status doesnt exist 找到安装MySQL的bin目录 在cmd输入 mysql_upgrade -u root -p --force 回车&#xff0c;然后输入密码即可 [Err] 1682: Native table performance_schema.session_variables has the wrong structure r…

ironruby 控制乌龟爬

现在可以用ironruby控制乌龟爬了 [code] up 10 lt 5 up 10 lt 10 up 11 rt 10 [/code][img]http://dl.iteye.com/upload/attachment/249223/c2c6e30a-6e99-35e8-a5c6-4d53d1deb66e.png[/img]但是问题有21. ScriptEngin.Runtime.Globals里的变量 为什么在ruby里无法得到&#xf…