[BUG]: Access blocked to OpenStreetMaps raster tiles when saving the graph as .html file

未關閉
#5,798 7 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 3 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
javascript, python
領域
frontend, web-dev

研究方向

Start by comparing the generated output from write_html() with the behavior of show() and write_image() for the supplied Scattermap example using open-street-map. The issue does not name relevant source files or tests, so first trace how HTML export handles raster map tiles. Done means the saved HTML displays tiles without the OpenStreetMap access-blocked error.

由索引模型根據 Issue 內容生成。

描述

bug P3 size: 1
Description

When the scatter map is generated with the style set to open-street-map and then saved as an .html file the tiles are replaced with the error image with the text "403 Access blocked. App is not following the tile usage policy of OpenStreetMap's volunteer-run servers: osm.wiki/Blocked".

This happens when the write_html() method is called, but not when the write_image() method is called or the show() method is called in a Jupyter notebook.

This is different from the https://github.com/plotly/plotly.py/issues/5562 since that issue only concerns write_image() method.

Screenshots/Video
Image
Steps to reproduce
import plotly.graph_objects as go

lat = 41.580472
lon = -1.1161953

fig = go.Figure(go.Scattermap(
    lat=[lat],
    lon=[lon],
    mode='markers',
    marker=dict(symbol="circle", size=30)
))
fig.update_layout(
    map=dict(
        style="open-street-map",
        center=dict(lat=lat, lon=lon),
        zoom=16
    ),
    margin={"r": 0, "t": 0, "l": 0, "b": 0} 
)
# returns correct raster tiles
fig.write_image('1.png')
# returns error tiles
fig.write_html('1.html')

Notes

plotly version: 7.1.0

主要語言
Python
星號
18.9k
分支
2.9k
平均合併
1 天 22 小時
30 天內合併 PR
12

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

plotly/plotly.py 的其他 Issue

查看 plotly/plotly.py 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。