簡體   English   中英

通過HTTPS的Leaflet.js Tile

[英]Leaflet.js Tiles over HTTPS

我正在嘗試在具有SSL的服務器上運行leaflet.js,但獲取文件錯誤類似於以下內容:

GET https://tile.openstreetmap.org/12/1213/1481.png net::ERR_INSECURE_RESPONSE

Github上有一個封閉的問題 ,據說可以通過更改請求來解決

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
  attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'      
}).addTo(map);

但是,即使我嘗試導航到鏈接https://tile.openstreetmap.org/12/1213/1481.png,我也會收到一條錯誤消息,指出“ NET :: ERR_CERT_COMMON_NAME_INVALID”。

有人找到解決方案了嗎?

謝謝!

嘗試以這種形式的鏈接https://a.tile.openstreetmap.org/{z}/{x}/{y}.png此處提到的F1LT3Rhttps : //github.com/Leaflet/Leaflet/issues / 3186

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM