<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:supportClasses="com.esri.ags.skins.supportClasses.*"
xmlns:flash="flash.text.*"
xmlns:arcgis="cn.com.vistech.arcgis.*"
xmlns:esri="http://www.esri.com/2008/ags">
<fx:Declarations>
<esri:SimpleMarkerSymbol id="citySymbol"
alpha="0.8"
color="0xDDDD00"
size="6"
style="circle">
<esri:SimpleLineSymbol width="2"
alpha="1"
color="0xDD0000"
style="solid"/>
</esri:SimpleMarkerSymbol>
<esri:SimpleFillSymbol color="0xFFFFFF"
alpha="0.5"
style="solid"
id="mySymbol">
<esri:SimpleLineSymbol color="0xFFFFFF"
width="0"
alpha="0.5"
style="solid"/>
</esri:SimpleFillSymbol>
<esri:TextSymbol id="nanjing"
text="南京"
placement="above"
xoffset="1"
yoffset="3"
color="0x666666"
border="false"
borderColor="0x000000"
background="false"
backgroundColor="0xFFFFFF">
<flash:TextFormat size="13"
font="宋体"
bold="true"
italic="false"
underline="false"/>
</esri:TextSymbol>
<esri:MapImageLayer id="viso"
alpha="0.5">
</esri:MapImageLayer>
</fx:Declarations>
<esri:Map id="map"
logoVisible="false"
openHandCursorVisible="false"
scaleBarVisible="false"
zoomSliderVisible="false"
load="loadHandler()">
<arcgis:GoogleMapLayer/>
<esri:GraphicsLayer symbol="{citySymbol}">
<esri:Graphic symbol="{nanjing}">
<esri:geometry>
<esri:MapPoint x="13221159.886688277"
y="3769799.519742769"/>
</esri:geometry>
</esri:Graphic>
<esri:Graphic>
<esri:geometry>
<esri:MapPoint x="13221159.886688277"
y="3769799.519742769"
id="js"/>
</esri:geometry>
</esri:Graphic> <esri:Graphic>
<esri:geometry>
<esri:MapPoint x="12801741.44122646"
y="3606802.4843253596"/>
</esri:geometry>
</esri:Graphic>
<esri:Graphic>
<esri:geometry>
<esri:MapPoint x="13692297.36757265"
y="4191093.670273363"/>
</esri:geometry>
</esri:Graphic> <esri:Graphic>
<esri:geometry>
<esri:MapPoint x="12801741.44122646"
y="4191093.670273363"/>
</esri:geometry>
</esri:Graphic>
<esri:Graphic>
<esri:geometry>
<esri:MapPoint x="13692297.36757265"
y="3606802.4843253596"/>
</esri:geometry>
</esri:Graphic>
<esri:Graphic symbol="{mySymbol}">
<esri:Polygon spatialReference="{new SpatialReference(102113)}">
<fx:Array>
<fx:Array>
<esri:MapPoint id="a1"
x="-20037508.342787"
y="-20037508.342787"/>
<esri:MapPoint id="b1"
x="-20037508.342787"
y="3575001"/>
<esri:MapPoint id="a3"
x="20037508.342787"
y="3575001"/>
<esri:MapPoint id="a4"
x="20037508.342787"
y="-20037508.342787"/>
</fx:Array>
</fx:Array>
</esri:Polygon>
</esri:Graphic>
<esri:Graphic symbol="{mySymbol}">
<esri:Polygon spatialReference="{new SpatialReference(102113)}">
<fx:Array>
<fx:Array>
<esri:MapPoint id="y1"
x="-20037508.342787"
y="4204007"/>
<esri:MapPoint id="y2"
x="-20037508.342787"
y="20037508.342787"/>
<esri:MapPoint id="y3"
x="-20037508.342787"
y="20037508.342787"/>
<esri:MapPoint id="y4"
x="20037508.342787"
y="4204007"/>
</fx:Array>
</fx:Array>
</esri:Polygon>
</esri:Graphic>
<esri:Graphic symbol="{mySymbol}">
<esri:Polygon spatialReference="{new SpatialReference(102113)}">
<fx:Array>
<fx:Array>
<esri:MapPoint id="u1"
x="-20037508.342787"
y="4204007"/>
<esri:MapPoint id="u2"
x="12783210"
y="4204007"/>
<esri:MapPoint id="u3"
x="12783210"
y="3575001"/>
<esri:MapPoint id="u4"
x="-20037508.342787"
y="3575001"/>
</fx:Array>
</fx:Array>
</esri:Polygon>
</esri:Graphic>
<esri:Graphic symbol="{mySymbol}">
<esri:Polygon spatialReference="{new SpatialReference(102113)}">
<fx:Array>
<fx:Array>
<esri:MapPoint id="t1"
x="13703667"
y="4204007"/>
<esri:MapPoint id="t2"
x="13703667"
y="3575001"/>
<esri:MapPoint id="t3"
x="20037508.342787"
y="3575001"/>
<esri:MapPoint id="t4"
x="20037508.342787"
y="4204007"/>
</fx:Array>
</fx:Array>
</esri:Polygon>
</esri:Graphic>
</esri:GraphicsLayer>
</esri:Map> <s:Button label="按钮"
click="button1_clickHandler(event)"
top="10"
right="10"/>
<s:Panel x="29"
y="19"
width="1082"
height="200">
<s:Label fontWeight="bold"
text="Current map extent:"
x="15"
y="10"/>
<s:RichEditableText editable="false"
text='xmin="{map.extent.xmin.toFixed(0)}" ymin="{map.extent.ymin.toFixed(0)}" xmax="{map.extent.xmax.toFixed(0)}" ymax="{map.extent.ymax.toFixed(0)}" (wkid="{map.spatialReference.wkid}")'
x="9"
y="135"/>
<s:Label fontWeight="bold"
text="Current map extent (in geographic):"
x="23"
y="53"/>
<s:RichEditableText editable="false"
text="{showExtentInGeographic(map.extent)}"
x="10"
y="110"/>
<s:Label fontWeight="bold"
text="Current Mouse Coordinates:"
x="10"
y="73"/>
<s:RichEditableText id="mousecoords"
editable="false"
text="Move the mouse over the map to see its current coordinates..."
x="10"
y="93"/>
<s:Label fontWeight="bold"
text="Current map scale is"
x="10"
y="33"/>
<s:RichEditableText editable="false"
text="1:{map.scale.toFixed(0)} (level {map.level})"
x="14"
y="-24"/>
</s:Panel>
<fx:Script>
<![CDATA[
import com.esri.ags.SpatialReference;
import com.esri.ags.events.MapEvent;
import com.esri.ags.geometry.Extent;
import com.esri.ags.layers.supportClasses.MapImage;
import com.esri.ags.utils.WebMercatorUtil; import mx.controls.Alert;
import mx.core.FlexGlobals; protected function button1_clickHandler(event:MouseEvent):void
{ var zx:MapPoint=new MapPoint(114.859, 35.32);
var ys:MapPoint=new MapPoint(124.155, 41.25);
zx=WebMercatorUtil.geographicToWebMercator(zx) as MapPoint;
ys=WebMercatorUtil.geographicToWebMercator(ys) as MapPoint; viso.removeAll();
var visoMapImage:MapImage=new MapImage();
visoMapImage.href="http://10.32.22.250:8080/appServices/emf2vec/visoface-gis.swf?r=" + new Date().getMilliseconds();
var extent:Extent=new Extent(12783205.393024608, 4204003.347074539, 13827701.37943888, 4989446.834623009, new SpatialReference(102113));
visoMapImage.extent=extent;
viso.add(visoMapImage);
FlexGlobals.topLevelApplication.map.addLayer(viso);
} private function loadHandler():void
{
map.centerAt(js);
map.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
} // ... show coordinates of current (mouse) location
private function mouseMoveHandler(event:MouseEvent):void
{
const mapPoint:MapPoint=map.toMapFromStage(event.stageX, event.stageY);
const latlong:MapPoint=WebMercatorUtil.webMercatorToGeographic(mapPoint) as MapPoint;
mousecoords.text="x,y is " + mapPoint.x.toFixed(0) + "," + mapPoint.y.toFixed(0) + " and Lat/Long is: " + latlong.y.toFixed(6) + " / " + latlong.x.toFixed(6);
} // convert current projected extent to geographic and show as such
protected function showExtentInGeographic(extent:Extent):String
{
const geoExtent:Extent=WebMercatorUtil.webMercatorToGeographic(map.extent) as Extent;
// return geoExtent.toString() + ".." ;
return " " + geoExtent.xmin.toFixed(6) + ", " + geoExtent.ymin.toFixed(6) + ", " + geoExtent.xmax.toFixed(6) + ", " + geoExtent.ymax.toFixed(6) + " (wkid: " + geoExtent.spatialReference.wkid + ")";
}
]]>
</fx:Script>
</s:Application>

