《ESRI中国社区管理规则》(新手必读)GIS大讲堂内全部讲座索引
返回列表 回复 发帖

[专家讲座] ArcGIS API for Silverlight/ 开发入门 环境搭建

本帖最后由 yyilyzbc 于 2009-3-30 21:28 编辑

Silverlight/ 开发入门 环境搭建
1 Silverlight SDK
下载ArcGIS API for Microsoft Silverlight/WPF ,需要注册一个ESRI Gloab 账户。
下载地址http://resources.esri.com/arcgisserver/apis/silverlight/
2 开发环境:
1)Visual Studio 2008 SP1 或者 Visual Web Developer Express with SP1
下载地址 :
Visual Studio 2008 SP1:
http://msdn.microsoft.com/en-us/vs2008/products/cc268305.aspx
Visual Web Developer Express with SP1:
http://www.microsoft.com/express/vwd
不想装vs2008的话,可以选择vwd,安装文件比较小
2)Silverlight Tools for Visual Studio 2008 SP1 (add-on)
下载地址
http://www.microsoft.com/downloads/details.aspx?FamilyId=c22d6a7b-546f-4407-8ef6-d60c8ee221ed&displaylang=en
首先安装vs2008或者vwd,然后安装Silverlight Tools for Visual Studio 2008 SP1,开发环境就搭建好了。
3 helloWorld
1)打开vwd,新建一个Silverlight工程。

2)选择Add a New ASP.NET web project to solution to host  Silverlight

3) 点击ok

4) 添加引用,找到siliverlight SDK 目录下面siliverlight\ESRI.ArcGIS.dll

5) 将如下代码添加到page.axml中
  1. <UserControl x:Class="HelloWorld.Page"
  2.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.     xmlns:esri="clr-namespace:ESRI.ArcGIS;assembly=ESRI.ArcGIS"
  5.     xmlns:esriSymbols="clr-namespace:ESRI.ArcGIS.Symbols;assembly=ESRI.ArcGIS"
  6.     xmlns:esriGeometry="clr-namespace:ESRI.ArcGIS.Geometry;assembly=ESRI.ArcGIS"
  7.     >
  8.     <Grid x:Name="LayoutRoot" Background="White">
  9.         <Grid.Resources>
  10.             <esriSymbols:SimpleMarkerSymbol x:Key="RedMarkerSymbol" Color="Red" Size="12" Style="Circle" />
  11.             <esriSymbolsictureMarkerSymbol x:Key="PinPictureMarkerSymbol" OffsetX="11" OffsetY="39" Source="/Assets/images/i_pushpin.png" />
  12.             <esriSymbolsictureMarkerSymbol x:Key="GlobePictureMarkerSymbol" OffsetX="8" OffsetY="8" Source="/Assets/images/globe-16x16.png" />
  13.             <esriSymbols:SimpleLineSymbol x:Key="RedLineSymbol" Color="Red" Width="4" Style="Solid" />
  14.             <esriSymbols:CartographicLineSymbol x:Key="CartoLineSymbol" Color="Green" Width="4" DashCap="Triangle" DashArray="5 1" />
  15.             <esriSymbols:SimpleFillSymbol x:Key="RedFillSymbol" Fill="#66FF0000" BorderBrush="Red" BorderThickness="2" />
  16.             <esriSymbolsictureFillSymbol x:Key="GlobePictureFillSymbol" Source="/Assets/images/globe-16x16.png" />
  17.         </Grid.Resources>
  18.         <esri:Map x:Name="myMap">
  19.             <esri:Map.Layers>
  20.                 <esri:ArcGISTiledMapServiceLayer ID="StreetMap" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
  21.                 <esri:GraphicsLayer ID="MyGraphics" />
  22.             </esri:Map.Layers>
  23.         </esri:Map>
  24.     </Grid>
  25. </UserControl>
复制代码
6)编译 运行 。
附件: 您所在的用户组无法下载或查看附件
5

评分次数

论坛排版有问题~~~~~~~~
排版试没以前好用~~二号是准备来个连载么?
排版试没以前好用~~二号是准备来个连载么?
linakulamatata 发表于 2009-3-22 17:59
最近事情比较多,业余时间研究一下8 和flex API 差不多,其中FeatureLayer 很不错,效果很炫
1

评分次数

各位斑主在华山论剑,呵呵!版主们动作真的很快!
siliverlight值得期待~~~~~~~
siliverlight? 不懂, 看来需要补一下
共同关注哦
补充一下,如果使用本机服务显示空白的话,很可能是没有设置允许跨域操作的xml文件。在网站根目录下放置一个crossdomain.xml或者clientaccesspolicy.xml文件就好了(也可以两个都放上)。
3

评分次数

呵呵,期待silver light的好作品~~
想和大家一起成长 在gis的道路上我也能留下两个脚印
返回列表
ESRI中国图书中心