关于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软件下子图对象和注释对象统统保存在点文件 ...
随机推荐
- C# 加密解密以及sha256不可逆加密案例
class Program { static void Main(string[] args) { string aa = "身份证"; string bb = "key ...
- 头像截图上传三种方式之一(一个简单易用的flash插件)(asp.net版本)
flash中有版权声明,不适合商业开发.这是官网地址:http://www.hdfu.net/ 本文参考了http://blog.csdn.net/yafei450225664/article/det ...
- [ python ] 软件开发规范
在python开发中,我们建议采用如下规范: soft/ ├── bin # 程序执行文件目录 │ ├── __init__.py │ └── start.py # 程序开始执行脚本文件 ├─ ...
- MVC – 14.ajax异步请求
14.1.配置文件 14.2.AjaxHelper – 异步链接按钮 14.3.AjaxHelper – 异步表单 AjaxOptions常见属性: 14.4.AjaxOptions对象生成[对应]触 ...
- Mysql修改语句的运行流程
执行修改语句前要先连接数据库,这是连接器的工作. 接下来,分析器会通过词法和语法解析知道这是一条更新语句.优化器决定要使用 ID 这个索引.然后,执行器负责具体执行,找到这一行,然后更新. Mysql ...
- linux shell 正则表达式(BREs,EREs,PREs)的比较
原文 : linux shell 正则表达式(BREs,EREs,PREs)差异比较 在使用 linux shell的实用程序,如awk,grep,sed等,正则表达式必不可少,他们的区别是什么 ...
- webstorm自动压缩js、css、html【工具篇】
*注意:自动压缩的文件只能在同级目录下,不能指定文件夹,强制了文件自动保存,设置的手动保存将失效. 插件下载地址:点击这里下载 密码:e6bk 使用方法: 1.css&js 分别添加这两个,c ...
- 很好的开源UI框架Chico UI
介绍一个很好的开源的UI框架,依赖于jquery 官网:http://www.chico-ui.com.ar/ 以下是相关截图: 消息提示 自动完成 分页,列表 Chico UI是什么? Chico ...
- Java Script 基础
一. JS的简介 JavaScript是一种网页编程技术,经常用于创建动态交互网页 JavaScript是一种基于对象和事件驱动的解释性脚本语言,类似C语言和Java的语法 事先不编译:逐行执行:无需 ...
- ref:ThinkPHP Builder.php SQL注入漏洞(<= 3.2.3)
ThinkPHP Builder.php SQL注入漏洞(<= 3.2.3) ref:https://www.jianshu.com/p/18d06277161e TimeSHU 2018.04 ...