效果如下:
GoogleMapLayer.as
package com.esri.arcgis.flex.sample
{
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;
//扩展TiledMapServiceLayer图层实现加载google地图
public class GoogleMapLayer extends TiledMapServiceLayer
{
private var _tileInfo:TileInfo = new TileInfo();
private var _baseURL:String="";
public function GoogleMapLayer()
{
super();
buildTileInfo();
setLoaded(true);
}
override public function get fullExtent():Extent
{
return new Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, new SpatialReference(102113));
}
override public function get initialExtent():Extent
{
return new Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, new SpatialReference(102113));
}
override public function get spatialReference():SpatialReference
{
return new SpatialReference(102113);
}
override public function get tileInfo():TileInfo
{
return _tileInfo;
}
//获取矢量地图
override protected function getTileURL(level:Number, row:Number, col:Number):URLRequest
{
var url:String="http://mt"+(col%4)+".google.cn/vt/v=w2.114&hl=zh-CN&gl=cn&" +
"x=" + col + "&" +
"y=" + row + "&" +
"z=" + level+ "&s=";
return new URLRequest(url);
}
private function buildTileInfo():void
{
_tileInfo.height=256;
_tileInfo.width=256;
_tileInfo.origin=new MapPoint(-20037508.342787, 20037508.342787);
_tileInfo.spatialReference=new SpatialReference(102113);
_tileInfo.lods = [
new LOD(0, 156543.033928, 591657527.591555),
new LOD(1, 78271.5169639999, 295828763.795777),
new LOD(2, 39135.7584820001, 147914381.897889),
new LOD(3, 19567.8792409999, 73957190.948944),
new LOD(4, 9783.93962049996, 36978595.474472),
new LOD(5, 4891.96981024998, 18489297.737236),
new LOD(6, 2445.98490512499, 9244648.868618),
new LOD(7, 1222.99245256249, 4622324.434309),
new LOD(8, 611.49622628138, 2311162.217155),
new LOD(9, 305.748113140558, 1155581.108577),
new LOD(10, 152.874056570411, 577790.554289),
new LOD(11, 76.4370282850732, 288895.277144),
new LOD(12, 38.2185141425366, 144447.638572),
new LOD(13, 19.1092570712683, 72223.819286),
new LOD(14, 9.55462853563415, 36111.909643),
new LOD(15, 4.77731426794937, 18055.954822),
new LOD(16, 2.38865713397468, 9027.977411),
new LOD(17, 1.19432856685505, 4513.988705),
new LOD(18, 0.597164283559817, 2256.994353),
new LOD(19, 0.298582141647617, 1128.497176)
];
}
}
}
ArcGISGoogleMap.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:google="com.esri.arcgis.flex.sample.*"
xmlns:esri="http://www.esri.com/2008/ags">
<esri:Map>
<google:GoogleMapLayer id="googleMap" />
</esri:Map>
</s:Application>

- 大小: 121.9 KB
分享到:
相关推荐
此外,文档还探讨了如何将ARCGIS API FOR FLEX与Google Map融合,创造出更为丰富和多样化的地图应用。 #### 总结 《ARCGIS API FOR FLEX》文档全面而深入地介绍了ARCGIS API FOR FLEX的各项功能和使用技巧,是学习...
【ArcGIS Flex API 配合 LibertyGISI 加载 SHP 文件】 在开发WebGIS系统时,有时需要在浏览器端直接加载本地地图数据,这能够极大提高用户体验。SHP文件是一种广泛应用的地图数据格式,其结构公开,有很多库可以...
《ArcGIS API for Flex 3.6:地图开发的全面指南》 ArcGIS API for Flex 3.6 是Esri公司推出的一款强大的地图开发工具,它允许开发者利用Flex技术构建功能丰富的地理信息系统(GIS)应用。这个API为Web开发者提供了...
- **创建地图**:通过 ArcGIS API for Flex 可以轻松地创建地图对象,并向其中添加各种图层。开发者可以控制地图的初始位置、缩放级别等参数。 - **事件(Event)**:事件处理是地图交互的核心。通过监听地图上的...
### ArcGIS API for ...通过以上内容可以看出,ArcGIS API for Flex 不仅提供了丰富的地图显示功能,还支持多种空间分析任务和数据处理操作,能够满足不同层次开发者的需求,是构建复杂 Web GIS 应用的强大工具之一。
### ArcGIS API for Flex 教程知识点概览 #### 一、初级篇 **1.1 环境搭建** ...- 探讨如何将 ArcGIS API for Flex 与 Google Maps API 结合使用。 - 实现地图服务之间的互操作性,扩展应用的功能。
支持对下载地图的ArcGIS缓存格式,谷歌金字塔切片格式,百度切片格式、我们的自有格式azdb进行本机离线浏览,并支持调用谷歌地图离线API、百度地图离线API进行B/S方式离线浏览 15.影像金字塔构建。更快速的在第三方...