maptip属性

前台

<UserControl x:Class="ArcGISSilverlightSDK.GraphicsMapTip"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:esri="http://schemas.esri.com/arcgis/client/2009">     <Grid x:Name="LayoutRoot">

<Grid.Resources>             <esri:SimpleFillSymbol x:Key="DefaultFillSymbol" Fill="#01FFFFFF" BorderBrush="#88000000"                                           BorderThickness="2" />             <esri:SimpleMarkerSymbol x:Key="DefaultMarkerSymbol" Color="Red" Size="6" Style="Diamond" />         </Grid.Resources>

<esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000">             <esri:ArcGISTiledMapServiceLayer ID="BaseMapLayer"                         Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />

<esri:GraphicsLayer ID="StatesGraphicsLayer">                 <esri:GraphicsLayer.MapTip>                     <Border esri:GraphicsLayer.MapTipHideDelay="00:00:01.5" CornerRadius="10" BorderBrush="#FF222957" BorderThickness="3" Margin="0,0,15,15">                         <Border.Background>                             <LinearGradientBrush EndPoint="1.038,1.136" StartPoint="0.015,0.188">                                 <GradientStop Color="#FFD1DFF2"/>                                 <GradientStop Color="#FF092959" Offset="0.946"/>                             </LinearGradientBrush>                         </Border.Background>                         <Border.Effect>                             <DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" />                         </Border.Effect>                         <StackPanel Orientation="Vertical" Margin="20,15,20,15">                             <StackPanel Orientation="Horizontal" Margin="0,0,0,6">                                 <TextBlock Text="State Name: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" />                                 <TextBlock Text="{Binding [STATE_NAME]}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" />                             </StackPanel>                             <StackPanel Orientation="Horizontal">                                 <TextBlock Text="Population 2007: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" />                                 <TextBlock Text="{Binding [POP2007]}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" />                             </StackPanel>                         </StackPanel>                     </Border>                 </esri:GraphicsLayer.MapTip>             </esri:GraphicsLayer>

<esri:GraphicsLayer ID="CitiesGraphicsLayer">                 <esri:GraphicsLayer.MapTip>                     <Border BorderBrush="DarkGray" CornerRadius="13" BorderThickness="1" Margin="0,0,15,15">                         <Border.Effect>                             <DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" />                         </Border.Effect>                         <Border CornerRadius="10" Background="#DDFFEEEE" BorderThickness="5" BorderBrush="#77FF0000">                             <StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="10">                                 <StackPanel Orientation="Horizontal">                                     <TextBlock Text="City Name: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="10" VerticalAlignment="Center"/>                                     <TextBlock Text="{Binding [CITY_NAME]}" HorizontalAlignment="Left" VerticalAlignment="Center" />                                 </StackPanel>                                 <StackPanel Orientation="Horizontal">                                     <TextBlock Text="Population: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="10" VerticalAlignment="Center" />                                     <TextBlock Text="{Binding [POP1990]}" HorizontalAlignment="Left" VerticalAlignment="Center" />                                 </StackPanel>                             </StackPanel>                         </Border>                     </Border>                 </esri:GraphicsLayer.MapTip>             </esri:GraphicsLayer>

</esri:Map>

<Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" >             <Rectangle Fill="#77919191" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5" >                 <Rectangle.Effect>                     <DropShadowEffect/>                 </Rectangle.Effect>             </Rectangle>             <Rectangle Fill="#DDFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,14" Height="42" />             <TextBlock Text="Hover over a state or city to see the GraphicsLayer MapTip." TextAlignment="Center" Margin="25,25,25,25" />         </Grid>

</Grid> </UserControl>

后台

using System; using System.Windows.Controls; using ESRI.ArcGIS.Client.Tasks;

