我一直在關注如何在bing地圖Silverlight中使用疊加層的教程,他們似乎都沒有提到我的這個問題。教程BingMaps Silverlight不能使用httpou的tilesouce,只有https作品
實施例:https://alastaira.wordpress.com/2011/01/07/accessing-a-wms-tile-server-from-bing-maps-silverlight/
正在發生的事情是我的tilesource設置爲這樣的: 「http://wms1.ccgis.de/cgi-bin/mapserv?map=/data/umn/germany/germany.map&&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&SRS=EPSG%3A4326&BBOX= {0} & WIDTH = 256 & HEIGHT = 256個& LAYERS = Bundeslaender」
當我運行應用程序並檢查與提琴手的電話沒有一個單一的電話是對這項服務。如果我將源代碼更改爲以https開頭,則會在提琴手中看到調用。
我也試着旋轉了一個Web客戶端和http://google.com做一個GET請求和提琴手實際記錄到http://google.com/clientaccesspolicy.xml調用這似乎與它應該如何工作線。
我的網站根目錄中有以下xml文件。
ClientAccessPolicy.xml
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="SOAPAction">
<!-- IMPORTANT! Include these lines -->
<domain uri="https://*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
的crossdomain.xml
<cross-domain-policy>
<allow-access-from domain="*.*" headers="SOAPAction"/>
<allow-http-request-headers-from domain="*.*" headers="SOAPAction"/>
<site-control permitted-cross-domain-policies="master-only"/>
</cross-domain-policy>
人有什麼想法?它似乎像bingmaps SDK拒絕甚至嘗試一個http調用。
是的,它通過https託管,但如果這是真的,那麼爲什麼Web客戶端對象可以通過http發出請求?常規Bingmap引擎也通過http請求。 –
???如果.xap託管在https上,則不能。它只能在https上請求。如果您監控Bing地圖生成的流量,它應該切換到https以獲取數據,如果.xap託管在https – dotMorten
上嗯你是對的,在做了更多的測試之後,我確定我的成功歸功於我啓用了可信模式在我的電腦上,並在Silverlight 5項目屬性中設置它。我沒有意識到,這允許跨呼叫,但只有當你使用localhost調用它時。 –