这篇文章上次修改于 860 天前,可能其部分内容已经发生变化,如有疑问可询问作者。

leaflet 在有些 Chrome 上瓦片间有一条白线

在银河麒麟 arm64 系统上使用 Electron 9.3.4 版本时遇到了此问题,原因不详,github 上很多人都遇到类似问题,而且在 SafariFirefoxChrome 上均有出现。解决办法如下:

.leaflet-tile-container img {
  width: 256.5px !important;
  height:256.5px !important;
}

以上解决办法由 https://github.com/Leaflet/Leaflet/issues/3575#issuecomment-688644225 提供。

Electron 环境信息:

{
  node: '12.14.1',
  v8: '8.3.110.13-electron.0',
  uv: '1.33.1',
  zlib: '1.2.11',
  brotli: '1.0.7',
  ares: '1.15.0',
  modules: '80',
  nghttp2: '1.40.0',
  napi: '5',
  llhttp: '2.0.1',
  http_parser: '2.8.0',
  openssl: '1.1.0',
  icu: '65.1',
  unicode: '12.1',
  electron: '9.3.4',
  chrome: '83.0.4103.122'
}