关于arcgi s_api_for_flex的总结
1.flex 的简介
a) Flex是adobe开发的东西,主要特点就是开发一个swf格式的应用,flex可以做桌面的应用和web的应用,但本质差不多。
b) Flex采用mxml的格式来进行应用的布局,然后用ActionScript进行脚本处理。
例子:
在application中放进一个eris的map控件,map的一个load函数 为loadHandler
<s:Application>
<fx:Script>
<![CDATA[
private function loadHandler():void
{
}
]]>
</fx:Script>
<eris:map load="loadHandler()">
</s:Application>
c) Acrgis for flex其实就是引进一个jar包(但flex真实为swc包),然后就可以进行调用Acrgis 的函数
2.Argis简介
a) Arcigs 是专门处理地图的,它自己拥有acgis map ,arcgis server的软件来进行处理和发布地图。
b) 地图有很多种的格式,flex要进行调用的话必须清楚服务器url是什么格式。比如什么wms,wmts,什么的,我也不是很清楚。、
c) 但调用地图我们自己做的是acgis的专门地图的服务,只需要初始化一个ArcGISDynamicMapServiceLayer 对象然后设定他的url(我们服务器的url)就行。
private var
huiluCommunityWMS:ArcGISDynamicMapServiceLayer =
new ArcGISDynamicMapServiceLayer();
huiluCommunityWMS.url = "http://localhost:6080/arcgis/rest/services/myserver/Map Server";
这样huiluCommunityWMS对象就创建了,然后map.addLayers(huiluCommunityWMS);后就可以在map中显示这个地图
下面这些都是acgis地图的类,ArcGISDynamicMapServiceLayer 只是其中一个,南方数码给我们提供的就是TiledMapServiceLayer这样的类的地图,但这种类的地图需要自定义一个类并且进行继承,然后再指定他的url啊,他的区域范围之类的一些属性啊后 方可使用。
(自定义一个类 这个类在源码中的layer包的WMTSLayer_province)
Class |
Description |
|
Allows you to work with a dynamic map service resource exposed by the ArcGIS Server REST API (available in ArcGIS Server 9.3 and above). |
||
Allows you to work with an Image Service resource exposed by the ArcGIS Server REST API (available in ArcGIS Server 9.3 and above). |
||
Allows you to work with a cached map service resource exposed by the ArcGIS Server REST API (available in ArcGIS Server 9.3 and above). |
||
Allows you to add ArcIMS image services to your map. |
||
Base class for all dynamic layers that can be added to a map. |
||
The feature layer can be used to display features from one single layer of either a Feature Service or a Map Service. |
||
Allows you to view a geoprocessing task result. |
||
A layer that contains one or more Graphic features. |
||
The KMLLayer is used to create a layer based on a publicly accessible KML file (.kml,.kmz). |
||
Base class for all layers that can be added to a map. |
||
The MapImageLayer class is used to add georeferenced images to the map. |
||
Allows you to use basemaps from OpenStreetMap. |
||
Base class for all tiled layers that can be added to a map. |
||
A layer for OGC Web Map Services. |
||
d) 好了,我们现在能创建了一个map和显示地图,然后怎么在上面就行划线啊,标志啊啥的呢。其实map是一个对象,ArcGISDynamicMapServiceLayer 地图 是map下一级的对象,而标志,划线啥的同ArcGISDynamicMapServiceLayer 地图对象一样,也是map的下一级对象GraphicsLayer ,同样是addlayer这个方法给加进去。
private var fillGraphicLayer:GraphicsLayer = new GraphicsLayer();
map.addLayer(fillGraphicLayer);
GrapicsLayer就是显示划线啊,标记啊之类的Layer,同地图具有等同的地位。
然后划线,标记这种对象是GrapicsLayer的下一级对象
Graphic
Property |
Defined By |
||
attributes : Object Name-value pairs of fields and field values associated with the graphic. |
Graphic |
||
checkForMouseListeners : Boolean Prevents the map from zooming and panning when the mouse is over the graphic and the graphic has registered mouse listeners. |
Graphic |
||
The geometry that defines the graphic. |
Graphic |
||
[read-only] Return the parent as an instance of GraphicsLayer. |
Graphic |
||
infoWindowRenderer : IFactory The info renderer. |
Graphic |
||
The symbol for the graphic. |
如上图,Graphic有Attribute,geometry,symbol着三个最重要的属性。 Attribute是他可以加上去的一些参数。这些参数传给他的一些Label,button这种实际的控件,
<s:Label id="myLabel" text ="{data}">
如上。Data 等同于Graphic的Attribute 属性。而geometry属性是说明这个Graphic的形状,
Constant |
Defined By |
||
EXTENT : String = esriGeometryEnvelope [static] An extent is defined by xmin, ymin, xmax and ymax. |
Geometry |
||
MAPPOINT : String = esriGeometryPoint [static] A MapPoint is a basic point with x (often longitude), y (often latitude) and an optional spatial reference. |
Geometry |
||
MULTIPOINT : String = esriGeometryMultipoint [static] A multipoint consists of one or more MapPoint(s). |
Geometry |
||
POLYGON : String = esriGeometryPolygon [static] A polygon is a set of areas with three or more points. |
Geometry |
||
POLYLINE : String = esriGeometryPolyline [static] A polyline is set of lines with two or more points. |
MAPPOINT 是一个点,polyline是线,等等,但注意的是polyline初始化时
var drawPointArray:Array = new Array();
var drawPointPath:Array = new Array();
drawPointPath.push(drawPointArray);
var drawLine:Polyline = new Polyline(drawPointPath);
fillgraphic.geometry = drawLine;
drawPointPath是一个Array,这个Array包含的是包含Mappoint的Array。
然后比较重要的是symbol,这是标志的形状。
Base class for all symbols. To display points, polylines and polygons on the graphics layer, instead use the following:
- Points (MapPoint): SimpleMarkerSymbol, PictureMarkerSymbol, TextSymbol, InfoSymbol or CompositeSymbol.
- Multipoints: SimpleMarkerSymbol, PictureMarkerSymbol or CompositeSymbol.
- Polylines: SimpleLineSymbol, CartographicLineSymbol or CompositeSymbol (and the same symbols as Multipoint for the individual nodes of the line).
- Polygons: SimpleFillSymbol, PictureFillSymbol or CompositeSymbol (and the same symbols as Multipoint for the individual nodes of the polygon).
共有上面分别对应形状的symbol,比如做的那个摄像头标记就是用的PictureMarkerSymbol,话线的是SimpleLineSymbol, 这些都定义在
<fx:Declarations>
<esri:SimpleMarkerSymbol id="sms"
alpha="0.9"
color="0xFFFF00"
size="11"
style="square">
<esri:SimpleLineSymbol color="0x000000"/>
</esri:SimpleMarkerSymbol>
<esri:PictureMarkerSymbol id="spms"
source="@Embed(source='assets/camera.png')"
height = "25"
width = "40"
/>
<!-- Symbol for Find Result as Polyline -->
<esri:SimpleLineSymbol id="sls"
width="4"
alpha="1"
color="0xFF0000"
style= "dashdot"
/>
<!-- Symbol for Find Result as Polygon -->
<esri:SimpleFillSymbol id="sfs"
alpha="0.7"
color="0xFFFF00"/>
</fx:Declarations>
如做的那个摄像头的图片标志用的便是PictureMarkerSymbol 。
3.flex与java进行交互
a) flex是无法与数据库直接打交道的,所以我们使用blazeds这种方法进行与java交互传输数据,并且由java与数据库打交道。
b) 参考资料 http://bbs.9ria.com/thread-84889-1-1.html
c) 首先我们定义一个在flex中的RemoteObject对象
<!--一个RemoteObject对象,通过这个对象来与java进行交互通信,buildingOperationDestination这个destination是对应着java中的类,这个由remoting-object.xml定义,详细请查看java与flex交互的参考资料-->
<mx:RemoteObject id="remoteObject" destination="buildingOperationDestination"
result="remoteObject_resultHandler(event)"
fault="remoteObject_faultHandler(event)" endpoint = "http://localhost:8080/WebIC/messagebroker/amf"/>
这个对象是对应到buildingOperationDestination,而这个配置是在WebIC下Webcontent下Web-Inf下 flex下remoting-config.xml中定义的
<destination id="buildingOperationDestination" channels="my-amf">
<properties>
<source>flexutils.BuidlingOperation</source>
</properties>
</destination>
flexutils.BuidlingOperation是WebIC项目下src项目下的类
d) 配置已经做好,如果出问题了,我写了一个测试的类,
上面的testConnectionJava.html
如果是上面的显示,就证明java与flex的连通性是好的,如果报错(只要不改配置文件,一般不会报错),根据信息调整,(这个出错很蛋疼啊。。),这个问题太多,出问题的时候我也一直没能解决,上次搞好,就备份了一下,没敢动了。
关于arcgi s_api_for_flex的总结的更多相关文章
- 如何在ArcGIS中恢复注记文字
文字标注是地图上一种特殊的视觉元素,可通过文字表达图形符号难以说明的地图内容,它与图形符号结合在一起存在于地图上,是关乎地图构图美的关键因素之一. MapGIS软件下子图对象和注释对象统统保存在点文件 ...
随机推荐
- linux下C语言实现多线程通信—环形缓冲区,可用于生产者(producer)/消费者(consumer)【转】
转自:http://blog.chinaunix.net/uid-28458801-id-4262445.html 操作系统:ubuntu10.04 前言: 在嵌入式开发中,只要是带操作系统的 ...
- Mac Sublime Vim模式 方向键无法长按
终端输入 sublime2: defaults write com.sublimetext.2 ApplePressAndHoldEnabled -bool false sublime3: defau ...
- 批量生成AWR报告(转载总结)
[前提] 对Oracle进行性能分析其中一个“帮手”就是Oracle的AWR报告 PS:Oracle的企业版才有AWR报告,标准版是没有的{可以导出来,但是没有数据显示} [需求] 当需要针对某个月的 ...
- centos7安装完成后的一些配置
1.打开终端 输入 sudo yum -y update 先更新软件包 2.这是输入语言 应用程序->系统工具->设置->区域和语言->+ ->汉语(中国)-> ...
- mknod命令
mknod - make block or character special filesmknod [OPTION]... NAME TYPE [MAJOR MINOR] option 有用的 ...
- Shell语言系列之一:文件处理
前言   标准输入/输出可能是软件工具设计原则里最基本的观念了.有很多UNIX程序都遵循这一设计历练.默认情况下,他们会读取标准输入,写入标准输出,并将错误信息传递给标准错误输出. & ...
- SG函数(转自百度百科)
给定一个有向无环图和一个起始顶点上的一枚棋子,两名选手交替的将这枚棋子沿有向边进行移动,无法移 动者判负.事实上,这个游戏可以认为是所有Impartial Combinatorial Games的抽象 ...
- WP SMTP插件为啥我一直设置的不对?
我也是摸索好久才搞定的,如果你是万网空间先去修改一下参数在万网后台设置PHP.ini参数设置,因为万网阿里云免费虚拟主机禁用了WordPress默认使用的PHP mail()发信函数,而 stream ...
- 用js 的for循环打印三角形,提取水仙花数,求本月多少天
第一题:用for循环打印三角形 //第一个 for(var x = 1;x <= 4;x++){ //控制行数 :由 1 到 4 for(var y = 1;y <= x;y++){ // ...
- Python全栈开发之10、网络编程
网络编程就是如何在程序中实现两台计算机的通信,而两台计算机间的通信其实就是两个进程间的通信,进程间的通信主要通过socket(套接字)来描述ip地址(主机)和端口(进程)来实现的,因此我们学习网络编程 ...