arcgis导入坐标点 API for JavaScript根据点坐标画圆

今天看啥 热点:
Arcgis for js加载百度地图,arcgisjs
在前面的文章里提到了Arcgis for js加载天地图,在本节,继续讲解如何在Arcgis for js中加载百度地图。
影像-无标注
影像-有标注
第一,在此感谢/chenyuming/p/3343729.html这篇文章的主人,给了我很大的启发与帮助,因为一直在找相关的参数,都不对,只有这个参数是没有问题的。
第二,百度地图可调用的有地图切片,影像切片,以及道路等POI切片,我将之用TiledMapServiceLayer做了扩展,成了BDAnoLayer,BDVecLayer,BDimgLayer三个图层,其代码如下:
BDAnoLayer.js
define([&dojo/_base/declare&,
&esri/layers/tiled&],
function (declare) {
return declare(esri.layers.TiledMapServiceLayer, {
constructor: function () {
this.spatialReference = new esri.SpatialReference({ wkid: 102100 });
this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-7892, -08.7892, this.spatialReference));
this.scale = [63.889,944,472,236,618,
309,155,577,289,144,572,,
this.resolution = [928,.,91.,2499,
.,152.,76.2,38.6,19.3,9.15,
4.37,2.68,1.05,0.817,0.617];
this.tileInfo = new esri.layers.TileInfo({
&rows&: 256,
&cols&: 256,
&compressionQuality&: 90,
&origin&: {
&x&: -7892,
&spatialReference&: this.spatialReference,
&lods&: [{ &level&: 0, &resolution&: this.resolution[0], &scale&: this.scale[0] },
{ &level&: 1, &resolution&: this.resolution[1], &scale&: this.scale[1] },
{ &level&: 2, &resolution&: this.resolution[2], &scale&: this.scale[2] },
{ &level&: 3, &resolution&: this.resolution[3], &scale&: this.scale[3] },
{ &level&: 4, &resolution&: this.resolution[4], &scale&: this.scale[4] },
{ &level&: 5, &resolution&: this.resolution[5], &scale&: this.scale[5] },
{ &level&: 6, &resolution&: this.resolution[6], &scale&: this.scale[6] },
{ &level&: 7, &resolution&: this.resolution[7], &scale&: this.scale[7] },
{ &level&: 8, &resolution&: this.resolution[8], &scale&: this.scale[8] },
{ &level&: 9, &resolution&: this.resolution[9], &scale&: this.scale[9] },
{ &level&: 10, &resolution&: this.resolution[10], &scale&: this.scale[10] },
{ &level&: 11, &resolution&: this.resolution[11], &scale&: this.scale[11] },
{ &level&: 12, &resolution&: this.resolution[12], &scale&: this.scale[12] },
{ &level&: 13, &resolution&: this.resolution[13], &scale&: this.scale[13] },
{ &level&: 14, &resolution&: this.resolution[14], &scale&: this.scale[14] },
{ &level&: 15, &resolution&: this.resolution[15], &scale&: this.scale[15] },
{ &level&: 16, &resolution&: this.resolution[16], &scale&: this.scale[16] },
{ &level&: 17, &resolution&: this.resolution[17], &scale&: this.scale[17] },
{ &level&: 18, &resolution&: this.resolution[18], &scale&: this.scale[18] },
{ &level&: 19, &resolution&: this.resolution[19], &scale&: this.scale[19] }
this.loaded =
this.onLoad(this);
getTileUrl: function (level, row, col) {
var zoom = level - 1;
var offsetX = parseInt(Math.pow(2, zoom));
var offsetY = offsetX - 1;
var numX = col - offsetX, numY = (-row) + offsetY ;
var num = (col + row) % 8 + 1;
return &http://online& + num + &./tile/?qt=tile&x=&+numX+&&y=&+numY+&&z=&+level+&&styles=sl&udt=&;
BDVecLayer.js
define([&dojo/_base/declare&,
&esri/layers/tiled&],
function (declare) {
return declare(esri.layers.TiledMapServiceLayer, {
constructor: function () {
this.spatialReference = new esri.SpatialReference({ wkid: 102100 });
this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-7892, -08.7892, this.spatialReference));
this.scale = [63.889,944,472,236,618,
309,155,577,289,144,572,,
this.resolution = [928,.,91.,2499,
.,152.,76.2,38.6,19.3,9.15,
4.37,2.68,1.05,0.817,0.617];
this.tileInfo = new esri.layers.TileInfo({
&rows&: 256,
&cols&: 256,
&compressionQuality&: 90,
&origin&: {
&x&: -7892,
&spatialReference&: this.spatialReference,
&lods&: [{ &level&: 0, &resolution&: this.resolution[0], &scale&: this.scale[0] },
{ &level&: 1, &resolution&: this.resolution[1], &scale&: this.scale[1] },
{ &level&: 2, &resolution&: this.resolution[2], &scale&: this.scale[2] },
{ &level&: 3, &resolution&: this.resolution[3], &scale&: this.scale[3] },
{ &level&: 4, &resolution&: this.resolution[4], &scale&: this.scale[4] },
{ &level&: 5, &resolution&: this.resolution[5], &scale&: this.scale[5] },
{ &level&: 6, &resolution&: this.resolution[6], &scale&: this.scale[6] },
{ &level&: 7, &resolution&: this.resolution[7], &scale&: this.scale[7] },
{ &level&: 8, &resolution&: this.resolution[8], &scale&: this.scale[8] },
{ &level&: 9, &resolution&: this.resolution[9], &scale&: this.scale[9] },
{ &level&: 10, &resolution&: this.resolution[10], &scale&: this.scale[10] },
{ &level&: 11, &resolution&: this.resolution[11], &scale&: this.scale[11] },
{ &level&: 12, &resolution&: this.resolution[12], &scale&: this.scale[12] },
{ &level&: 13, &resolution&: this.resolution[13], &scale&: this.scale[13] },
{ &level&: 14, &resolution&: this.resolution[14], &scale&: this.scale[14] },
{ &level&: 15, &resolution&: this.resolution[15], &scale&: this.scale[15] },
{ &level&: 16, &resolution&: this.resolution[16], &scale&: this.scale[16] },
{ &level&: 17, &resolution&: this.resolution[17], &scale&: this.scale[17] },
{ &level&: 18, &resolution&: this.resolution[18], &scale&: this.scale[18] },
{ &level&: 19, &resolution&: this.resolution[19], &scale&: this.scale[19] }
this.loaded =
this.onLoad(this);
getTileUrl: function (level, row, col) {
var zoom = level - 1;
var offsetX = parseInt(Math.pow(2, zoom));
var offsetY = offsetX - 1;
var numX = col - offsetX, numY = (-row) + offsetY ;
var num = (col + row) % 8 + 1;
return &http://online& + num + &./tile/?qt=tile&x=&+numX+&&y=&+numY+&&z=&+level+&&styles=pl&scaler=1&udt=&;
BDimgLayer.js
define([&dojo/_base/declare&,
&esri/layers/tiled&],
function (declare) {
return declare(esri.layers.TiledMapServiceLayer, {
constructor: function () {
this.spatialReference = new esri.SpatialReference({ wkid: 102100 });
this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-7892, -08.7892, this.spatialReference));
this.scale = [63.889,944,472,236,618,
309,155,577,289,144,572,,
this.resolution = [928,.,91.,2499,
.,152.,76.2,38.6,19.3,9.15,
4.37,2.68,1.05,0.817,0.617];
this.tileInfo = new esri.layers.TileInfo({
&rows&: 256,
&cols&: 256,
&compressionQuality&: 90,
&origin&: {
&x&: -7892,
&spatialReference&: this.spatialReference,
&lods&: [{ &level&: 0, &resolution&: this.resolution[0], &scale&: this.scale[0] },
{ &level&: 1, &resolution&: this.resolution[1], &scale&: this.scale[1] },
{ &level&: 2, &resolution&: this.resolution[2], &scale&: this.scale[2] },
{ &level&: 3, &resolution&: this.resolution[3], &scale&: this.scale[3] },
{ &level&: 4, &resolution&: this.resolution[4], &scale&: this.scale[4] },
{ &level&: 5, &resolution&: this.resolution[5], &scale&: this.scale[5] },
{ &level&: 6, &resolution&: this.resolution[6], &scale&: this.scale[6] },
{ &level&: 7, &resolution&: this.resolution[7], &scale&: this.scale[7] },
{ &level&: 8, &resolution&: this.resolution[8], &scale&: this.scale[8] },
{ &level&: 9, &resolution&: this.resolution[9], &scale&: this.scale[9] },
{ &level&: 10, &resolution&: this.resolution[10], &scale&: this.scale[10] },
{ &level&: 11, &resolution&: this.resolution[11], &scale&: this.scale[11] },
{ &level&: 12, &resolution&: this.resolution[12], &scale&: this.scale[12] },
{ &level&: 13, &resolution&: this.resolution[13], &scale&: this.scale[13] },
{ &level&: 14, &resolution&: this.resolution[14], &scale&: this.scale[14] },
{ &level&: 15, &resolution&: this.resolution[15], &scale&: this.scale[15] },
{ &level&: 16, &resolution&: this.resolution[16], &scale&: this.scale[16] },
{ &level&: 17, &resolution&: this.resolution[17], &scale&: this.scale[17] },
{ &level&: 18, &resolution&: this.resolution[18], &scale&: this.scale[18] },
{ &level&: 19, &resolution&: this.resolution[19], &scale&: this.scale[19] }
this.loaded =
this.onLoad(this);
getTileUrl: function (level, row, col) {
var zoom = level - 1;
var offsetX = parseInt(Math.pow(2, zoom));
var offsetY = offsetX - 1;
var numX = col - offsetX, numY = (-row) + offsetY ;
var num = (col + row) % 8 + 1;
return &http://shangetu& + num + &./it/u=x=&+numX+&;y=&+numY+&;z=&+level+&;v=009;type=sate&fm=46&udt=&;
});从上面的getTileUrl可以看到,三者返回的url的地址是有区别的,在上述那边博文里面提到的url已经失效,为了得到最新的地址,我做了如下工作:
1、用百度地图JS API调用并显示百度地图,代码如下:
&!DOCTYPE html&
&meta http-equiv=&Content-Type& content=&text/ charset=utf-8& /&
&meta name=&viewport& content=&initial-scale=1.0, user-scalable=no& /&
&style type=&text/css&&
body, html,#allmap {width: 100%;height: 100%;overflow:margin:0;font-family:&微软雅黑&;}
&script type=&text/javascript& src=&http://api./api?v=2.0&ak=你的秘钥&&&/script&
&title&地图展示&/title&
&div id=&allmap&&&/div&
&script type=&text/javascript&&
// 百度地图API功能
var map = new BMap.Map(&allmap&);
// 创建Map实例
map.centerAndZoom(new BMap.Point(116.404, 39.915), 5);
// 初始化地图,设置中心点坐标和地图级别
map.addControl(new BMap.MapTypeControl());
//添加地图类型控件
map.setCurrentCity(&北京&);
// 设置地图显示的城市 此项是必须设置的
map.enableScrollWheelZoom(true);
//开启鼠标滚轮缩放
&/script&2、F12打开Chrom调试——NetWork——左边找一张切片,右边切换至Preview面板
如此,URL即为切片的Url,其中online后面的数字2即为代码中的num,x为代码中的numX,y为numY,z为缩放级别。
第三,调用显示
调用显示比较简单,代码如下:
&!DOCTYPE html&
&meta http-equiv=&Content-Type& content=&text/ charset=utf-8& /&
&title&Baidu Map&/title&
&link rel=&stylesheet& href=&http://localhost/arcgis_js_api/library/3.9/3.9/js/dojo/dijit/themes/tundra/tundra.css&&
&link rel=&stylesheet& href=&http://localhost/arcgis_js_api/library/3.9/3.9/js/esri/css/esri.css&&
html, body, #map {
height: 100%;
margin: 0;
padding: 0;
.base-map-ano{
background: #e6edf1;
border: #96aed1 1
padding: 4px 5
padding-left: 0
padding-top: 0
font-weight:
.base-map{
background: #f0f0f0;
border: #96aed1 1
z-index: 99;
font:normal 11px &宋体&,A
color:#868686;
.base-map-switch{
padding: 4px 8
.base-map-switch-active{
background:#e6edf1;
font-weight:
color: #4d4d4d;
.base-map-switch:hover{
.base-map-switch-center{
border: 1px #96aed1
border-top:
border-bottom:
&script type=&text/javascript&&
dojoConfig = {
parseOnLoad: true,
packages: [{
name: 'bdlib',
location: this.location.pathname.replace(/\/[^/]+$/, &&)+&/js/bdlib&
&script src=&http://localhost/arcgis_js_api/library/3.9/3.9/init.js&&&/script&
&script src=&js/jquery-1.8.3.js&&&/script&
var map,showMap,anoC
require([&esri/map&,
&bdlib/BDVecLayer&,
&bdlib/BDImgLayer&,
&bdlib/BDAnoLayer&,
&esri/layers/FeatureLayer&,
&esri/geometry/Point&,
&esri/SpatialReference&,
&dojo/domReady!&],
function (Map,
BDVecLayer,
BDImgLayer,
BDAnoLayer,
FeatureLayer,
SpatialReference
map = new Map(&map&, {
logo: false
var vecMap = new BDVecLayer();
var imgMap = new BDImgLayer();
var anoMap = new BDAnoLayer();
map.addLayer(vecMap);
map.addLayers([imgMap,anoMap]);
imgMap.hide(),anoMap.hide();
var pt = new Point(3474, new SpatialReference({ wkid: 102100 }));
map.centerAndZoom(pt, 5);
showMap = function(layer){
//设置按钮样式
var baseMap = [&vec&,&img&];
for(var i= 0, dl=baseMap.i&i++){
$(&#&+baseMap[i]).removeClass(&base-map-switch-active&);
$(&#&+layer).addClass(&base-map-switch-active&);
//设置显示地图
switch(layer){
case &img&:{//影像
vecMap.hide();
imgMap.show();
$(&#ano&).show();
default :{//地图
vecMap.show();
imgMap.hide(),anoMap.hide();
$(&#ano&).hide();
$(&#chkAno&).attr(&checked&,false);
anoCtrl = function(){
if($(&#chkAno&).attr(&checked&)){
anoMap.show();
anoMap.hide();
&div id=&map&&
&div class=&base-map&&
&div id=&vec& class=&base-map-switch base-map-switch-active& onclick=&showMap('vec')&&地图&/div&
&div id=&img& class=&base-map-switch base-map-switch-center&
onclick=&showMap('img')&&影像
&div id=&ano& class=&base-map-ano&&
&input id=&chkAno& type=&checkbox& name=&chkAno& value=&chkAno& onchange=&anoCtrl()&/&标注
相关搜索:
相关阅读:
相关频道:
&&&&&&&&&&&&&&&&&&
WEB前端教程最近更新当使用Query查询时,会用如下配置var queryTask = new esri.tasks.QueryTask(applicationModelOneSearchPOIURL); var query = new esri.tasks.Query(); query.geometry = query.outSpatialReference = map.spatialR query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS; query.returnGeometry = queryTask.execute(query, ApplicationModelOneGetSearchData, ErrorCallBack);一般使用框选的时候对query.geometry,我们一般会赋予一个Extent变量,但是当我们需要用一个比如圆这种多边形的的Polygon去查询时,就会出现esri.config.defaults.io.proxyUrl 尚未进行设置”错误因为多边形(含有的point多)导致的web service的url的参数个数大于2048个,而我们这里采用的是get方式(最大的字符数为2048)不是post方式。所以我们需要一个proxy page做代理,具体参考http://blog.csdn.net/lz/article/details/7989391就是在在查询前加一句esri.config.defaults.io.proxyUrl = &proxy.ashx&;然后去网上下载相关的文件,在proxy.ashx和proxy.config中添加相应的配置代码就行了。在proxy.config中配置代码为添加& & &serverUrl url=&http://myserver/ArcGIS/rest/services/POI/Shoping/MapServer/0&matchAll=&true&token=&&&&/serverUrl&
无相关信息& & & & ArcGIS API for JavaScript. (JavaScript. API)是ESRI根据JavaScript技术实现的调用ArcGIS Server REST API接口的一组脚本。当前的最新版本是Version 3.8。通过ArcGIS API for JavaScript可以将ArcGIS Server提供的地图资源嵌入到Web应用中。JavaScript. API是基于Dojo框架的,使用了大量的Dojo技术,因此要想熟练掌握API用法,先要对Dojo框架有个深入的了解!& & 一:环境介绍& & (1)ArcGIS API for JavaScript. 3.7
下载地址:/apps/products/download/& & (2)Eclipse 3.7 +Tomcat 7 +JDK 7& & 二:搭建步骤& & (1)通过Eclipse 创建动态工程,如下:& & & & 点击Next :& & & & & & 输入Project Name:ArcgisForJs,设置Target runtime,点击Finish,工程目录如下 :& & & & (2)在工程WebContent下创建文件夹 arcgis_js& & (3)解压 arcgis_js_v37_api.zip ,拷贝 arcgis_js_v37_api\arcgis_js_api\library\3.7\3.7compact 下的内容到
文件夹下。& & (4)修改arcgis_js\init.js 和
arcgis_js\ js\dojo\dojo\dojo.js 两个文件,替换 [HOSTNAME_AND_PATH_TO_JSAPI]为
localhost:8080/ArcgisForJs/arcgis_js/ ,格式:IP:web服务器端口/工程名/创建的文件夹arcgis_js& & (5)在WebContent下创建文件 index.html,内容如下:& &
相关经验教程
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.001 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.005 收益
的原创经验被浏览,获得 ¥0.002 收益> ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等(三)--绘制点、线、圆,显示提示信息
ArcGis For Silverlight API,地图显示Gis,绘制点,线,绘制图等(三)--绘制点、线、圆,显示提示信息
平台:Vs 2010,Blend 4,Silverlight 4
调用API: ArcGis for Silverligth API(ESRI.ArcGIS.Client)
OK,今天又有空来写点啦,这个例子自己不想拉的太长了,所以这节多写点东西,我尽量把东西都介绍全面,有不懂的可以留言~
有空大家共同讨论。
好进入正题,如今天标题所示,我们先来看画点,线,圆吧!
&&&&&&public&void&DrawAnimationCompleted(Map&myMap,&List&Graphic&&point,ESRI.ArcGIS.Client.Geometry.PointCollection&pointLine) &{ &&&&&GraphicsLayer&gPointLayer&=&new&GraphicsLayer(); &&&&&GraphicsLayer&lineLayer&=&new&GraphicsLayer(); &&&&&SimpleLineSymbol&lineSymbol&=&new&SimpleLineSymbol(); &&&&&lineSymbol.Color&=&new&SolidColorBrush(Colors.Brown); &&&&&lineSymbol.Width&=&1; &&&&&lineSymbol.Style&=&SimpleLineSymbol.LineStyle.S &&&&&&&&&&&GisMap.AddLayersToMap(myMap,&new&GraphicsLayer[]&{&lineLayer&}); &&&&&GisLine.DrawLineOnMap(pointLine,&lineLayer,&lineSymbol); &&&&&&GisMap.DrawAllLayers(myMap,&new&GraphicsLayer[]&{&gPointLayer&},&point); &&&&&GisMap.AddLayersToMap(myMap,&new&GraphicsLayer[]&{&gPointLayer&}); &}&
好,看一下如何画圆吧。
&&&&&&&&&&public&void&DrawEllipse(Map&myMap,&Canvas&container,&MapPoint&pt,ref&ElementLayer&drawCircleLayer,&double&circleKm,Color&color,Color&ellipseStroke) &{ &&&&&if&(!drawCircleLayer.Children.Contains(container)) &&&&&{ &&&&&&&&&drawCircleLayer.Children.Add(container); &&&&&&&&&container.Opacity&=&0.5; &&&&&&&&&container.SetValue(ElementLayer.EnvelopeProperty,&new&Envelope(myMap.Extent.XMax,&myMap.Extent.YMax,&myMap.Extent.XMin,&myMap.Extent.YMin)); &&&&&} &&&&&&Point&ptFirst&=&myMap.MapToScreen(new&MapPoint(Convert.ToDouble(pt.X), &&&&&&&&&Convert.ToDouble(pt.Y))); &&&&&&Point&pt7&=&myMap.MapToScreen(new&MapPoint((Convert.ToDouble(pt.X)&+&circleKm&*&kmToEN), &&&&&&&&&Convert.ToDouble(pt.Y))); &&&&&&Ellipse&ellipse7&=&new&Ellipse(); &&&&&ellipse7.Width&=&(pt7.X&-&ptFirst.X)&*&2; &&&&&ellipse7.Height&=&ellipse7.W &&&&&ellipse7.StrokeThickness&=&1; &&&&&ellipse7.Stroke&=&new&SolidColorBrush(ellipseStroke); &&&&&ellipse7.Fill&=&new&SolidColorBrush(color); &&&&&Canvas.SetLeft(ellipse7,&ptFirst.X&-&ellipse7.Width&/&2); &&&&&Canvas.SetTop(ellipse7,&ptFirst.Y&-&ellipse7.Width&/&2); &&&&&ellipse7.Opacity&=&0.5; &&&&&&container.Children.Add(ellipse7); &&&&&container.IsHitTestVisible&=&false; &&&&&container.SetValue(Canvas.ZIndexProperty,&-10); &}&
这是一个画圆的方法,需要地图类,点,Canvas容器,Gis 的地图层ElementLayer和color
我前台是这样调用的
&{&&&&&&&&&&&&&&&&GisMap.DeleteLayersToMap(myMap,&&WindCircleLayer&);&&&&&&&&&&&&} &&&&&&&&&&&&&&ElementLayer&circleLayer&=&new&ElementLayer(); &&&&&&&&&&&&&circleLayer.ID&=&&WindCircleLayer&; &&&&&&&&&&&&&&Canvas&circleCanvas&=&new&Canvas(); &&&&&&&&&&&&&&Graphic&tipGraphic&=&sender&as&G &&&&&&&&&&&&&&if&(Convert.ToDouble(tipGraphic.Attributes[&WindCircle7&])&!=&0) &&&&&&&&&&&&&{ &&&&&&&&&&&&&&&&&Color&color&=&new&Color(); &&&&&&&&&&&&&&&&&color.A&=&255; &&&&&&&&&&&&&&&&&color.R&=&153; &&&&&&&&&&&&&&&&&color.G&=&105; &&&&&&&&&&&&&&&&&color.B&=&192; &&&&&&&&&&&&&&&&&&DrawEllipse(myMap,&circleCanvas,&new&MapPoint(Convert.ToDouble(tipGraphic.Attributes[&Longitude&]), &&&&&&&&&&&&&&&&&&&&&Convert.ToDouble(tipGraphic.Attributes[&Latitude&])),&ref&circleLayer, &&&&&&&&&&&&&&&&&&&&&Convert.ToDouble(300),&color,&Colors.Blue); &&&&&&&&&&&&&&} &&&&&&&&&&&&&&if&(Convert.ToDouble(tipGraphic.Attributes[&WindCircle10&])&!=&0) &&&&&&&&&&&&&{ &&&&&&&&&&&&&&&&&Color&color&=&new&Color(); &&&&&&&&&&&&&&&&&color.A&=&255; &&&&&&&&&&&&&&&&&color.R&=&111; &&&&&&&&&&&&&&&&&color.G&=&91; &&&&&&&&&&&&&&&&&color.B&=&171; &&&&&&&&&&&&&&&&&&this.DrawEllipse(myMap,&circleCanvas,&new&MapPoint(Convert.ToDouble(tipGraphic.Attributes[&Longitude&]), &&&&&&&&&&&&&&&&&&&&&Convert.ToDouble(tipGraphic.Attributes[&Latitude&])),&ref&circleLayer, &&&&&&&&&&&&&&&&&&&&&Convert.ToDouble(tipGraphic.Attributes[&WindCircle10&]),&color,&Colors.Blue); &&&&&&&&&&&&&} &&&&&&&&&&&&&&&GisMap.AddLayersToMap(myMap,&new&ElementLayer[]&{&circleLayer&}); &&&&&&&&&}&
这里的sender是一个Gis元素 Graphic,根据我的WebService 取到的实体后我把这个点加上了Attributes,一系列属性,所以在上面的代码可以看到tipGraphic.Attributes[&WindCircle10&],
下面的代码就是在我从WebService取到实体后做添加点的代码:
&&&&&&private&void&AddPointToGraphic(TyphoonModel&model,&int&i,&List&Graphic&&pointParam) &{ &&&&&SimpleMarkerSymbol&symbol&=&new&SimpleMarkerSymbol(); &&&&&Color&color&=&new&Color(); &&&&&color.A&=&255; &&&&& &&&&&if&(Convert.ToDouble(model.WS)&&=&17.1) &&&&&{ &&&&&&&&&color.R&=&0; &&&&&&&&&color.G&=&254; &&&&&&&&&color.B&=&223; &&&&&&&&&symbol.Color&=&new&SolidColorBrush(color); &&&&&} &&&&&else&if&(Convert.ToDouble(model.WS)&&&17.1&&&&Convert.ToDouble(model.WS)&&=&24.4) &&&&&{ &&&&&&&&&color.R&=&254; &&&&&&&&&color.G&=&243; &&&&&&&&&color.B&=&0; &&&&&&&&&symbol.Color&=&new&SolidColorBrush(color); &&&&&} &&&&&else&if&(Convert.ToDouble(model.WS)&&&24.4&&&&Convert.ToDouble(model.WS)&&=&32.6) &&&&&{ &&&&&&&&&color.R&=&254; &&&&&&&&&color.G&=&144; &&&&&&&&&color.B&=&44; &&&&&&&&&symbol.Color&=&new&SolidColorBrush(color); &&&&&} &&&&&else&if&(Convert.ToDouble(model.WS)&&&32.6&&&&Convert.ToDouble(model.WS)&&=&41.4) &&&&&{ &&&&&&&&&color.R&=&254; &&&&&&&&&color.G&=&4; &&&&&&&&&color.B&=&4;&symbol.Color&=&new&SolidColorBrush(color); &&&&&} &&&&&else&if&(Convert.ToDouble(model.WS)&&&41.4&&&&Convert.ToDouble(model.WS)&&=&50.9) &&&&&{ &&&&&&&&&color.R&=&254; &&&&&&&&&color.G&=&58; &&&&&&&&&color.B&=&163;&symbol.Color&=&new&SolidColorBrush(color); &&&&&} &&&&&else&if&(Convert.ToDouble(model.WS)&&&50.9) &&&&&{ &&&&&&&&&color.R&=&174; &&&&&&&&&color.G&=&0; &&&&&&&&&color.B&=&217;&symbol.Color&=&new&SolidColorBrush(color); &&&&&} &&&&&&symbol.Size&=&10; &&&&&if&(i&==&0) &&&&&{ &&&&&&&&&symbol.Style&=&SimpleMarkerSymbol.SimpleMarkerStyle.S &&&&&} &&&&&else&&&&&{ &&&&&&&&&symbol.Style&=&SimpleMarkerSymbol.SimpleMarkerStyle.C &&&&&} &&&&&&pointParam.Add(new&Graphic() &&&&&{ &&&&&&&&&Geometry&=&new&MapPoint(model.Longitude,&model.Latitude), &&&&&&&&&Symbol&=&symbol &&&&&}); &&&&&&pointParam[i].Attributes.Add(&TyphoonID&,&model.TyphoonID); &&&&&pointParam[i].Attributes.Add(&TyphoonNo&,&model.TyphoonNo); &&&&&pointParam[i].Attributes.Add(&TyphoonName&,&model.TyphoonName); &&&&&pointParam[i].Attributes.Add(&WindCircle7&,&model.WindCircle7); &&&&&pointParam[i].Attributes.Add(&WindCircle10&,&model.WindCircle10); &&&&&pointParam[i].Attributes.Add(&WS&,&model.WS); &&&&&pointParam[i].Attributes.Add(&Pressure&,&model.Pressure); &&&&&pointParam[i].Attributes.Add(&IssueTime&,&model.IssueTime); &&&&&pointParam[i].Attributes.Add(&Future&,&model.Future); &&&&&pointParam[i].Attributes.Add(&Latitude&,&model.Latitude); &&&&&pointParam[i].Attributes.Add(&Longitude&,&model.Longitude); &}&
信息提示功能如图:
我们先看下Xmal中的代码:
&x:Name=&typhoonPointInfoCanvas&&Visibility=&Visible&&Height=&188&&HorizontalAlignment=&Left&&Margin=&0,-272,0,0&&VerticalAlignment=&Top&&Width=&360&&&&&&&Stretch=&Fill&&Stroke=&Black&&&Height=&168.5&&Width=&328.5&&UseLayoutRounding=&False&&Canvas.Left=&0.5&&Canvas.Top=&-0.5&&Data=&M113,25&C113,11...4,1.7..,25&L328,144&C328,157.482,168&304,168&L137,168&C123.3,157.4&z&M112.5,24..5,0.5&L112.5,72.499992&z&&Fill=&{StaticResource&CommonGradient2}&&&&&&&&Orientation=&Vertical&&Height=&168&&Width=&176&&Canvas.Left=&137&&Canvas.Top=&15&&&&&&&&&&&x:Name=&typhoonNameTextBlock&&Height=&20&&Text=&名称:&&Foreground=&White&&TextWrapping=&Wrap&&&&&&&&&&&x:Name=&typhoonCollectionTimeTextBlock&&Height=&20&&Text=&时间:&&Foreground=&White&&TextWrapping=&Wrap&&d:LayoutOverrides=&HorizontalAlignment&&&&&&&&&&&x:Name=&typhoonPositionTextBlock&&Height=&20&&Text=&位置:&&Foreground=&White&&TextWrapping=&Wrap&&d:LayoutOverrides=&HorizontalAlignment&&&&&&&&&&&x:Name=&typhoonWSTextBlock&&Height=&20&&Text=&最大风速:&&Foreground=&White&&TextWrapping=&Wrap&&d:LayoutOverrides=&HorizontalAlignment&&&&&&&&&&&x:Name=&typhoonPressureTextBlock&&Height=&20&&Text=&中心气压:&&Foreground=&White&&TextWrapping=&Wrap&&d:LayoutOverrides=&HorizontalAlignment&&&&&&&&&&&x:Name=&typhoonCircle7TextBlock&&Height=&20&&Text=&7级风圈半径:&&Foreground=&White&&TextWrapping=&Wrap&&d:LayoutOverrides=&HorizontalAlignment&&&&&&&&&&&x:Name=&typhoonCircle10TextBlock&&Height=&20&&Text=&10级风圈半径:&&Foreground=&White&&TextWrapping=&Wrap&&d:LayoutOverrides=&HorizontalAlignment&&&&&&&&&
& &LinearGradientBrush x:Key=&CommonGradient& StartPoint=&0.5,0& EndPoint=&0.5,1&&&& & & & & &&GradientStop Offset=&0& Color=&#ee76a8d3&/&&& & & & & &&GradientStop Offset=&0.25& Color=&#ee5b8cb5&/&&& & & & & &&GradientStop Offset=&0.75& Color=&#ee4b7ba7&/&&& & & &&/LinearGradientBrush
看下c# 中的代码:
当我们添加那些点也就是 Graphic 的时候有这样一个事件MouseEventHandler
&mapDraw.DrawLineAndPoint(ref&point,&myMap,&gLayer,&ref&pointLine,&e,&length); &&&&foreach&(Graphic&item&in&point) &{ &&&&&item.MouseEnter&+=&new&MouseEventHandler(MainPage_MouseEnter); &&&&&item.MouseLeave&+=&new&MouseEventHandler(MainPage_DrawLine); &}&
&&&&&&&&&public&void&DrawLineAndPoint(ref&List&Graphic&&point,Map&myMap,GraphicsLayer&gLayer, &&&&ref&ESRI.ArcGIS.Client.Geometry.PointCollection&pointLine,&GetTyphoonsCompletedEventArgs&e,&int&length) &{ &&&&&#region&添加点代码 &&&&&point&=&new&List&Graphic&(); &&&&&for&(int&i&=&0;&i&&&&i++) &&&&&{ &&&&&&&&&AddPointToGraphic(e.Result[i],&i,&point); &&&&&} &&&&&#endregion &&&&&&&&&&&pointLine&=&new&ESRI.ArcGIS.Client.Geometry.PointCollection(); &&&&&AddLineToMap(e.Result.ToList(),&length,&pointLine); &&&&&&&&&&&GisMap.DrawAllLayers(myMap,&new&GraphicsLayer[]&{&gLayer&},&point); &&&&&GisMap.AddLayersToMap(myMap,&new&GraphicsLayer[]&{&gLayer&}); &}&
&AddPointToGraphic这个方法就是图片上面的那段代码
&SPAN style=&FONT-SIZE: 14px&&&item.MouseEnter += new MouseEventHandler(MainPage_MouseEnter);&& &&&/SPAN&
item.MouseLeave += new MouseEventHandler(MainPage_DrawLine);
这两段代码就是我们添加鼠标移入和移出事件了,我们看下移入事件:
&class=cnblogs_Highlighter&class=brush:csharp&&&&&&&&void&MainPage_MouseEnter(object&sender,&MouseEventArgs&e) &&&&&&&&&{ &&&&&&&&&&&&&Graphic&graphic&=&sender&as&G &&&&&&&&&&&&&Cursor&=&Cursors.H &&&&&&&&&&&&&&typhoonPointInfoCanvas.Visibility&=&Visibility.V &&&&&&&&&&&&&&Point&pt&=&myMap.MapToScreen(new&MapPoint(Convert.ToDouble(graphic.Attributes[&Longitude&]),&Convert.ToDouble(graphic.Attributes[&Latitude&]))); &&&&&&&&&&&&&&typhoonPointInfoCanvas.SetValue(Grid.MarginProperty,&new&Thickness(pt.X,&pt.Y,&0,&0)); &&&&&&&&&&&&&&typhoonNameTextBlock.Text&=&&台风:&&+&graphic.Attributes[&TyphoonName&].ToString(); &&&&&&&&&&&&&typhoonCollectionTimeTextBlock.Text&=&&时间:&&+&graphic.Attributes[&IssueTime&].ToString(); &&&&&&&&&&&&&typhoonPositionTextBlock.Text&=&&位置:&&+&graphic.Attributes[&Longitude&].ToString()&+&&&E,&&+&graphic.Attributes[&Latitude&].ToString()&+&&&N&; &&&&&&&&&&&&&typhoonWSTextBlock.Text&=&&最大风速:&&+&graphic.Attributes[&WS&].ToString()&+&&&m/s&; &&&&&&&&&&&&&typhoonPressureTextBlock.Text&=&&中心气压:&&+&graphic.Attributes[&Pressure&].ToString()&+&&&hPa&; &&&&&&&&&&&&&typhoonCircle7TextBlock.Text&=&&7级风圈半径:&&+&graphic.Attributes[&WindCircle7&].ToString()&+&&&km&; &&&&&&&&&&&&&typhoonCircle10TextBlock.Text&=&&10级风圈半径:&&+&graphic.Attributes[&WindCircle10&].ToString()&+&&&km&; &&&&&&&&&&&&&&circle.DrawEllipse7And10WindCircle(myMap,&sender); &&&&&&&&&&&&&selectedGarphic&=&sender&as&G &&&&&&&&&}&&
我们看到在显示信息的同时我们又把圆画了上去&SPAN style=&FONT-SIZE: 14px&&DrawEllipse7And10WindCircle()这个函数&/SPAN&
GisMap是个静态类,以下是他的代码
&&&&&&public&static&class&GisMap &{ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&public&static&void&DrawSymbol(GraphicsLayer&glayer,&List&Graphic&&cacheGraphic) &&&&&{ &&&&&&&&&if&(glayer&!=&null) &&&&&&&&&{ &&&&&&&&&&&&&int&graphicCount&=&cacheGraphic.C &&&&&&&&&&&&&for&(int&i&=&0;&i&&&graphicC&i++) &&&&&&&&&&&&&{ &&&&&&&&&&&&&&&&&glayer.Graphics.Add(cacheGraphic[i]); &&&&&&&&&&&&&}&&&&&&&&&&} &&&&&}&
&&&&&&&&&public&static&void&DrawLayers(Map&map,&GraphicsLayer[]&layers,&params&List&Graphic&[]&graphicParam) &{ &&&&&&&&&&if&(layers&!=&null) &&&&&{ &&&&&&&&&int&length&=&layers.L &&&&&&&&&for&(int&i&=&0;&i&&&&i++) &&&&&&&&&{ &&&&&&&&&&&&&if&(layers[i]&==&null) &&&&&&&&&&&&&{ &&&&&&&&&&&&&&&&&layers[i]&=&new&GraphicsLayer(); &&&&&&&&&&&&&} &&&&&&&&&&&&&DynamicDrawSymbol(layers[i],&graphicParam[i],&map); &&&&&&&&&} &&&&&} &} &&&&&&&&&&&&public&static&void&DrawAllLayers(Map&map,&GraphicsLayer[]&layers,&params&List&Graphic&[]&graphicParam) &{ &&&&&&&&&&if&(layers&!=&null) &&&&&{ &&&&&&&&&int&length&=&layers.L &&&&&&&&&for&(int&i&=&0;&i&&&&i++) &&&&&&&&&{ &&&&&&&&&&&&&if&(layers[i]&==&null) &&&&&&&&&&&&&{ &&&&&&&&&&&&&&&&&layers[i]&=&new&GraphicsLayer(); &&&&&&&&&&&&&} &&&&&&&&&&&&&DrawAllGraphics(layers[i],&graphicParam[i]); &&&&&&&&&} &&&&&} &} &&&&&&&&&public&static&void&LayersVisibility(bool&show,&params&GraphicsLayer[]&layers) &{ &&&&&if&(layers&!=&null) &&&&&{ &&&&&&&&&foreach&(GraphicsLayer&item&in&layers) &&&&&&&&&{ &&&&&&&&&&&&&item.Visible&=& &&&&&&&&&} &&&&&} &} &&&&&&&&public&static&void&DeleteLayersToMap(Map&map,&GraphicsLayer[]&layers) &{ &&&&&&&&&&foreach&(GraphicsLayer&item&in&layers) &&&&&{ &&&&&&&&&map.Layers.Remove(item); &&&&&} &} &&&&&&&&public&static&void&DeleteLayersToMap(Map&map,&string[]&ID) &{ &&&&&int&length&=&ID.L &&&&&&for&(int&i&=&0;&i&&&&i++) &&&&&{ &&&&&&&&&foreach&(Layer&item&in&map.Layers) &&&&&&&&&{ &&&&&&&&&&&&&if&(item.ID&==&ID[i]) &&&&&&&&&&&&&{ &&&&&&&&&&&&&&&&&map.Layers.Remove(item); &&&&&&&&&&&&&&&&&length--; &&&&&&&&&&&&&&&&&break; &&&&&&&&&&&&&} &&&&&&&&&} &&&&&} &} &&&&&&&public&static&void&DeleteLayersToMap(Map&map,&ElementLayer[]&layers) &{ &&&&&&&&&&foreach&(ElementLayer&item&in&layers) &&&&&{ &&&&&&&&&map.Layers.Remove(item); &&&&&} &} &&&&&&&&public&static&void&DeleteLayersToMap(Map&myMap,&string&ID) &{ &&&&&int&layers&=&myMap.Layers.C &&&&&for&(int&i&=&0;&i&&&&i++) &&&&&{ &&&&&&&&&if&(myMap.Layers[i].ID&==&ID) &&&&&&&&&{ &&&&&&&&&&&&&myMap.Layers.RemoveAt(i); &&&&&&&&&&&&&return; &&&&&&&&&} &&&&&} &} &&&public&static&bool&LayerExist(Map&myMap,&string&ID) &{ &&&&&int&layers&=&myMap.Layers.C &&&&&for&(int&i&=&0;&i&&&&i++) &&&&&{ &&&&&&&&&if&(myMap.Layers[i].ID&==&ID) &&&&&&&&&{ &&&&&&&&&&&&&return&true; &&&&&&&&&} &&&&&} &&&&&return&false; &} &&&&&&&&public&static&void&AddLayersToMap(Map&map,&GraphicsLayer[]&layers) &{ &&&&&&&&&&foreach&(GraphicsLayer&item&in&layers) &&&&&{ &&&&&&&&&if&(item&!=&null) &&&&&&&&&{ &&&&&&&&&&&&&map.Layers.Add(item); &&&&&&&&&} &&&&&} &} &&&&&&&public&static&void&AddLayersToMap(Map&map,&ElementLayer[]&layers) &{ &&&&&&&&&&foreach&(ElementLayer&item&in&layers) &&&&&{ &&&&&&&&&map.Layers.Add(item); &&&&&} &} &&&&&&&public&static&void&AddImageToElementLayer(ElementLayer&eLayer,&List&Image&&image) &{ &&&&&if&(eLayer&!=&null) &&&&&{ &&&&&&&&&foreach&(Image&item&in&image) &&&&&&&&&{ &&&&&&&&&&&&&eLayer.Children.Add(item); &&&&&&&&&} &&&&&} &} &&&&&&&public&static&void&LayersVisibility(bool&show,&params&ElementLayer[]&layers) &{ &&&&&if&(layers&!=&null) &&&&&{ &&&&&&&&&foreach&(ElementLayer&item&in&layers) &&&&&&&&&{ &&&&&&&&&&&&&item.Visible&=& &&&&&&&&&} &&&&&} &} &&&&&&&&&public&static&void&DynamicDrawElementLayer(ElementLayer&eLayer,&List&UIElement&&cacheElement,&Map&map) &{ &&&&&&&&&&&&&&&&&&&&double&xMax&=&map.Extent.XMax&+&2; &&&&&double&xMin&=&map.Extent.XMin&-&2; &&&&&double&yMax&=&map.Extent.YMax&+&2; &&&&&double&yMin&=&map.Extent.YMin&-&2; &&&&&&&&&&&if&(eLayer&!=&null) &&&&&{ &&&&&&&&&int&graphicCount&=&eLayer.Children.C &&&&&&&&&for&(int&i&=&0;&i&&&graphicC&i++) &&&&&&&&&{ &&&&&&&&&&&&&UIElement&element&=&eLayer.Children[i]; &&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&&if&(!(((element.GetValue(ElementLayer.EnvelopeProperty)&as&Envelope).Extent.XMax&&&xMax&&&&(element.GetValue(ElementLayer.EnvelopeProperty)&as&Envelope).Extent.XMax&&&xMin) &&&&&&&&&&&&&&&&&&&&((element.GetValue(ElementLayer.EnvelopeProperty)&as&Envelope).Extent.YMax&&&yMax&&&&(element.GetValue(ElementLayer.EnvelopeProperty)&as&Envelope).Extent.YMax&&&yMin))) &&&&&&&&&&&&&{ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&cacheElement.Add(eLayer.Children[i]); &&&&&&&&&&&&&&&&&eLayer.Children.Remove(eLayer.Children[i]); &&&&&&&&&&&&&&&&&graphicCount--;&&&&&&&&&&&&&&&&&&&&i--;&&&&&&&&&&&&&&&&&&&&&&&&&&&} &&&&&&&&&}&&&&&&} &&&&&&&&&&&if&(cacheElement&!=&null) &&&&&{ &&&&&&&&&int&count&=&cacheElement.C &&&&&&&&&for&(int&i&=&0;&i&&&&i++) &&&&&&&&&{ &&&&&&&&&&&&&&&&&&&&&&&&&&if&(((cacheElement[i].GetValue(ElementLayer.EnvelopeProperty)&as&Envelope).Extent.XMax&&&xMax&&&&(cacheElement[i].GetValue(ElementLayer.EnvelopeProperty)&as&Envelope).Extent.XMax&&&xMin) &&&&&&&&&&&&&&&&&&&&((cacheElement[i].GetValue(ElementLayer.EnvelopeProperty)&as&Envelope).Extent.YMax&&&yMax&&&&(cacheElement[i].GetValue(ElementLayer.EnvelopeProperty)&as&Envelope).Extent.YMax&&&yMin)) &&&&&&&&&&&&&{ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&eLayer.Children.Add(cacheElement[i]); &&&&&&&&&&&&&&&&&cacheElement.Remove(cacheElement[i]); &&&&&&&&&&&&&&&&&count--;&&&&&&&&&&&&&&&&&&&&&i--;&&&&&&&&&&&&&&&&&&&&&&&&&continue; &&&&&&&&&&&&&} &&&&&&&&&} &&&&&} &} &&&&&&&public&static&void&DrawAllUIElement(ElementLayer&eLayer,&List&UIElement&&cacheElement) &{ &&&&&if&(eLayer&!=&null) &&&&&{ &&&&&&&&&foreach&(UIElement&item&in&cacheElement) &&&&&&&&&{ &&&&&&&&&&&&&eLayer.Children.Add(item); &&&&&&&&&} &&&&&} &} &&&&&&&&&&private&static&void&DynamicDrawSymbol(GraphicsLayer&glayer,&List&Graphic&&cacheGraphic,&Map&map) &{ &&&&&&&&&&&&&&&&&&&&double&xMax&=&map.Extent.XMax&+&2; &&&&&double&xMin&=&map.Extent.XMin&-&2; &&&&&double&yMax&=&map.Extent.YMax&+&2; &&&&&double&yMin&=&map.Extent.YMin&-&2; &&&&&&&&&&&if&(glayer&!=&null) &&&&&{ &&&&&&&&&int&graphicCount&=&glayer.Graphics.C &&&&&&&&&for&(int&i&=&0;&i&&&graphicC&i++) &&&&&&&&&{ &&&&&&&&&&&&&&&&&&&&&&&&&&if&(!((glayer.Graphics[i].Geometry.Extent.XMax&&&xMax&&&&glayer.Graphics[i].Geometry.Extent.XMax&&&xMin) &&&&&&&&&&&&&&&&&&&&(glayer.Graphics[i].Geometry.Extent.YMax&&&yMax&&&&glayer.Graphics[i].Geometry.Extent.YMax&&&yMin))) &&&&&&&&&&&&&{ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&cacheGraphic.Add(glayer.Graphics[i]); &&&&&&&&&&&&&&&&&glayer.Graphics.Remove(glayer.Graphics[i]); &&&&&&&&&&&&&&&&&graphicCount--;&&&&&&&&&&&&&&&&&&&&i--;&&&&&&&&&&&&&&&&&&&&&&&&&&&} &&&&&&&&&}&&&&&&} &&&&&&&&&&&if&(cacheGraphic&!=&null) &&&&&{ &&&&&&&&&int&count&=&cacheGraphic.C &&&&&&&&&for&(int&i&=&0;&i&&&&i++) &&&&&&&&&{ &&&&&&&&&&&&&&&&&&&&&&&&&&if&((cacheGraphic[i].Geometry.Extent.XMax&&&xMax&&&&cacheGraphic[i].Geometry.Extent.XMax&&&xMin) &&&&&&&&&&&&&&&&&&&&(cacheGraphic[i].Geometry.Extent.YMax&&&yMax&&&&cacheGraphic[i].Geometry.Extent.YMax&&&yMin)) &&&&&&&&&&&&&{ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&glayer.Graphics.Add(cacheGraphic[i]); &&&&&&&&&&&&&&&&&cacheGraphic.Remove(cacheGraphic[i]); &&&&&&&&&&&&&&&&&count--;&&&&&&&&&&&&&&&&&&&&&i--;&&&&&&&&&&&&&&&&&&&&&&&&&continue; &&&&&&&&&&&&&} &&&&&&&&&} &&&&&} &} &&&&&&&private&static&void&DrawAllGraphics(GraphicsLayer&eLayer,&List&Graphic&&cacheGraphic) &{ &&&&&if&(eLayer&!=&null) &&&&&{ &&&&&&&&&foreach&(Graphic&item&in&cacheGraphic) &&&&&&&&&{ &&&&&&&&&&&&&eLayer.Graphics.Add(item); &&&&&&&&&} &&&&&} &} &&&&&&
今天把 GisMap 这个类都写出来了也为了我写下一篇文章做准备吧!后面会写一篇动态加载数据点的文章!因为当大批量点(2000)左右加载到地图上的时候,
就会非常的卡,基本都动不了,所以我们要动态去加载这些点。
本文地址 :
------分隔线----------------------------

我要回帖

更多关于 arcgis 坐标转换 的文章

 

随机推荐