2013-11-15 37 views
2

基於本文Bing Map Usage上,有2種方式來加載了Bing地圖:冰地圖:AJAXTileUsage和LoadStandardMap

  1. AJAXTileUsage,創建一個兵地圖鍵映射會話並下載地圖圖塊:8地圖圖塊下載計爲一個不計費交易
  2. LoadStandardMap,地圖圖塊URL用於使用Bing地圖密鑰下載地圖圖塊。 8張地圖下載量計爲收費交易。

這裏有成本的含義。所以顯然我們應該嘗試使用AJAXTileUsage。

不過基於目前的閱讀和網絡搜索,我對我們現在使用的東西有點困惑。基本上我們只是使用Bing Map Ajax Control 7.0 Map類(see link)。我們的代碼並不需要自己處理地圖下載。

基於從小提琴手的HTTP流量捕獲,這裏的步驟:

  1. 客戶端發送Web服務請求https://dev.virtualearth.net/webservices/v1/LoggingService/LoggingService.svc/Log用冰地圖鍵
  2. 會話ID創建並返回給客戶端
  3. 地圖圖塊下載,下載網址如下:https://t0.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/0320?mkt=en-us&it=G,L&shading=hill&og=30&n=z&key=xxxxxxxxxJeOuGjaxxxxxxxxxxxxxxxxxxFc-Jxxxxxxxxxxxxxy_xxxxxx,(我用xxx代替了一些字符)。有趣的部分是,這個關鍵既不是我的冰淇淋密鑰,也不是我的會話ID。我猜它可能包含會話ID信息,儘管我不知道如何解讀它。
  4. 如果我移動周圍的地圖上,更多地磚將與上述網址類似的下載(與COMP/CH後的數差一些。這應該是地圖瓦片quadkey有)

那麼這是否意味着我們使用的是AJAXTileUsage而不是LoadStandardMap?如果是這樣,這將是偉大的,因爲我們的瓦片使用不會計入計費。我使用Bing Map試用密鑰進行了測試,但Bing Map門戶上的Bing Map使用報告似乎沒有記錄我的使用情況,即使已經過了幾天,所以我無法從中找出答案。

如果有人可以在這裏放一些燈,那將是非常感謝。

更新: 的方式,對上述地圖下載網址,我可以下載地圖瓦片沒有任何鍵:如https://t2.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/xxxx?mkt=en-us&it=G,L&shading=hill&og=30&n=z(我改變了那裏的quadkey)

更新2: 從後:http://www.bing.com/blogs/site_blogs/b/maps/archive/2012/02/01/bing-maps-reporting-tips.aspx

Many of the Bing Maps API’s have a method for getting the credentials from the map after you 
have loaded it using a valid Bing Maps key. One often overlooked feature is that, by getting the 
credentials from the map, you do not get back your original Bing Maps key. Instead, you get a 
special session key which you can use as a Bing Maps key to make requests to the Bing Maps 
services. By doing this, all transactions occurred by this session key will be non-billable. 
Many developers overlook this feature and opt to simply use their original Bing Maps key, not 
knowing that they are actually incurring more billable transactions than they need to 

因此,根據上述信息,下載地圖塊的神祕鑰匙應該是會話密鑰。

回答

2

如果您使用的是Bing Maps V7 JavaScript控件之一,則所有圖塊均在AJAXTileUsage類別下進行計數。瓦片使用費的唯一時間是直接訪問或者您使用的是舊地圖控件之一。

Bing地圖門戶中的報告需要幾天到一週的時間才能同步服務器/數據中心/用戶/和生成的事務。