FGMap增加QQ地圖類型

來源:互聯網
上載者:User

恭賀FGMap又新增加一種地圖類型--QQ地圖!

我想Google Ditu、MapABC、QQ應該使用相同的資料來源,大家可以看這幾個地圖下面的資料來源,只是每種地圖儲存的路徑不一樣而以,而這幾種都存在著相似之處,所以擷取他們的地圖類型源並不複雜。稍做改動即可完成。

FGMap已經裝QQ地圖整合進來了,需要的使用的,只需重新下載FGMap的庫檔案,替換原來的庫檔案即可。

庫檔案是:http://files.cnblogs.com/liongis/FGMapLib.rar

下面是現在的:

 

原始碼:

View Code

 1 <?xml version="1.0" encoding="utf-8"?>
2 <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
3 xmlns:s="library://ns.adobe.com/flex/spark"
4 xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="800" minHeight="600"
5 xmlns:maps="com.fgmap.maps.*">
6 <s:layout>
7 <s:BasicLayout/>
8 </s:layout>
9 <fx:Script>
10 <![CDATA[
11 import com.fgmap.maps.*;
12 import com.fgmap.maps.MapMouseEvent;
13 import com.fgmap.maps.controls.MapTypeControl;
14 import com.fgmap.maps.controls.NavigationControl;
15 import com.fgmap.maps.controls.OverviewMapControl;
16 import com.fgmap.maps.controls.ScaleControl;
17 import com.fgmap.maps.interfaces.IMapType;
18 import com.fgmap.maps.overlays.*;
19
20 private var marker:Marker;
21
22 private var centreLatlng:LatLng = new LatLng(39.911842984749946, 116.400146484375);//北京的一個座標位置。
23
24 protected function map_mapevent_mapreadyHandler(event:MapEvent):void
25 {
26 map.enableContinuousZoom(); //啟用連續平滑縮放。
27 map.enableScrollWheelZoom(); //啟用使用滑鼠滾輪縮放。
28 map.addControl(new MapTypeControl()); //供使用者在地圖類型之間進行切換的按鈕。
29 map.addControl(new NavigationControl());//供使用者更改地圖的各項導航參數,包括縮放層級、中心位置和空間方位角。
30 map.addControl(new ScaleControl()); //比例控制項是用於指示當前地圖的解析度和縮放層級的可視指標。
31
32 map.setCenter(centreLatlng,11); //設定地圖的中心點。
33
34 AddMarker();
35 }
36
37 private function AddMarker():void{
38 var markerOptions:MarkerOptions = new MarkerOptions();
39 markerOptions.draggable = true;//設定標註可以拖動
40
41 //定義一個標註
42 var marker:Marker = new Marker(map.getCenter(),markerOptions);
43
44 var infoOptions:InfoWindowOptions = new InfoWindowOptions();
45 infoOptions.title = "我的座標是";
46 infoOptions.content = marker.getLatLng().toString();
47 //標註拖動時關閉提示框
48 marker.addEventListener(MapMouseEvent.DRAG_START,function(e:Event):void{
49 marker.closeInfoWindow();
50 });
51 //拖動接受時顯示提示框
52 marker.addEventListener(MapMouseEvent.DRAG_END,function(e:Event):void{
53 marker.openInfoWindow(infoOptions);
54 });
55 //點擊標註時顯示提示框
56 marker.addEventListener(MapMouseEvent.CLICK, function(e:Event):void {
57 marker.openInfoWindow(infoOptions);
58 });
59
60 map.addOverlay(marker);//在地圖上顯示這個標註
61 marker.openInfoWindow(infoOptions);//開啟對話方塊
62 }
63
64 ]]>
65 </fx:Script>
66 <fx:Declarations>
67 <!-- 將非可視元素(例如服務、值對象)放在此處 -->
68 </fx:Declarations>
69 <s:Panel width="100%" height="100%" title="FGMap API DEMO">
70 <maps:Map id="map" width="100%" height="100%" mapevent_mapready="map_mapevent_mapreadyHandler(event)"/>
71 </s:Panel>
72 </s:Application>

是:

http://files.cnblogs.com/liongis/FGMapOne.swf

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.