Angular-Leaflet-Directive-在技术上渲染地图,但未显示任何图块的问题. [英] Angular-Leaflet-Directive - Issue where the map is technically rendering, but none of its tiles appear .

查看:168
本文介绍了Angular-Leaflet-Directive-在技术上渲染地图,但未显示任何图块的问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

. . .因为图块绝对位于高度为零的父容器中.

. . . because the tiles are absolutely positioned within parent containers whose heights are equal to zero.

这是指令: https://github.com/tombatossals/angular-leaflet-directive

由于我正在处理一个相对较小的图书馆,因此我不确定寻求帮助的适当渠道.我敢肯定我没有做错任何事情,因为带有地图缩放控件的灰色画布"正在呈现,并且地图的图块正在加载(但实际上并未显示).我可以通过为其父元素分配高度来强制显示拼贴,但显然这不是Leaflet应该起作用的方式.

I'm uncertain as to the appropriate channel by which to seek assistance since I'm dealing with a relatively small library. I'm pretty sure I'm not doing anything wrong, since the gray "canvas" with zoom controls for the map is rendering and the map's tiles are being loaded (but without actually being displayed). I can force the tiles to appear by assigning a height to their parent element, but obviously that's not how Leaflet is supposed to work.

我意识到这可能不是寻求此类帮助的最佳地点,所以我想知道是否有人(如果没有别的话)可能知道我最好地寻求帮助.

I realize this may not be the best place to ask for help on this sort of thing, so I'm wondering whether, if nothing else, someone might know how I might best go about seeking assistance.

推荐答案

我的CSS中的这个选择器就是问题所在:

This selector in my CSS was the problem:

img {
  max-height: 100%;
  max-width: 100%;
}

解决方案是简单地允许图像按照正常情况在传单地图的容器中进行渲染:

The solution was simply to allow images to render as they normally would within the leaflet map 's container:

.leaflet-container img {
  max-height: none;
  max-width: none;
}

这篇关于Angular-Leaflet-Directive-在技术上渲染地图,但未显示任何图块的问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