ArcGIS Google Map 增加虚拟图层(MapImageLayer)(转载)的更多相关文章

  1. ArcGIS Viewer for Flex中引入google map作底图 (转)

    在ArcGIS Viewer for Flex开发中,经常需要用到google map作为底图,我们不能通过ArcGIS Viewer for Flex - Application Builder轻易 ...

  2. ArcGIS for Flex中引入google map作底图

    上篇文章到在ArcGIS View中引入google map,这里讲ArcGIS for Flex中引入google map作底图. 同样道理,以google map作底图,需要编写继承自TiledM ...

  3. ArcGIS Viewer for Flex中引入google map作底图

    在ArcGIS Viewer for Flex开发中,经常需要用到google map作为底图,我们不能通过ArcGIS Viewer for Flex - Application Builder轻易 ...

  4. arcgis api for silverlight使用google map等多个在线地图

    原文 http://blog.csdn.net/leesmn/article/details/6820245 无可否认,google map实在是很漂亮.可惜对于使用arcgis api for si ...

  5. Google Map JavaScript API V3 实例大全

    Google Map JavaScript API V3 实例大全 基础知识 简单的例子 地理位置 语言 位置 坐标 简单的投影 事件 简单事件 关闭事件 多次添加事件 事件属性 控制 php禁用ui ...

  6. Android Google Map v2具体解释:开发环境配置

    Android Google Map v2具体解释:开发环境配置                                       --转载请注明出处:coder-pig 说在前面: 说到地 ...

  7. Google Map API V3开发(1)

    Google Map API V3开发(1) Google Map API V3开发(2) Google Map API V3开发(3) Google Map API V3开发(4) Google M ...

  8. Google Map API V3开发(3)

    Google Map API V3开发(1) Google Map API V3开发(2) Google Map API V3开发(3) Google Map API V3开发(4) Google M ...

  9. Google Map API V3开发(4)

    Google Map API V3开发(1) Google Map API V3开发(2) Google Map API V3开发(3) Google Map API V3开发(4) Google M ...

