GIS FLEX开发
http://135.33.9.92:8399/arcgis/rest/services/QJCache/MapServer
http://135.33.9.92:8399/arcgis/rest/services/QJGrid/MapServer
http://135.33.9.92:8399/arcgis/rest/services/Geometry/GeometryServer
帮助文档:http://resources.esri.com/help/9.3/arcgisserver/apis/flex/samples/index.html
1.flex访问跨域的ArcGIS Server服务出现了安全沙箱错误,运行的时候出不来地图,
需要在远程的Web服务器根目录下放置一个“crossdomain.xml”安全策略文件
<?xml version="1.0" ?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd" ><cross-domain-policy> <site-control permitted-cross-domain-policies="all" /> <allow-access-from domain="*" /> <allow-http-request-headers-from domain="*" headers="*"/></cross-domain-policy>
安全策略文件需要被放到特定的位置
ArcGIS Server for .Net应该是IIS的根目录(如:C:\Inetpub\wwwroot)
ArcGIS Server for Java应该是web_output目录(如:C:\ProgramFiles\ArcGIS\java\web_output)
2.MXML.XML文件
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:esri="http://www.esri.com/2008/ags" pageTitle="Example - ArcGIS API for Flex connecting to a tiled AGS service" styleName="plain" > <mx:Text text="This is a tiled Map Service from ArcGIS Online." width="100%"/><!-- //http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer --> <esri:Map id="myMap" logoVisible="false" styleName="myMapStyle"><esri:ArcGISTiledMapServiceLayer url="http://135.33.9.92:8399/arcgis/rest/services/QJCache/MapServer"/><esri:ArcGISDynamicMapServiceLayerurl="http://135.33.9.92:8399/arcgis/rest/services/QJGrid/MapServer" id="myDynamicService"alpha="0.9" > <esri:layerDefinitions> <mx:Array> <mx:String></mx:String> <!-- 网格专题图 (1) --> <mx:String></mx:String><!-- 网格逻辑视图 (3)--> </mx:Array> </esri:layerDefinitions></esri:ArcGISDynamicMapServiceLayer> <esri:GraphicsLayer id="mapGraphicsLayer" /><esri:GraphicsLayer id="graphicsLayer" /> </esri:Map></mx:Application>
页:
[1]