1. 程式人生 > >c#兩種方式呼叫google地球,呼叫COM API以及呼叫GEPLUGIN 與js互動,載入kml檔案,dae檔案。將二維高德地圖覆蓋到到三維谷歌地球表面。

c#兩種方式呼叫google地球,呼叫COM API以及呼叫GEPLUGIN 與js互動,載入kml檔案,dae檔案。將二維高德地圖覆蓋到到三維谷歌地球表面。

網路上資源很多不全面,自己在開發的時候走了不少彎路,在這裡整理了最全面的google全套開發,COM互動,web端互動。封裝好了各種模組功能。 直接就可以呼叫。

第一種方式:呼叫COMAPI實現呼叫google地球

1、安裝googleearth客戶端。傳送門:https://pan.baidu.com/s/1xi3fwCIy3Jt6t5XbypqpCg 提取碼:0l7u

2、新增引用using EARTHLib;如果找不到此dll,到googleearth的安裝目錄下尋找後新增到引用即可。

3、新增預定義的方法到專案中,後續獲取視窗控制代碼,以及設定視窗的時候會呼叫其中的一些方法。

    class NativeMethods
    {
         [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
         public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, UInt32 uflags);
  
         [DllImport("user32.dll", CharSet = CharSet.Auto)]
         public static extern IntPtr PostMessage(int hWnd, int msg, int wParam, int lParam);
  
         #region 預定義
  
         public static readonly IntPtr HWND_BOTTOM = new IntPtr(1);
         public static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2);
         public static readonly IntPtr HWND_TOP = new IntPtr(0);
         public static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);

         public static readonly UInt32 SWP_NOSIZE = 1;
         public static readonly UInt32 SWP_NOMOVE = 2;
         public static readonly UInt32 SWP_NOZORDER = 4;
         public static readonly UInt32 SWP_NOREDRAW = 8;
         public static readonly UInt32 SWP_NOACTIVATE = 16;
         public static readonly UInt32 SWP_FRAMECHANGED = 32;
         public static readonly UInt32 SWP_SHOWWINDOW = 64;
         public static readonly UInt32 SWP_HIDEWINDOW = 128;
         public static readonly UInt32 SWP_NOCOPYBITS = 256;
         public static readonly UInt32 SWP_NOOWNERZORDER = 512;
         public static readonly UInt32 SWP_NOSENDCHANGING = 1024;
  
         #endregion
  
         public delegate int EnumWindowsProc(IntPtr hwnd, int lParam);
  
         [DllImport("user32", CharSet = CharSet.Auto)]
         public extern static IntPtr GetParent(IntPtr hWnd);
  
         [DllImport("user32", CharSet = CharSet.Auto)]
         public extern static bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
  
         [DllImport("user32", CharSet = CharSet.Auto)]
         public extern static IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
  
         [DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Auto)]
         public static extern IntPtr GetWindow(IntPtr hWnd, int uCmd);
  
         public static int GW_CHILD = 5;
         public static int GW_HWNDNEXT = 2;
     }

4、定義變數

        private bool isGEStart = false;//GE是否開啟
        private ApplicationGEClass geApp;
        /// <summary>
        /// 用來關閉GoogleEarth的訊息定義
        /// </summary>
        static readonly Int32 WM_QUIT = 0x0012;

        private IntPtr GEHWnd = (IntPtr)5;
        private IntPtr GEHrender = (IntPtr)5;
        private IntPtr GEParentHrender = (IntPtr)5;

5、做完上面的工作後,開始初始化谷歌地球。將下列程式碼放入自己定義的方法中即可。

try
            {
                if (!this.DesignMode)
                {
                    geApp = new ApplicationGEClass();

                    GEHWnd = (IntPtr)geApp.GetMainHwnd();
                    //隱藏GoogleEarth主視窗
                    NativeMethods.SetWindowPos(GEHWnd, NativeMethods.HWND_BOTTOM, 0, 0, 0, 0, NativeMethods.SWP_NOSIZE + NativeMethods.SWP_HIDEWINDOW);

                    GEHrender = (IntPtr)geApp.GetRenderHwnd();
                    GEParentHrender = (IntPtr)NativeMethods.GetParent(GEHrender);
                    //將渲染視窗嵌入到主窗體
                    NativeMethods.MoveWindow(GEHrender, 0, 0, this.panelEx_google.Size.Width, this.panelEx_google.Size.Height, true);
                    NativeMethods.SetParent(GEHrender, this.panelEx_google.Handle);
                    isGEStart = true;
                   
                }
            }
            catch (Exception ex)
            {
                
                isGEStart = false;
                Thread.Sleep(1000);
            }

6、以上程式碼可載入谷歌地球,並且釋放資源,程式執行如圖:

第一種方式實質上是啟動GoogleEarth客戶端,並獲取視窗控制代碼,再將視窗顯示的自己定義的控制元件下面,此種方法也可以實現需求,但是經過測試,此方法存在兩大弊端。第一,在啟動谷歌地球的時候將佔用大量的CPU資源。第二、在釋放谷歌地球的時候時候,可能會釋放失敗,無法關閉googleearth此時也將佔用大量的CPU。基於以上弊端所以採用第二種方式。webroswer呼叫js。

 

2、重點:乾貨。

c#使用GEPlugin外掛,webroswer與js互動,實現web端的googleearth體驗。並且載入kml,載入三維模型dae,載入路徑,電子圍欄。各種功能已封裝。呼叫即可使用。

1、下載GEPlugin 傳送門:

連結:https://pan.baidu.com/s/1e_elo_x0KlhfFgNzbboa6w
提取碼:687b 

2、使用GEPlugin相對於COMAPI要較為複雜。但是效能最優。下載封裝好的檔案,單獨的exe,放在程式專案檔案中,啟動這個檔案,在程式中呼叫一個方法即可載入google地球到webroswer。因為這個檔案有公司logo。所以不便釋出於此,有想要的可以私信我。單獨傳送。謹記:此檔案只供學習使用,交流心得,不得用於任何商業行為。

3、下面開始正式的編碼。如果下載了exe的檔案,並且開啟後,執行此段程式碼,谷歌地球將被載入完成。獲取的硬碟id以及cpu序列號,將此資料傳遞到封裝好的服務中。防止別的瀏覽器直接輸入網址瀏覽。安全校驗使用。

並且將你的form設定成對COM可見

[ComVisible(true)]
    public partial class AnalysisForm : Form

 

private CassiniDev.Server _server1;
private bool IsWebServerStarted = false;
public string WEBSERVER_PATH;