随机推荐

  1. 为什么程序员老在改 Bug,就不能一次改好吗?

    程序员的日常三件事:写Bug.改Bug.背锅.连程序员都自我调侃道,为什么每天都在加班?因为我的眼里常含Bug. 但是真的有这么多Bug要改吗?就不能一次改完吗? 程序员听这问题后要拍键盘了,还!真! ...

  2. 【xsy1378】 水题7号 贪心

    题目大意:有$m$组约束关系$(x_i,y_i)$,你要构造一个排列,满足数$x_i$出现在数$y_i$前面,请使得这个排列字典序最小,请输出这个排列.无解请输出-1. 数据范围:$n,m≤10^5$ ...

  3. iOS自动布局框架-Masonry详解

    首先,在正式使用Masonry之前,我们先来看看在xib中我们是如何使用AutoLayout     从图中我们可以看出,只要设置相应得局限,控制好父视图与子视图之间的关系就应该很ok的拖出你需要的需 ...

  4. rabbitmq使用日记

    一.安装 添加安装源 #echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list ...

  5. java基本语法一

    1 关键字和保留字 1.1 关键字 关键字的定义:被java语言赋予了特殊含义,用做专门用途的字符串(单词). 关键字的特点:关键字中的所有字母都是小写. 1.2 保留字 java保留字:现有Java ...

  6. Linux grep命令详解[备份]

    linux grep命令 1.作用Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来.grep全称是Global Regular Expressi ...

  7. 前端必备:FastStoneCapture 和 Licecap &&& mingw c++ 编译执行

    端必备:FastStoneCapture 和 Licecap FastStoneCapture这个软件非常小,只有2M多,并且其功能很强大,包括截图,录制视频,量尺,取色等等,对于前端工程师绝对是必备 ...

  8. Java之IO(十一)BufferedReader和BufferedWriter

    转载请注明源出处:http://www.cnblogs.com/lighten/p/7074488.html 1.前言 按照字节流的顺序一样,字符流也提供了缓冲字符流,与字节流不同,Java虽然提供了 ...

  9. 【数组】Best Time to Buy and Sell Stock I/II

    Best Time to Buy and Sell Stock I 题目: Say you have an array for which the ith element is the price o ...

  10. Node.js http服务器搭建和发送http的get、post请求

    1.Node.js 搭建http服务器 1.1创建server.js var http = require('http'); var querystring = require('querystrin ...