namespace ArcGISSilverlightSDK {   public partial class GraphicsMapTip : UserControl   {     public GraphicsMapTip()     {       InitializeComponent();

MyMap.PropertyChanged += MyMap_PropertyChanged;     }

void MyMap_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)     {       if (e.PropertyName == "SpatialReference")       {         StatesGraphicsLayerLoad();         CitiesGraphicsLayerLoad();         MyMap.PropertyChanged -= MyMap_PropertyChanged;       }     }

void StatesGraphicsLayerLoad()     {       ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query()       {         Geometry = new ESRI.ArcGIS.Client.Geometry.Envelope(-180, 0, 0, 90) { SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(4326) },                       ReturnGeometry = true,         OutSpatialReference = MyMap.SpatialReference       };       query.OutFields.Add("*");

QueryTask queryTask = new QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5");       queryTask.ExecuteCompleted += StatesGraphicsLayerQueryTask_ExecuteCompleted;       queryTask.ExecuteAsync(query);     }

void StatesGraphicsLayerQueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs queryArgs)     {       if (queryArgs.FeatureSet == null)         return;

FeatureSet resultFeatureSet = queryArgs.FeatureSet;       ESRI.ArcGIS.Client.GraphicsLayer graphicsLayer =       MyMap.Layers["StatesGraphicsLayer"] as ESRI.ArcGIS.Client.GraphicsLayer;

if (resultFeatureSet != null && resultFeatureSet.Features.Count > 0)       {         foreach (ESRI.ArcGIS.Client.Graphic graphicFeature in resultFeatureSet.Features)         {           graphicFeature.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;           graphicsLayer.Graphics.Add(graphicFeature);         }       }     }

private void CitiesGraphicsLayerLoad()     {       ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query()       {         Geometry = new ESRI.ArcGIS.Client.Geometry.Envelope(-180, 0, 0, 90) { SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(4326) },         ReturnGeometry = true,         OutSpatialReference = MyMap.SpatialReference       };       query.OutFields.Add("*");       query.Where = "POP1990 > 100000";       QueryTask queryTask = new QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0");       queryTask.ExecuteCompleted += CitiesGraphicsLayerQueryTask_ExecuteCompleted;       queryTask.ExecuteAsync(query);     }

void CitiesGraphicsLayerQueryTask_ExecuteCompleted(object sender, QueryEventArgs queryArgs)     {       if (queryArgs.FeatureSet == null)         return;

FeatureSet resultFeatureSet = queryArgs.FeatureSet;       ESRI.ArcGIS.Client.GraphicsLayer graphicsLayer =       MyMap.Layers["CitiesGraphicsLayer"] as ESRI.ArcGIS.Client.GraphicsLayer;

if (resultFeatureSet != null && resultFeatureSet.Features.Count > 0)       {         foreach (ESRI.ArcGIS.Client.Graphic graphicFeature in resultFeatureSet.Features)         {           graphicFeature.Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;           graphicsLayer.Graphics.Add(graphicFeature);         }       }     }   } }

时间: 2024-10-16 11:57:14

maptip属性的相关文章

Vue.js学习笔记:属性绑定 v-bind

v-bind  主要用于属性绑定,Vue官方提供了一个简写方式 :bind,例如: <!-- 完整语法 --> <a v-bind:href="url"></a> <!-- 缩写 --> <a :href="url"></a> 绑定HTML Class 一.对象语法: 我们可以给v-bind:class 一个对象,以动态地切换class.注意:v-bind:class指令可以与普通的class特

HTML5新增Canvas标签及对应属性、API详解(基础一)

知识说明: HTML5新增的canvas标签,通过创建画布,在画布上创建任何想要的形状,下面将canvas的API以及属性做一个整理,并且附上时钟的示例,便于后期复习学习!Fighting! 一.标签原型 <canvas width=”1000” height=”1000” id=”myCanvas”> 您的浏览器版本过低,不支持HTML5新增的canvas标签. </canvas> 使用js获取该画布,并指定对象 <script> Var canvasID = doc

