- 浏览: 1138708 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
RebeccaZhong:
严重: StandardWrapper.Throwableco ...
三步发布java方式的rest服务 -
RebeccaZhong:
严重: StandardWrapper.Throwableco ...
三步发布java方式的rest服务 -
冷酷月光:
楼主。请教一下。arcgis for android 有提供地 ...
ArcGIS API For Android离线地图的实现 -
winney117:
请问如何GET已有网页上的指定内容?比如百度文库中的某一篇文章 ...
三步发布java方式的rest服务 -
zige1012:
您好,我想问问我想换个自己地图的切片,也有4层(L0-L3), ...
ArcGIS API For Android离线地图的实现
PortlandTiledMapServiceLayer.as
customtiled.mxml
package com.esri.ags.samples { import com.esri.ags.SpatialReference; import com.esri.ags.geometry.Extent; import com.esri.ags.geometry.MapPoint; import com.esri.ags.layers.supportClasses.LOD; import com.esri.ags.layers.supportClasses.TileInfo; import com.esri.ags.layers.TiledMapServiceLayer; import flash.net.URLRequest; /** * PortlandTiledMapServiceLayer */ public class PortlandTiledMapServiceLayer extends TiledMapServiceLayer { //-------------------------------------------------------------------------- // // Constructor // //-------------------------------------------------------------------------- /** * Creates a new PortlandTiledMapServiceLayer object. */ public function PortlandTiledMapServiceLayer() { super(); buildTileInfo(); // to create our hardcoded tileInfo setLoaded(true); // Map will only use loaded layers } //-------------------------------------------------------------------------- // // Variables // //-------------------------------------------------------------------------- private var _tileInfo:TileInfo = new TileInfo(); // see buildTileInfo() private var _baseURL:String = "http://sampleserver1.arcgisonline.com/arcgiscache/Portland_Portland_ESRI_LandBase_AGO/Portland/_alllayers"; //-------------------------------------------------------------------------- // // Overridden properties // fullExtent() // initialExtent() // spatialReference() // tileInfo() // units() // //-------------------------------------------------------------------------- //---------------------------------- // fullExtent // - required to calculate the tiles to use //---------------------------------- override public function get fullExtent():Extent { return new Extent(-123.596895130725, 44.297575737946, -121.553757125519, 46.3683237161949, new SpatialReference(4326)); } //---------------------------------- // initialExtent // - needed if Map doesn't have an extent //---------------------------------- override public function get initialExtent():Extent { return new Extent(-122.539, 45.500, -122.540, 45.501, new SpatialReference(4326)); } //---------------------------------- // spatialReference // - needed if Map doesn't have a spatialReference //---------------------------------- override public function get spatialReference():SpatialReference { return new SpatialReference(4326); } //---------------------------------- // tileInfo //---------------------------------- override public function get tileInfo():TileInfo { return _tileInfo; } //---------------------------------- // units // - needed if Map doesn't have it set //---------------------------------- override public function get units():String { return "esriDecimalDegrees"; } //-------------------------------------------------------------------------- // // Overridden methods // getTileURL(level:Number, row:Number, col:Number):URLRequest // //-------------------------------------------------------------------------- override protected function getTileURL(level:Number, row:Number, col:Number):URLRequest { // Use virtual cache directory // This assumes the cache's virtual directory is exposed, which allows you access // to tile from the Web server via the public cache directory. // Example of a URL for a tile retrieved from the virtual cache directory: // http://serverx.esri.com/arcgiscache/dgaerials/Layers/_alllayers/L01/R0000051f/C000004e4.jpg var url:String = _baseURL + "/L" + padString(String(level), 2, "0") + "/R" + padString(row.toString(16), 8, "0") + "/C" + padString(col.toString(16), 8, "0") + ".png"; return new URLRequest(url); } //-------------------------------------------------------------------------- // // Private Methods // //-------------------------------------------------------------------------- private function buildTileInfo():void { _tileInfo.height = 512; _tileInfo.width = 512; _tileInfo.origin = new MapPoint(-180, 90); _tileInfo.spatialReference = new SpatialReference(4326); _tileInfo.lods = [ new LOD(0, 0.351562499999999, 147748799.285417), new LOD(1, 0.17578125, 73874399.6427087), new LOD(2, 0.0878906250000001, 36937199.8213544), new LOD(3, 0.0439453125, 18468599.9106772), new LOD(4, 0.02197265625, 9234299.95533859), new LOD(5, 0.010986328125, 4617149.97766929), new LOD(6, 0.0054931640625, 2308574.98883465), new LOD(7, 0.00274658203124999, 1154287.49441732), new LOD(8, 0.001373291015625, 577143.747208662), new LOD(9, 0.0006866455078125, 288571.873604331), new LOD(10, 0.000343322753906249, 144285.936802165), new LOD(11, 0.000171661376953125, 72142.9684010827), new LOD(12, 0.0000858306884765626, 36071.4842005414), new LOD(13, 0.0000429153442382813, 18035.7421002707), new LOD(14, 0.0000214576721191406, 9017.87105013534), new LOD(15, 0.0000107288360595703, 4508.93552506767) ]; } private function padString(text:String, size:int, ch:String):String { while (text.length < size) { text = ch + text; } return text; } } }
customtiled.mxml
<?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:esri="http://www.esri.com/2008/ags" xmlns:samples="com.esri.ags.samples.*" pageTitle="Extending TiledMapServiceLayer in Flex API"> <!-- @@includeFiles com/esri/ags/samples/PortlandTiledMapServiceLayer.as This sample shows how tiles can be used without the REST endpoint. The ArcGIS API for Flex allows for extending the API to access layer types not included as part of the API. In this example, tiled layers (TiledMapServiceLayer) is extended to access tiles created in 9.2 or above and made accessible in the standard virtual directory. Steps involved: 1. Creating new ActionScript class that extends TiledMapServiceLayer. 2. Hardcoding some of the configuration settings: fullExtent, initialExtent, spatialReference, tileInfo, and units. 3. Overriding the protected function getTileURL() to obtain the appropriate tiles and place them accurately on the map. 4. Using the extended class with MXML or ActionScript :) --> <esri:Map id="myMap"> <samples:PortlandTiledMapServiceLayer id="virtualTiles" fadeInFrameCount="12"/> </esri:Map> <s:Label width="85%" backgroundColor="0xFFFF00" color="0x000000" fontSize="14" fontWeight="bold" horizontalCenter="0" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" text="By extending TiledMapServiceLayer, this application can access tiles from an ArcGIS 9.2 (or above) virtual directory. This specific service is in the {virtualTiles.spatialReference.wkid} spatialReference and has {virtualTiles.tileInfo.lods.length} scale levels."/> </s:Application>
发表评论
-
ArcGIS Flex API读取MapABC中的地图
2011-03-25 00:49 2392效果如下: MapABCTileMapServiceLa ... -
ArcGIS Flex API读取Google地图
2011-03-25 00:43 2980效果如下: GoogleMapLayer.as p ... -
flex 错误列表
2010-04-28 19:09 1856最近发现一个问题,就 ... -
flex组件 HSlider 和 VSlider 的使用
2010-03-31 23:11 3272Flex提供了水平和垂直两 ... -
Flex中弹出窗体的应用和开发
2010-03-31 22:59 3199在flex中创建一个弹出窗 ... -
Flex项目中遇到的几个问题
2010-03-31 15:08 18121.flex调用远程Java服务报错:Security err ... -
flex里面repeater的用法(相当于for循环功能)
2010-03-13 23:03 2431程序的代码部分: <?xml version=" ... -
flex框架pureMVC的使用:第一步
2009-10-13 09:29 2234http://ioryioryzhan.iteye.com/b ... -
flex里通过addEventListener指定回调函数时指定更多参数
2009-09-29 12:03 2695转载:http://www.dlog.cn/kawais/di ... -
FLEX 载入的沙箱安全
2009-09-29 10:20 20061.Error #2148 这是一次无意时发现的, ... -
Adobe Flex最佳学习路线
2008-11-11 17:29 1518目前Adobe Flex的中文版学习资料比较少,而且大多都很零 ... -
Flex Builder中创建简单BlazeDS信息程序
2008-08-25 00:22 3326这个实例教你怎么用BlazeDS信息服务创建一个简单的聊天程序 ... -
Flex中数据交换(httpservice)
2008-08-24 22:55 3511在这部分,你将学习到怎么去创建一个程序,他们将取回基于给用户提 ... -
Flex 创建简单的RIA
2008-08-24 16:45 1380在这部分里,你将学习 ... -
Flex 和 Java
2008-08-24 12:44 1444技术性比较 当我们和其他技术集成Flex的时候,最应该记住的两 ... -
Flex 介绍
2008-08-24 12:10 2261简介 Adobe Flex 是什么?像 ... -
Flex中的Bindable的用法
2008-08-20 17:42 15395虽然多数Flex开发者都使用过[Bindable]标签,但是很 ...
相关推荐
在ArcGIS Flex API中使用天地图的地名搜索服务。源代码中通过ArcGIS Flex API封装了TianDiTuLocationTask类,接口类似ArcGIS Flex API中task类。
Arcgis flex api自定义风场点图标样式
arcgis api for js 自定义弹出信息提示框,可以根据自己需要直接修改css样式即可。
分别用ArcGIS Flex API和SuperMap Flex API实现的军标箭头库,有需要源码的可回复邮箱索取。
提供arcgis js api加载本地天地图瓦片的方法,dojo封装类
arcgis flex api 2.5 最新
arcgis flex api 3.0 离线帮助文档chm格式 绝对好用!
使用ArcGIS API创建自定义图层实现在2D地图中渲染水波纹扩撒的效果
建立基于ArcGIS Flex API的地图应用 ArcGIS Server 开发概要 ArcGIS Server REST API ArcGIS API For Flex...
ArcGIS Flex API—高级篇 聚合 编辑 皮肤 编写库 移动设备 数据传输
ArcGis-10.1 读取 天地图 API 接口工具 使用说明文档 20130425.rar
arcgis api for flex 开发入门(三)地图浏览控件的使用
ArcGIS Flex API初级篇,对Flex的初级讲解
ArcGIS Flex API和Java API的集成 esri的培训资料
Arcgis API for js自定义InfoWindow
ArcGIS API for FLEX全部代码实例
ARCGIS Flex API 2.4版本 离线帮助
arcgis flex api 3.0 官方正式版, 包含范例。
基于ArcGIS Flex API开发Flex AIR Mobile应用
ArcGIS Flex API 2.0 离线参考 EXE格式