private void NavigateAnaForm_Shown() { string PLUGIN_URL_LOCAL; string PLUGIN_URL_RELOAD; //GoogleEarth延時載入的執行緒 //在程式啟動時使用單獨的執行緒來載入WebBroswer控制元件中的GE地圖,以免出現主介面載入時卡頓的現象 Thread geLazyLoadingThread = new System.Threading.Thread(new System.Threading.ThreadStart(delegate () { //Thread.Sleep(50); //記錄系統中現有的GEPlugIn執行緒 Process[] listExistedGePlugInProcess = Process.GetProcessesByName("geplugin"); this.BeginInvoke( new Action(() => { PLUGIN_URL_LOCAL = "http://127.0.0.1:9809/map.asp?px1=" + GetCpuID() + "&PX2=" + GetDiskID(); PLUGIN_URL_RELOAD = "http://127.0.0.1:9808/reload.html"; this.webBrowserGE.ObjectForScripting = this; this.webBrowserGE.ScriptErrorsSuppressed = false ; //_server = new CassiniDev.Server(9630, "/", WEBSERVER_PATH, //"G:\\Desktop\\1111\\bin\\Debug\\NavFiles", // System.Net.IPAddress.Parse("127.0.0.1"), "", false, true); //http://127.0.0.1:9809/map.asp?px1=178BFBFF00810F10&PX2=GLOWAY STK720GS3-S7 //http://192.168.0.196:9808/map.asp?px1=BFEBFBFF000906E9&PX2=SanDisk Cruzer Glide 3.0 USB Device this.webBrowserGE.Navigate(PLUGIN_URL_LOCAL); this.webBrowserGE.Visible = true; } )); })); //啟動GoogleEarth裝載的執行緒 geLazyLoadingThread.SetApartmentState(ApartmentState.STA); geLazyLoadingThread.Start(); }

private string GetDiskID()
{
try
{
//獲取硬碟ID
String HDid = " ";
ManagementClass mc = new ManagementClass("Win32_DiskDrive");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
HDid = (string)mo.Properties["Model"].Value;
}
moc = null;
mc = null;
return HDid;
}
catch
{
return "unknown";
}
finally
{
}
}
private string GetCpuID()
{
try
{
//獲取CPU序列號程式碼
string cpuInfo = " ";//cpu序列號
ManagementClass mc = new ManagementClass("Win32_Processor");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
}
moc = null;
mc = null;
return cpuInfo;
}
catch
{
return "unknown";
}
finally
{
}


}

 

4、此時地圖即可載入完成,萬水千山,踏出第一步。但是此時無法向谷歌地球新增kml或者三維模型。和一些其他的操作。如果要載入kml檔案。繼續往下看。

5、此時啟動web容器 ,先新增引用 CassiniDev4-lib;找不到又不想下載? 傳送門來了:

連結:https://pan.baidu.com/s/1LOzD7plVaGG3NstMEEUb0g
提取碼:oymj  

        /// <summary>
        /// 啟動Web容器服務
        /// </summary>
        public void Start_WebServer()
        {
            WEBSERVER_PATH = string.Concat(new object[] { Directory.GetCurrentDirectory(), Path.DirectorySeparatorChar, "3DView" });

            _server1 = new CassiniDev.Server(9630, "/", WEBSERVER_PATH,
                     System.Net.IPAddress.Parse("127.0.0.1"), "", false, true);

            if (!IsWebServerStarted)
            {
                try
                {
                    _server1.Start();
                    IsWebServerStarted = true;
                    MessageBox.Show("web 服務已經開啟!");
                }
                catch (Exception ex)
                {
                    MessageBox.Show( "服務開啟失敗!", "資訊提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _server1.Dispose();
                    return;
                }
                /*
                try
                {
                    _server2.Start();
                    IsWebServerStarted = true;
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show(Program.devExpressDarkSkin, "GBQ服務2開啟失敗!", "資訊提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _server2.Dispose();
                    return;
                }
                */
            }
            else
            {
                try
                {
                    _server1.ShutDown();
                    IsWebServerStarted = false;
                }
                catch (Exception ex)
                {
                    MessageBox.Show( "服務關閉失敗!", "資訊提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _server1.Dispose();
                    //return;
                }

                try
                {
                    _server1.Start();
                    IsWebServerStarted = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show( "服務開啟失敗!", "資訊提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _server1.Dispose();
                    return;
                }
            }
        }

 

6、此時小夥伴要問,為什麼要啟動一個web服務,不要著急,往下看。載入kml檔案。

 

webBrowserGE.Document.InvokeScript("importLidarKmlFilebyUrl", new object[] { "http://127.0.0.1:9630/3DMap/zouhang1.kml",true });

 

是不是很神奇,只需要一行程式碼,你的kml檔案,或者kml檔案中帶有有三維模型的檔案,即可被載入成功,因為程式已經完全封裝了你所需要的功能。

解析上一個疑惑,為什麼要啟動一個web服務,因為invokescprit載入檔案的時候需要以網址的形式載入,所以啟動一個web伺服器,並設定好root目錄,將你的kml檔案放置到root目錄下即可。

 

7、你以為此時kml檔案就可以載入成功了?成功的道路總是充滿坎坷的。此時的你載入kml的時候,應該是看不到任何反應的。因為我當初在這個地方踩了很多的坑。你們很幸運,不需要在這裡掙扎。記錄一下。分享給你們。

 

 

///重要重要重要        

public string getMapServerandLag_callback() { return "7,1,18"; }

多麼簡單的一個方法,但是沒有他你什麼也做不了。這個是地圖載入後的回撥方法。務必加上。用於給層級賦值。

下面還有幾個方法,分享給你門,可有可無。

//載入失敗後的回撥函式       
public void JSInitFailureCallback_(string error){
}   
//載入成功後的回撥函式

public void geSuccessLoadedCallback_()
{


}

 

 8、經過以上的努力你已經達成了目標的80%了。你所想要的功能已經基本實現。

另外一些其他的載入方法在這裡附上

                webBrowserGE.Document.InvokeScript("importGoogleMapKmlFilebyUrl", new object[] { "http://127.0.0.1:9630/3DMap/ditu.kml" });
                webBrowserGE.Document.InvokeScript("importLidarKmlFilebyUrl", new object[] { "http://127.0.0.1:9630/3DMap/zouhang1.kml",true });
                webBrowserGE.Document.InvokeScript("importRemarkKmlFilebyUrl", new object[] { "http://127.0.0.1:9630/3DMap/1111.kml" });
                webBrowserGE.Document.InvokeScript("importDrawKmlFilebyUrl", new object[] { "http://127.0.0.1:9630/3DMap/1111.kml" });
                webBrowserGE.Document.InvokeScript("importLidarKmlFilebyUrl", new object[] { "http://127.0.0.1:9630/3DMap/1111.kml", true });
                webBrowserGE.Document.InvokeScript("importDrawKmlFilebyUrl", new object[] { "http://192.168.1.196:9630/3DPaint/KmlDrawings/1111.kml", true });
                webBrowserGE.Document.InvokeScript("searchLocation_e", new object[] { 38, 117 });
                webBrowserGE.Document.InvokeScript("importLidarKmlFilebyUrl", new object[] { "http://127.0.0.1:9630/3DMap/111.kml" });

                webBrowserGE.Document.InvokeScript("getGEKml_e");
                webBrowserGE.Document.InvokeScript("setMapLayersStatus", new object[] { false, false, false, false, false, false, false, false, false, false, false, false });

非常簡單,可自己摸索。

9、上圖

 

 

到這裡就結束了?不存在的。技術用於之境。下面分享給大家,如何將二維高德地圖蒙皮到三維谷歌球體上。拭目以待。

10、載入高德地圖到谷歌地球上。實現谷歌地球與高德地圖之間的切換。

首先。需要下載兩個座標轉換檔案。傳送門:

連結:https://pan.baidu.com/s/18QCXtXdx98NJ-gkG5wU6_w
提取碼:b9c9 


//此檔案是實現座標以及經緯度的轉換

<%@ Import Namespace="System.Web.HttpResponse" %> <%@ language="javascript" Debug="true"%> <% function downloadfile() { var xValue=Request.QueryString("x") var yValue=Request.QueryString("y") var zValue=Request.QueryString("z") var FileName="landun_"+ zValue*1+"_"+xValue*1+"_"+yValue*1+".kml" var kmlstring=GetKmlSrtring() Response.AddHeader("content-disposition", "attachment;filename="+FileName+";") Response.ContentType = "text/xml" Response.Write(kmlstring) Response.Flush Response.Clear } //生成kml檔案的內容 function GetKmlSrtring() { var xValue=Request.QueryString("x") var yValue=Request.QueryString("y") var zValue=Request.QueryString("z") var kmlstr="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<kml xmlns=\"http://www.opengis.net/kml/2.2\">" ///GetMercatorCoordinates(zValue*1,xValue*1,yValue*1,"y"); ///GetMercatorCoordinates(zValue*1,xValue*1+1,yValue*1+1,"y") ///GetMercatorCoordinates(zValue*1,xValue*1+1,yValue*1,"x") ///GetMercatorCoordinates(zValue*1,xValue*1,yValue*1,"x") if(zValue*1>=21) { kmlstr=kmlstr+"<Document>\r\n<Region>\r\n<Lod>\r\n<minLodPixels>256</minLodPixels>\r\n<maxLodPixels>-1</maxLodPixels>\r\n</Lod>\r\n<LatLonAltBox>\r\n" kmlstr=kmlstr+"<north>"+(GetMercatorCoordinates(zValue*1,xValue*1,yValue*1,"y"))+"</north>\r\n<south>"+(GetMercatorCoordinates(zValue*1,xValue*1+1,yValue*1+1,"y"))+"</south>\r\n<east>"+GetMercatorCoordinates(zValue*1,xValue*1+1,yValue*1,"x")+"</east>\r\n<west>"+GetMercatorCoordinates(zValue*1,xValue*1,yValue*1,"x")+"</west>\r\n</LatLonAltBox>\r\n</Region>\r\n<GroundOverlay>\r\n" kmlstr=kmlstr+"<drawOrder>1</drawOrder>\r\n<Icon>\r\n<href>http://wprd04.is.autonavi.com/appmaptile</href><httpQuery>&amp;lang=zh_cn&amp;size=1&amp;scl=1&amp;style=7&amp;x="+(xValue*1)+"&amp;y="+(yValue*1)+"&amp;z="+(zValue*1)+"&amp;</httpQuery></Icon>\r\n<LatLonAltBox>\r\n" kmlstr=kmlstr+"<north>"+(GetMercatorCoordinates(zValue*1,xValue*1,yValue*1,"y"))+"</north>\r\n<south>"+(GetMercatorCoordinates(zValue*1,xValue*1,yValue*1+1,"y"))+"</south>\r\n<east>"+GetMercatorCoordinates(zValue*1,xValue*1+1,yValue*1,"x")+"</east>\r\n<west>"+GetMercatorCoordinates(zValue*1,xValue*1,yValue*1,"x")+"</west>\r\n</LatLonAltBox>\r\n<altitudeMode>clampToGround</altitudeMode>\r\n<altitude>0</altitude>\r\n" kmlstr=kmlstr+"</GroundOverlay>\r\n</Document>\r\n</kml>" }else{ kmlstr=kmlstr+"<Document>\r\n<Region>\r\n<Lod>\r\n<minLodPixels>256</minLodPixels>\r\n<maxLodPixels>-1</maxLodPixels>\r\n</Lod>\r\n<LatLonAltBox>\r\n" kmlstr=kmlstr+"<north>"+(GetMercatorCoordinates(zValue*1,xValue*1,yValue*1,"y"))+"</north>\r\n<south>"+(GetMercatorCoordinates(zValue*1,xValue*1+1,yValue*1+1,"y"))+"</south>\r\n<east>"+GetMercatorCoordinates(zValue*1,xValue*1+1,yValue*1,"x")+"</east>\r\n<west>"+GetMercatorCoordinates(zValue*1,xValue*1,yValue*1,"x")+"</west>\r\n</LatLonAltBox>\r\n</Region>\r\n<NetworkLink>\r\n" kmlstr=kmlstr+"<name>"+(xValue*2)+"_"+(yValue*2)+"_"+(zValue*1+1)+"</name>\r\n<Region>\r\n<Lod>\r\n<minLodPixels>256</minLodPixels>\r\n<maxLodPixels>-1</maxLodPixels>\r\n</Lod>\r\n<LatLonAltBox>\r\n" kmlstr=kmlstr+"<north>"+(GetMercatorCoordinates(zValue*1+1,xValue*2,yValue*2,"y"))+"</north>\r\n<south>"+(GetMercatorCoordinates(zValue*1+1,xValue*2,yValue*2+1,"y"))+"</south>\r\n<east>"+GetMercatorCoordinates(zValue*1+1,xValue*2+1,yValue*2,"x")+"</east>\r\n<west>"+GetMercatorCoordinates(zValue*1+1,xValue*2,yValue*2,"x")+"</west>\r\n</LatLonAltBox>\r\n</Region>\r\n<Link>\r\n" kmlstr=kmlstr+"<href>http://127.0.0.1:9630/3DMap/ditu.aspx</href><httpQuery>mt=ditu&amp;x="+(xValue*2)+"&amp;y="+(yValue*2)+"&amp;z="+(zValue*1+1)+"&amp;v=1.7&amp;dx=0&amp;dy=0&amp;trans=0</httpQuery>\r\n</Link>\r\n</NetworkLink>\r\n" kmlstr=kmlstr+"<NetworkLink>\r\n<name>"+(xValue*2+1)+"_"+(yValue*2)+"_"+(zValue*1+1)+"</name>\r\n<Region>\r\n<Lod>\r\n<minLodPixels>256</minLodPixels>\r\n<maxLodPixels>-1</maxLodPixels>\r\n</Lod>\r\n<LatLonAltBox>\r\n" kmlstr=kmlstr+"<north>"+(GetMercatorCoordinates(zValue*1+1,xValue*2+1,yValue*2,"y"))+"</north>\r\n<south>"+(GetMercatorCoordinates(zValue*1+1,xValue*2+1,yValue*2+1,"y"))+"</south>\r\n<east>"+GetMercatorCoordinates(zValue*1+1,xValue*2+2,yValue*2,"x")+"</east>\r\n<west>"+GetMercatorCoordinates(zValue*1+1,xValue*2+1,yValue*2,"x")+"</west>\r\n</LatLonAltBox>\r\n</Region>\r\n<Link>\r\n" kmlstr=kmlstr+"<href>http://127.0.0.1:9630/3DMap/ditu.aspx</href><httpQuery>mt=ditu&amp;x="+(xValue*2+1)+"&amp;y="+(yValue*2)+"&amp;z="+(zValue*1+1)+"&amp;v=1.7&amp;dx=0&amp;dy=0&amp;trans=0</httpQuery>\r\n</Link>\r\n</NetworkLink>\r\n" kmlstr=kmlstr+"<NetworkLink>\r\n<name>"+(xValue*2)+"_"+(yValue*2+1)+"_"+(zValue*1+1)+"</name>\r\n<Region>\r\n<Lod>\r\n<minLodPixels>256</minLodPixels>\r\n<maxLodPixels>-1</maxLodPixels>\r\n</Lod>\r\n<LatLonAltBox>\r\n" kmlstr=kmlstr+"<north>"+(GetMercatorCoordinates(zValue*1+1,xValue*2,yValue*2+1,"y"))+"</north>\r\n<south>"+(GetMercatorCoordinates(zValue*1+1,xValue*2,yValue*2+2,"y"))+"</south>\r\n<east>"+GetMercatorCoordinates(zValue*1+1,xValue*2+1,yValue*2+1,"x")+"</east>\r\n<west>"+GetMercatorCoordinates(zValue*1+1,xValue*2,yValue*2+1,"x")+"</west>\r\n</LatLonAltBox>\r\n</Region>\r\n<Link>\r\n" kmlstr=kmlstr+"<href>http://127.0.0.1:9630/3DMap/ditu.aspx</href><httpQuery>mt=ditu&amp;x="+(xValue*2)+"&amp;y="+(yValue*2+1)+"&amp;z="+(zValue*1+1)+"&amp;v=1.7&amp;dx=0&amp;dy=0&amp;trans=0</httpQuery>\r\n</Link>\r\n</NetworkLink>\r\n" kmlstr=kmlstr+"<NetworkLink>\r\n<name>"+(xValue*2+1)+"_"+(yValue*2+1)+"_"+(zValue*1+1)+"</name>\r\n<Region>\r\n<Lod>\r\n<minLodPixels>256</minLodPixels>\r\n<maxLodPixels>-1</maxLodPixels>\r\n</Lod>\r\n<LatLonAltBox>\r\n" kmlstr=kmlstr+"<north>"+(GetMercatorCoordinates(zValue*1+1,xValue*2+1,yValue*2+1,"y"))+"</north>\r\n<south>"+(GetMercatorCoordinates(zValue*1+1,xValue*2+1,yValue*2+2,"y"))+"</south>\r\n<east>"+GetMercatorCoordinates(zValue*1+1,xValue*2+2,yValue*2+1,"x")+"</east>\r\n<west>"+GetMercatorCoordinates(zValue*1+1,xValue*2+1,yValue*2+1,"x")+"</west>\r\n</LatLonAltBox>\r\n</Region>\r\n<Link>\r\n" kmlstr=kmlstr+"<href>http://127.0.0.1:9630/3DMap/ditu.aspx</href><httpQuery>mt=ditu&amp;x="+(xValue*2+1)+"&amp;y="+(yValue*2+1)+"&amp;z="+(zValue*1+1)+"&amp;v=1.7&amp;dx=0&amp;dy=0&amp;trans=0</httpQuery>\r\n</Link>\r\n</NetworkLink>\r\n" kmlstr=kmlstr+"<GroundOverlay>\r\n<drawOrder>1</drawOrder>\r\n<Icon>\r\n" kmlstr=kmlstr+"<href>http://wprd04.is.autonavi.com/appmaptile</href><httpQuery>&amp;lang=zh_cn&amp;size=1&amp;scl=1&amp;style=7&amp;x="+(xValue*1)+"&amp;y="+(yValue*1)+"&amp;z="+(zValue*1)+"&amp;</httpQuery>\r\n</Icon>" kmlstr=kmlstr+"<LatLonAltBox>\r\n<north>"+((GetMercatorCoordinates(zValue*1,xValue*1,yValue*1,"y")))+"</north>\r\n<south>"+(GetMercatorCoordinates(zValue*1,xValue,yValue*1+1,"y"))+"</south>\r\n<east>"+GetMercatorCoordinates(zValue*1,xValue*1+1,yValue*1,"x")+"</east>\r\n<west>"+GetMercatorCoordinates(zValue*1,xValue*1,yValue*1,"x")+"</west>\r\n</LatLonAltBox>\r\n" kmlstr=kmlstr+"<altitudeMode>clampToGround</altitudeMode>\r\n<altitude>0</altitude>\r\n</GroundOverlay>\r\n</Document>\r\n</kml>" } return kmlstr; } //得到墨卡託座標(雙軸) function GetMercatorCoordinates(zValue,xoryValue,yoryValue, xory) { var xyMercator={} //得到墨卡託座標 xyMercator.x=(-180+(360/(Math.pow(2,zValue)))*xoryValue) xyMercator.y=20037508.3427892 +(-40075016.6855784/(Math.pow(2,zValue)))*yoryValue ///Response.Write("<script>alert('xyMercator.x "+xyMercator.x+" xyMercator.y "+xyMercator.y +"');</script>"); //根據墨卡託座標轉換為GPS經緯度,再轉換為火星座標系經度或緯度 var LatLon = GetMarLatitudeAndLongitude(xyMercator, xory) ///Response.Write("<script>alert('xory "+xory+ " LatLon "+LatLon+"');</script>"); return LatLon } //返回修正後的經度或緯度 function GetMarLatitudeAndLongitude(xyMercator, xory) { var y var longitudeandlatitude={} //此處需注意longitudeandlatitude.lng不需要再進行計算轉換,直接賦值即可 longitudeandlatitude.lng = xyMercator.x y=xyMercator.y / 20037508.3427892 * 180 longitudeandlatitude.lat=(180 / Math.PI * (2 * Math.atan(Math.exp(y * Math.PI / 180)) - Math.PI / 2))//.toFixed(12) ///Response.Write("<script>alert('longitudeandlatitude.lat"+longitudeandlatitude.lat+ " longitudeandlatitude.lng"+longitudeandlatitude.lng+"');</script>"); //轉換GPS經緯度為火星經緯度 var mar = transform(longitudeandlatitude.lat, longitudeandlatitude.lng) if(xory=="y") { return mar.mgLat; } else { return mar.mgLon } } //此方法已啟用 //獲取經緯度,墨卡託座標轉換為經緯度 function GetLatitudeAndLongitude(mercatorY) { var y,longitudeandlatitude y=mercatorY / 20037508.3427892 * 180 longitudeandlatitude=(180 / Math.PI * (2 * Math.atan(Math.exp(y * Math.PI / 180)) - Math.PI / 2))//.toFixed(12) return longitudeandlatitude } //GPS經緯度轉化為火星經緯度 function transform(wgLat, wgLon) { var lnglat={} if (outOfChina(wgLat, wgLon)) { lnglat.mgLat = wgLat; lnglat.mgLon = wgLon; return lnglat; } var dLat = transformLat(wgLon - 105.0, wgLat - 35.0); var dLon = transformLon(wgLon - 105.0, wgLat - 35.0); var radLat = wgLat / 180.0 * Math.PI; var magic = Math.sin(radLat); magic = 1 - 0.00669342162296594323 * magic * magic; var sqrtMagic = Math.sqrt(magic); dLat = (dLat * 180.0) / ((6378245.0 * (1 - 0.00669342162296594323)) / (magic * sqrtMagic) * Math.PI); dLon = (dLon * 180.0) / (6378245.0 / sqrtMagic * Math.cos(radLat) * Math.PI); lnglat.mgLat = wgLat - dLat; ///Response.Write("<script>alert('wgLat"+wgLat+ " dLat"+dLat+"lnglat.mgLat "+lnglat.mgLat+"');</script>"); lnglat.mgLon = wgLon - dLon; return lnglat; } //是否不在中國 function outOfChina(lat, lon) { if (lon < 72.004 || lon > 137.8347) return true; if (lat < 0.8293 || lat > 55.8271) return true; return false; } //轉換緯度 function transformLat(x, y) { var ret ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x)); ret += (20.0 * Math.sin(6.0 * x * Math.PI) + 20.0 * Math.sin(2.0 * x * Math.PI)) * 2.0 / 3.0; ret += (20.0 * Math.sin(y * Math.PI) + 40.0 * Math.sin(y / 3.0 * Math.PI)) * 2.0 / 3.0; ret += (160.0 * Math.sin(y / 12.0 * Math.PI) + 320 * Math.sin(y * Math.PI / 30.0)) * 2.0 / 3.0; return ret; } //轉換經度 function transformLon(x, y) { var ret ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x)); ret += (20.0 * Math.sin(6.0 * x * Math.PI) + 20.0 * Math.sin(2.0 * x * Math.PI)) * 2.0 / 3.0; ret += (20.0 * Math.sin(x * Math.PI) + 40.0 * Math.sin(x / 3.0 * Math.PI)) * 2.0 / 3.0; ret += (150.0 * Math.sin(x / 12.0 * Math.PI) + 300.0 * Math.sin(x / 30.0 * Math.PI)) * 2.0 / 3.0; return ret; } %> <%downloadfile()%>

 

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<NetworkLink>
  <name>Google Ditu (China Maps)</name>
  <Region>
    <LatLonAltBox>
      <north>85.051128779807</north>
      <south>-85.051128779807</south>
      <east>180</east>
      <west>-180</west>
    </LatLonAltBox>
    <Lod>
      <minLodPixels>256</minLodPixels>
      <maxLodPixels>-1</maxLodPixels>
    </Lod>
  </Region>
  <Link>
    <href>http://127.0.0.1:9630/3DMap/ditu.aspx</href><httpQuery>mt=ditu&amp;x=0&amp;y=0&amp;z=0&amp;v=1.7&amp;dx=0&amp;dy=0&amp;trans=0</httpQuery>    <viewRefreshMode>onRegion</viewRefreshMode>
  </Link>
</NetworkLink>
</kml>

只需向普通地圖一樣,直接載入下載好的,ditu.kml檔案一樣,即可實現從谷歌地球切換到高德地圖。

有圖有真相

 

附上一些附加的檔案js檔案。供參考研究。再次申明,只可用於技術學習,不可用於商業行為,謹記!!!

if (!window['googleLT_']) {
    window['googleLT_'] = (new Date()).getTime();
}

if (!window['google']) {
    window['google'] = {};
}

if (!window['google']['loader']) {
    window['google']['loader'] = {};

    google.loader.ServiceBase = 'http://www.google.com/uds';
    google.loader.GoogleApisBase = 'http://ajax.googleapis.com/ajax'; 
	google.loader.ApiKey = 'ABQIAAAA7WGF96hesauuOvt92hVLGRSCo55h5L89YfkfbOZYeht3olu9OBQ-iPLPnY04cIbcfiDwRhN8JorTRg';
	google.loader.KeyVerified = true;
	google.loader.LoadFailure = false;
	google.loader.Secure = false;
	google.loader.GoogleLocale = 'www.google.com';
	google.loader.ClientLocation = {"latitude":31.8175,"longitude":117.22775,"address":{"city":"Hefei","region":"Anhui","country":"China","country_code":"CN"}};
	google.loader.AdditionalParams = '';
    
	//JS匿名函式,JS載入時立即執行
	(function () {
        var d = void 0,
            g = !0,
            h = null,
            j = !1,
            k = encodeURIComponent,
            l = window,
            m = document;

        function n(a, b) {
            return a.load = b
        }

        var p = "push",
            q = "replace",
            r = "charAt",
            t = "indexOf",
            u = "ServiceBase",
            v = "name",
            w = "getTime",
            x = "length",
            y = "prototype",
            z = "setTimeout",
            A = "loader",
            B = "substring",
            C = "join",
            D = "toLowerCase";

        function E(a) {
            return a in F ? F[a] : F[a] = -1 != navigator.userAgent[D]()[t](a)
        }
        var F = {};

        function G(a, b) {
            var c = function () {};
            c.prototype = b[y];
            a.T = b[y];
            a.prototype = new c
        }

        function H(a, b, c) {
            var e = Array[y].slice.call(arguments, 2) || [];
            return function () {
                var c = e.concat(Array[y].slice.call(arguments));
                return a.apply(b, c)
            }
        }

        function I(a) {
            a = Error(a);
            a.toString = function () {
                return this.message
            };
            return a
        }

        function J(a, b) {
            for (var c = a.split(/\./), e = l, f = 0; f < c[x] - 1; f++) e[c[f]] || (e[c[f]] = {}), e = e[c[f]];
            e[c[c[x] - 1]] = b
        }

        function K(a, b, c) {
            a[b] = c
        }

        if (!L) var L = J;
        if (!M) var M = K;
        google[A].v = {};
        L("google.loader.callbacks", google[A].v);
        var N = {},
            O = {};
        google[A].eval = {};
        L("google.loader.eval", google[A].eval);

        n(google, function (a, b, c) {
            function e(a) {
                var b = a.split(".");
                if (2 < b[x]) throw I("Module: '" + a + "' not found!");
                "undefined" != typeof b[1] && (f = b[0], c.packages = c.packages || [], c.packages[p](b[1]))
            }
            var f = a,
                c = c || {};
            if (a instanceof Array || a && "object" == typeof a && "function" == typeof a[C] && "function" == typeof a.reverse)
                for (var i = 0; i < a[x]; i++) e(a[i]);
            else e(a); if (a = N[":" + f]) {
                c && (!c.language && c.locale) && (c.language = c.locale);
                c && "string" == typeof c.callback && (i = c.callback, i.match(/^[[\]A-Za-z0-9._]+$/) && (i = l.eval(i), c.callback =
                    i));
                if ((i = c && c.callback != h) && !a.s(b)) throw I("Module: '" + f + "' must be loaded before DOM onLoad!");
                i ? a.m(b, c) ? l[z](c.callback, 0) : a.load(b, c) : a.m(b, c) || a.load(b, c)
            } else throw I("Module: '" + f + "' not found!");
        });

        L("google.load", google.load);
        google.S = function (a, b) {
            b ? (0 == P[x] && (Q(l, "load", R), !E("msie") && !E("safari") && !E("konqueror") && E("mozilla") || l.opera ? l.addEventListener("DOMContentLoaded", R, j) : E("msie") ? m.write("<script defer onreadystatechange='google.loader.domReady()' src=//:><\/script>") : (E("safari") || E("konqueror")) && l[z](T, 10)), P[p](a)) : Q(l, "load", a)
        };
        L("google.setOnLoadCallback", google.S);

        function Q(a, b, c) {
            if (a.addEventListener) a.addEventListener(b, c, j);
            else if (a.attachEvent) a.attachEvent("on" + b, c);
            else {
                var e = a["on" + b];
                a["on" + b] = e != h ? aa([c, e]) : c
            }
        }

        function aa(a) {
            return function () {
                for (var b = 0; b < a[x]; b++) a[b]()
            }
        }
        var P = [];
        google[A].O = function () {
            var a = l.event.srcElement;
            "complete" == a.readyState && (a.onreadystatechange = h, a.parentNode.removeChild(a), R())
        };
        L("google.loader.domReady", google[A].O);
        var ba = {
            loaded: g,
            complete: g
        };

        function T() {
            ba[m.readyState] ? R() : 0 < P[x] && l[z](T, 10)
        }

        function R() {
            for (var a = 0; a < P[x]; a++) P[a]();
            P.length = 0
        }
        google[A].d = function (a, b, c) {
            if (c) {
                var e;
                "script" == a ? (e = m.createElement("script"), e.type = "text/javascript", e.src = b) : "css" == a && (e = m.createElement("link"), e.type = "text/css", e.href = b, e.rel = "stylesheet");
                (a = m.getElementsByTagName("head")[0]) || (a = m.body.parentNode.appendChild(m.createElement("head")));
                a.appendChild(e)
            } else "script" == a ? m.write('<script src="' + b + '" type="text/javascript"><\/script>') : "css" == a && m.write('<link href="' + b + '" type="text/css" rel="stylesheet"></link>')
        };
        L("google.loader.writeLoadTag", google[A].d);
        google[A].P = function (a) {
            O = a
        };
        L("google.loader.rfm", google[A].P);
        google[A].R = function (a) {
            for (var b in a) "string" == typeof b && (b && ":" == b[r](0) && !N[b]) && (N[b] = new U(b[B](1), a[b]))
        };
        L("google.loader.rpl", google[A].R);
        google[A].Q = function (a) {
            if ((a = a.specs) && a[x])
                for (var b = 0; b < a[x]; ++b) {
                    var c = a[b];
                    "string" == typeof c ? N[":" + c] = new V(c) : (c = new W(c[v], c.baseSpec, c.customSpecs), N[":" + c[v]] = c)
                }
        };
        L("google.loader.rm", google[A].Q);
        google[A].loaded = function (a) {
            N[":" + a.module].l(a)
        };
        L("google.loader.loaded", google[A].loaded);
        google[A].N = function () {
            return "qid=" + ((new Date)[w]().toString(16) + Math.floor(1E7 * Math.random()).toString(16))
        };
        L("google.loader.createGuidArg_", google[A].N);
        J("google_exportSymbol", J);
        J("google_exportProperty", K);
        google[A].a = {};
        L("google.loader.themes", google[A].a);
        google[A].a.H = "//www.google.com/cse/style/look/bubblegum.css";
        M(google[A].a, "BUBBLEGUM", google[A].a.H);
        google[A].a.J = "//www.google.com/cse/style/look/greensky.css";
        M(google[A].a, "GREENSKY", google[A].a.J);
        google[A].a.I = "//www.google.com/cse/style/look/espresso.css";
        M(google[A].a, "ESPRESSO", google[A].a.I);
        google[A].a.L = "//www.google.com/cse/style/look/shiny.css";
        M(google[A].a, "SHINY", google[A].a.L);
        google[A].a.K = "//www.google.com/cse/style/look/minimalist.css";
        M(google[A].a, "MINIMALIST", google[A].a.K);
        google[A].a.M = "//www.google.com/cse/style/look/v2/default.css";
        M(google[A].a, "V2_DEFAULT", google[A].a.M);

        function V(a) {
            this.b = a;
            this.o = [];
            this.n = {};
            this.e = {};
            this.f = {};
            this.j = g;
            this.c = -1
        }

        V[y].g = function (a, b) {
            var c = "";
            b != d && (b.language != d && (c += "&hl=" + k(b.language)), b.nocss != d && (c += "&output=" + k("nocss=" + b.nocss)), b.nooldnames != d && (c += "&nooldnames=" + k(b.nooldnames)), b.packages != d && (c += "&packages=" + k(b.packages)), b.callback != h && (c += "&async=2"), b.style != d && (c += "&style=" + k(b.style)), b.noexp != d && (c += "&noexp=true"), b.other_params != d && (c += "&" + b.other_params));
            if (!this.j) {
                google[this.b] && google[this.b].JSHash && (c += "&sig=" + k(google[this.b].JSHash));
                var e = [],
                    f;
                for (f in this.n) ":" == f[r](0) && e[p](f[B](1));
                for (f in this.e) ":" == f[r](0) && this.e[f] && e[p](f[B](1));
                c += "&have=" + k(e[C](","))
            }
            return google[A][u] + "/?file=" + this.b + "&v=" + a + google[A].AdditionalParams + c
        };

        V[y].t = function (a) {
            var b = h;
            a && (b = a.packages);
            var c = h;
            if (b)
                if ("string" == typeof b) c = [a.packages];
                else if (b[x]) {
                c = [];
                for (a = 0; a < b[x]; a++) "string" == typeof b[a] && c[p](b[a][q](/^\s*|\s*$/, "")[D]())
            }
            c || (c = ["default"]);
            b = [];
            for (a = 0; a < c[x]; a++) this.n[":" + c[a]] || b[p](c[a]);
            return b
        };

        n(V[y], function (a, b) {
            var c = this.t(b),
                e = b && b.callback != h;
            if (e) var f = new X(b.callback);
            for (var i = [], o = c[x] - 1; 0 <= o; o--) {
                var s = c[o];
                e && f.A(s);
                if (this.e[":" + s]) c.splice(o, 1), e && this.f[":" + s][p](f);
                else i[p](s)
            }
            if (c[x]) {
                b && b.packages && (b.packages = c.sort()[C](","));
                for (o = 0; o < i[x]; o++) s = i[o], this.f[":" + s] = [], e && this.f[":" + s][p](f);
                if (!b && O[":" + this.b] != h && O[":" + this.b].versions[":" + a] != h && !google[A].AdditionalParams && this.j) {
                    c = O[":" + this.b];
                    google[this.b] = google[this.b] || {};
                    for (var S in c.properties) S && ":" ==
                        S[r](0) && (google[this.b][S[B](1)] = c.properties[S]);
                    google[A].d("script", google[A][u] + c.path + c.js, e);
                    c.css && google[A].d("css", google[A][u] + c.path + c.css, e)
                } else(!b || !b.autoloaded) && google[A].d("script", this.g(a, b), e);
                this.j && (this.j = j, this.c = (new Date)[w](), 1 != this.c % 100 && (this.c = -1));
                for (o = 0; o < i[x]; o++) s = i[o], this.e[":" + s] = g
            }
        });

        V[y].l = function (a) {
            -1 != this.c && (ca("al_" + this.b, "jl." + ((new Date)[w]() - this.c), g), this.c = -1);
            this.o = this.o.concat(a.components);
            google[A][this.b] || (google[A][this.b] = {});
            google[A][this.b].packages = this.o.slice(0);
            for (var b = 0; b < a.components[x]; b++) {
                this.n[":" + a.components[b]] = g;
                this.e[":" + a.components[b]] = j;
                var c = this.f[":" + a.components[b]];
                if (c) {
                    for (var e = 0; e < c[x]; e++) c[e].B(a.components[b]);
                    delete this.f[":" + a.components[b]]
                }
            }
        };

        V[y].m = function (a, b) {
            return 0 == this.t(b)[x]
        };
        V[y].s = function () {
            return g
        };

        function X(a) {
            this.D = a;
            this.q = {};
            this.r = 0
        }
        X[y].A = function (a) {
            this.r++;
            this.q[":" + a] = g
        };
        X[y].B = function (a) {
            this.q[":" + a] && (this.q[":" + a] = j, this.r--, 0 == this.r && l[z](this.D, 0))
        };

        function W(a, b, c) {
            this.name = a;
            this.C = b;
            this.p = c;
            this.u = this.h = j;
            this.k = [];
            google[A].v[this[v]] = H(this.l, this)
        }

        G(W, V);
        n(W[y], function (a, b) {
            var c = b && b.callback != h;
            c ? (this.k[p](b.callback), b.callback = "google.loader.callbacks." + this[v]) : this.h = g;
            (!b || !b.autoloaded) && google[A].d("script", this.g(a, b), c)
        });
        W[y].m = function (a, b) {
            return b && b.callback != h ? this.u : this.h
        };
        W[y].l = function () {
            this.u = g;
            for (var a = 0; a < this.k[x]; a++) l[z](this.k[a], 0);
            this.k = []
        };
        var Y = function (a, b) {
            return a.string ? k(a.string) + "=" + k(b) : a.regex ? b[q](/(^.*$)/, a.regex) : ""
        };
        W[y].g = function (a, b) {
            return this.F(this.w(a), a, b)
        };
        W[y].F = function (a, b, c) {
            var e = "";
            a.key && (e += "&" + Y(a.key, google[A].ApiKey));
            a.version && (e += "&" + Y(a.version, b));
            b = google[A].Secure && a.ssl ? a.ssl : a.uri;
            if (c != h)
                for (var f in c) a.params[f] ? e += "&" + Y(a.params[f], c[f]) : "other_params" == f ? e += "&" + c[f] : "base_domain" == f && (b = "http://" + c[f] + a.uri[B](a.uri[t]("/", 7)));
            google[this[v]] = {}; - 1 == b[t]("?") && e && (e = "?" + e[B](1));
            return b + e
        };
        W[y].s = function (a) {
            return this.w(a).deferred
        };
        W[y].w = function (a) {
            if (this.p)
                for (var b = 0; b < this.p[x]; ++b) {
                    var c = this.p[b];
                    if (RegExp(c.pattern).test(a)) return c
                }
            return this.C
        };

        function U(a, b) {
            this.b = a;
            this.i = b;
            this.h = j
        }
        G(U, V);
        n(U[y], function (a, b) {
            this.h = g;
            google[A].d("script", this.g(a, b), j)
        });
        U[y].m = function () {
            return this.h
        };
        U[y].l = function () {};
        U[y].g = function (a, b) {
            if (!this.i.versions[":" + a]) {
                if (this.i.aliases) {
                    var c = this.i.aliases[":" + a];
                    c && (a = c)
                }
                if (!this.i.versions[":" + a]) throw I("Module: '" + this.b + "' with version '" + a + "' not found!");
            }
            return google[A].GoogleApisBase + "/libs/" + this.b + "/" + a + "/" + this.i.versions[":" + a][b && b.uncompressed ? "uncompressed" : "compressed"]
        };
        U[y].s = function () {
            return j
        };
        var da = j,
            Z = [],
            ea = (new Date)[w](),
            ga = function () {
                da || (Q(l, "unload", fa), da = g)
            },
            ha = function (a, b) {
                ga();
                if (!google[A].Secure && (!google[A].Options || google[A].Options.csi === j)) {
                    for (var c = 0; c < a[x]; c++) a[c] = k(a[c][D]()[q](/[^a-z0-9_.]+/g, "_"));
                    for (c = 0; c < b[x]; c++) b[c] = k(b[c][D]()[q](/[^a-z0-9_.]+/g, "_"));
                    l[z](H($, h, "//gg.google.com/csi?s=uds&v=2&action=" + a[C](",") + "&it=" + b[C](",")), 1E4)
                }
            },
            ca = function (a, b, c) {
                c ? ha([a], [b]) : (ga(), Z[p]("r" + Z[x] + "=" + k(a + (b ? "|" + b : ""))), l[z](fa, 5 < Z[x] ? 0 : 15E3))
            },
            fa = function () {
                if (Z[x]) {
                    var a =
                        google[A][u];
                    0 == a[t]("http:") && (a = a[q](/^http:/, "https:"));
                    $(a + "/stats?" + Z[C]("&") + "&nc=" + (new Date)[w]() + "_" + ((new Date)[w]() - ea));
                    Z.length = 0
                }
            },
            $ = function (a) {
                var b = new Image,
                    c = $.G++;
                $.z[c] = b;
                b.onload = b.onerror = function () {
                    delete $.z[c]
                };
                b.src = a;
                b = h
            };
        $.z = {};
        $.G = 0;
        J("google.loader.recordCsiStat", ha);
        J("google.loader.recordStat", ca);
        J("google.loader.createImageForLogging", $);
    })();

    google.loader.rm({
        "specs": ["feeds", "spreadsheets", "gdata", "visualization", {
            "name": "sharing",
            "baseSpec": {
                "uri": "http://www.google.com/s2/sharing/js",
                "ssl": null,
                "key": {
                    "string": "key"
                },
                "version": {
                    "string": "v"
                },
                "deferred": false,
                "params": {
                    "language": {
                        "string": "hl"
                    }
                }
            }
        }, "search", "orkut", "ads", "elements", {
            "name": "books",
            "baseSpec": {
                "uri": "http://books.google.com/books/api.js",
                "ssl": "https://encrypted.google.com/books/api.js",
                "key": {
                    "string": "key"
                },
                "version": {
                    "string": "v"
                },
                "deferred": true,
                "params": {
                    "callback": {
                        "string": "callback"
                    },
                    "language": {
                        "string": "hl"
                    }
                }
            }
        }, {
            "name": "friendconnect",
            "baseSpec": {
                "uri": "http://www.google.com/friendconnect/script/friendconnect.js",
                "ssl": null,
                "key": {
                    "string": "key"
                },
                "version": {
                    "string": "v"
                },
                "deferred": false,
                "params": {}
            }
        }, "identitytoolkit", "ima", {
            "name": "maps",
            "baseSpec": {
                "uri": "http://maps.google.com/maps?file\u003dgoogleapi",
                "ssl": "https://maps-api-ssl.google.com/maps?file\u003dgoogleapi",
                "key": {
                    "string": "key"
                },
                "version": {
                    "string": "v"
                },
                "deferred": true,
                "params": {
                    "callback": {
                        "regex": "callback\u003d$1\u0026async\u003d2"
                    },
                    "language": {
                        "string": "hl"
                    }
                }
            },
            "customSpecs": [{
                "uri": "http://maps.googleapis.com/maps/api/js",
                "ssl": "https://maps.googleapis.com/maps/api/js",
                "version": {
                    "string": "v"
                },
                "deferred": true,
                "params": {
                    "callback": {
                        "string": "callback"
                    },
                    "language": {
                        "string": "hl"
                    }
                },
                "pattern": "^(3|3..*)$"
            }]
        }, "payments", "wave", "annotations_v2", "earth", "language", {
            "name": "annotations",
            "baseSpec": {
                "uri": "http://www.google.com/reviews/scripts/annotations_bootstrap.js",
                "ssl": null,
                "key": {
                    "string": "key"
                },
                "version": {
                    "string": "v"
                },
                "deferred": true,
                "params": {
                    "callback": {
                        "string": "callback"
                    },
                    "language": {
                        "string": "hl"
                    },
                    "country": {
                        "string": "gl"
                    }
                }
            }
        }, "picker"]
    });

    google.loader.rfm({
        ":search": {
            "versions": {
                ":1": "1",
                ":1.0": "1"
            },
            "path": "/api/search/1.0/523aed65e4aba49d1d640dadc8a0c37c/",
            "js": "default+zh_CN.I.js",
            "css": "default+zh_CN.css",
            "properties": {
                ":JSHash": "523aed65e4aba49d1d640dadc8a0c37c",
                ":NoOldNames": false,
                ":Version": "1.0"
            }
        },
        ":language": {
            "versions": {
                ":1": "1",
                ":1.0": "1"
            },
            "path": "/api/language/1.0/895197a38226304ef49a03d324d6ca19/",
            "js": "default+zh_CN.I.js",
            "properties": {
                ":JSHash": "895197a38226304ef49a03d324d6ca19",
                ":Version": "1.0"
            }
        },
        ":feeds": {
            "versions": {
                ":1": "1",
                ":1.0": "1"
            },
            "path": "/api/feeds/1.0/77f89919ef841f93359ce886504e4e3f/",
            "js": "default+zh_CN.I.js",
            "css": "default+zh_CN.css",
            "properties": {
                ":JSHash": "77f89919ef841f93359ce886504e4e3f",
                ":Version": "1.0"
            }
        },
        ":spreadsheets": {
            "versions": {
                ":0": "1",
                ":0.4": "1"
            },
            "path": "/api/spreadsheets/0.4/87ff7219e9f8a8164006cbf28d5e911a/",
            "js": "default.I.js",
            "properties": {
                ":JSHash": "87ff7219e9f8a8164006cbf28d5e911a",
                ":Version": "0.4"
            }
        },
        ":ima": {
            "versions": {
                ":3": "1",
                ":3.0": "1"
            },
            "path": "/api/ima/3.0/28a914332232c9a8ac0ae8da68b1006e/",
            "js": "default.I.js",
            "properties": {
                ":JSHash": "28a914332232c9a8ac0ae8da68b1006e",
                ":Version": "3.0"
            }
        },
        ":wave": {
            "versions": {
                ":1": "1",
                ":1.0": "1"
            },
            "path": "/api/wave/1.0/3b6f7573ff78da6602dda5e09c9025bf/",
            "js": "default.I.js",
            "properties": {
                ":JSHash": "3b6f7573ff78da6602dda5e09c9025bf",
                ":Version": "1.0"
            }
        },
        ":annotations": {
            "versions": {
                ":1": "1",
                ":1.0": "1"
            },
            "path": "/api/annotations/1.0/b367e3f4388025885f0fd77f722f567e/",
            "js": "default+zh_CN.I.js",
            "properties": {
                ":JSHash": "b367e3f4388025885f0fd77f722f567e",
                ":Version": "1.0"
            }
        },
        ":earth": {
            "versions": {
                ":1": "1",
                ":1.0": "1"
            },
            "path": "/api/earth/1.0/109c7b2bae7fe6cc34ea875176165d81/",
            "js": "default.I.js",
            "properties": {
                ":JSHash": "109c7b2bae7fe6cc34ea875176165d81",
                ":Version": "1.0"
            }
        },
        ":picker": {
            "versions": {
                ":1": "1",
                ":1.0": "1"
            },
            "path": "/api/picker/1.0/9f12d82446e96eb628659bd51eee66cf/",
            "js": "default.I.js",
            "css": "default.css",
            "properties": {
                ":JSHash": "9f12d82446e96eb628659bd51eee66cf",
                ":Version": "1.0"
            }
        }
    });

    google.loader.rpl({
        ":scriptaculous": {
            "versions": {
                ":1.8.3": {
                    "uncompressed": "scriptaculous.js",
                    "compressed": "scriptaculous.js"
                },
                ":1.9.0": {
                    "uncompressed": "scriptaculous.js",
                    "compressed": "scriptaculous.js"
                },
                ":1.8.2": {
                    "uncompressed": "scriptaculous.js",
                    "compressed": "scriptaculous.js"
                },
                ":1.8.1": {
                    "uncompressed": "scriptaculous.js",
                    "compressed": "scriptaculous.js"
                }
            },
            "aliases": {
                ":1.8": "1.8.3",
                ":1": "1.9.0",
                ":1.9": "1.9.0"
            }
        },
        ":yui": {
            "versions": {
                ":2.6.0": {
                    "uncompressed": "build/yuiloader/yuiloader.js",
                    "compressed": "build/yuiloader/yuiloader-min.js"
                },
                ":2.9.0": {
                    "uncompressed": "build/yuiloader/yuiloader.js",
                    "compressed": "build/yuiloader/yuiloader-min.js"
                },
                ":2.7.0": {
                    "uncompressed": "build/yuiloader/yuiloader.js",
                    "compressed": "build/yuiloader/yuiloader-min.js"
                },
                ":2.8.0r4": {
                    "uncompressed": "build/yuiloader/yuiloader.js",
                    "compressed": "build/yuiloader/yuiloader-min.js"
                },
                ":2.8.2r1": {
                    "uncompressed": "build/yuiloader/yuiloader.js",
                    "compressed": "build/yuiloader/yuiloader-min.js"
                },
                ":2.8.1": {
                    "uncompressed": "build/yuiloader/yuiloader.js",
                    "compressed": "build/yuiloader/yuiloader-min.js"
                },
                ":3.3.0": {
                    "uncompressed": "build/yui/yui.js",
                    "compressed": "build/yui/yui-min.js"
                }
            },
            "aliases": {
                ":3": "3.3.0",
                ":2": "2.9.0",
                ":2.7": "2.7.0",
                ":2.8.2": "2.8.2r1",
                ":2.6": "2.6.0",
                ":2.9": "2.9.0",
                ":2.8": "2.8.2r1",
                ":2.8.0": "2.8.0r4",
                ":3.3": "3.3.0"
            }
        },
        ":swfobject": {
            "versions": {
                ":2.1": {
                    "uncompressed": "swfobject_src.js",
                    "compressed": "swfobject.js"
                },
                ":2.2": {
                    "uncompressed": "swfobject_src.js",
                    "compressed": "swfobject.js"
                }
            },
            "aliases": {
                ":2": "2.2"
            }
        },
        ":webfont": {
            "versions": {
                ":1.0.12": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.13": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.14": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.15": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.10": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.11": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.2": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.1": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.0": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.19": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.6": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.18": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.5": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.17": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.4": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.16": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.3": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.9": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.21": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.22": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.25": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.26": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.23": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                },
                ":1.0.24": {
                    "uncompressed": "webfont_debug.js",
                    "compressed": "webfont.js"
                }
            },
            "aliases": {
                ":1": "1.0.26",
                ":1.0": "1.0.26"
            }
        },
        ":ext-core": {
            "versions": {
                ":3.1.0": {
                    "uncompressed": "ext-core-debug.js",
                    "compressed": "ext-core.js"
                },
                ":3.0.0": {
                    "uncompressed": "ext-core-debug.js",
                    "compressed": "ext-core.js"
                }
            },
            "aliases": {
                ":3": "3.1.0",
                ":3.0": "3.0.0",
                ":3.1": "3.1.0"
            }
        },
        ":mootools": {
            "versions": {
                ":1.3.1": {
                    "uncompressed": "mootools.js",
                    "compressed": "mootools-yui-compressed.js"
                },
                ":1.1.1": {
                    "uncompressed": "mootools.js",
                    "compressed": "mootools-yui-compressed.js"
                },
                ":1.3.0": {
                    "uncompressed": "mootools.js",
                    "compressed": "mootools-yui-compressed.js"
                },
                ":1.3.2": {
                    "uncompressed": "mootools.js",
                    "compressed": "mootools-yui-compressed.js"
                },
                ":1.1.2": {
                    "uncompressed": "mootools.js",
                    "compressed": "mootools-yui-compressed.js"
                },
                ":1.2.3": {