CSS3 中的 box-sizing属性

语法: box-sizing: content-text | border-box | inherit; content-box(默认): 宽度和高度分别应用元素的内容框:在宽度和高度之外绘制元素的内边距和边框. border-box: 为元素设定的宽度和高度决定了元素的边框盒:就是说,为元素指定的任何内边距和边框都将在已设定的宽度和高度内进行绘制:通过从已设定的宽度和高度分别减去边框和内边距才能得到内容的宽度和高度. inherit: 规定从父元素继承box-sizing属性的值. 示例: c

WPF 依赖属性概念

理解依赖属性 在 WPF 中变成相比较于 传统 Windows Forms 变成发生了较大的改变. 属性现在以一组服务的形式提供给开发人员. 这组服务就叫做属性系统. 由 WPF 属性系统所支持的属性成为依赖属性. 依赖属性的概念 WPF 在依赖属性中提供了标准属性无法提供的功能, 特性如下: 决定属性值: 依赖属性的属性值可以在运行时有其他元素或者是其他信息所决定, 决定的过程具有一个优先次序. 自动验证或变更通知: 依赖属性哟一个自定的回调方法, 当属性值变更时被执行, 这个回调能验证新的值

C#通过对象属性名修改值

摘自:csdn 给一个对象属性赋值可以通过PropertyInfo.SetValue()方式进行赋值,但要注意值的类型要与属性保持一致. 创建对象实例的两种方法: 1. var obj = Assembly.Load("AssemblyName").CreateInstance("AssemblyName"+"ClassFullName"); 2. var obj = Activator.CreateInstance(ClassType); 创建

20.5 Shell脚本中的逻辑判断;20.6 文件目录属性判断;20.7 if特殊用法;20.8 20.9 cace判断(上下)

扩展: select用法 http://www.apelearn.com/bbs/thread-7950-1-1.html 20.5 Shell脚本中的逻辑判断 格式1:if 条件 ; then 语句; fi 1. 创建if1.sh测试脚本: [[email protected] ~]# vi if1.sh a=5,如果a大于3,满足这个条件,显示ok 添加内容: #!/bin/bash a=5 if [ $a -gt 3 ] then echo ok fi 2. 执行if1.sh脚本: [[e

Meta http-equiv属性详解

http-equiv顾名思义,相当于http的文件头作用,它可以向浏览器传回一些有用的信息,以帮助正确和精确地显示网页内容,与之对应的属性值为content,content中的内容其实就是各个参数的变量值. 引用 meat标签的http-equiv属性语法格式是:<meta http-equiv="参数" content="参数变量值"> :其中http-equiv属性主要有以下几种参数: 1.Expires(期限) 说明:可以用于设定网页的到期时间.一

Js中的数据属性和访问器属性

Js中的数据属性和访问器属性 在javaScript中,对象的属性分为两种类型:数据属性和访问器属性. 一.数据属性 1.数据属性:它包含的是一个数据值的位置,在这可以对数据值进行读写. 2.数据属性包含四个特性,分别是: configurable:表示能否通过delete删除属性从而重新定义属性,能否修改属性的特性,或能否把属性修改为访问器属性,默认为true enumerable:表示能否通过for-in循环返回属性 writable:表示能否修改属性的值 value:包含该属性的数据值.默

跟陈湾来完善C++(2), 添加属性功能

上面几篇文章中,我们添加了名称空间优化,添加事件功能.这些对我来说其实已经够了.但还可以加一个属性功能. 当我们在C++中更改一个属性时,平常都是Get函数加上Set函数,但是这样,没有直接写一个成员变量方便.例如: a.SetValue(a.GetValue() + 1); 没有 a.Value = a.Value + 1; 方便. 但是这种方便只有在调用有属性功能的对象时才能使用.在创建属性的时候我还是用老套路,写一个Get和Set函数,该干啥还是干啥.我的属性功能其实就是在类中添加一个共有