如何在弹出窗口中隐藏尾三角形 [英] how can I hide tail triangle on popup

查看:139
本文介绍了如何在弹出窗口中隐藏尾三角形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

图片http://pasteio.com/m26f642c81452a5bf67cfc5f0b0f2390c

我正在使用传单来渲染mapbox地图.标记的顶部有一个小三角形;我怎么藏起来?

I'm using leaflet to render the mapbox map. There is small triangle on the top of marker; how can I hide it?

推荐答案

此三角形由css中的.leaflet-popup-tip类控制.如果您使用的是标准Leaflet,则应该可以通过在CSS中添加以下内容来隐藏笔尖(在加载leaflet.css之后):

This triangle is controlled by the .leaflet-popup-tip class in css. If you are using standard Leaflet, you should be able to hide the tip by adding the following to your css (after leaflet.css is loaded):

.leaflet-popup-tip {
    width: 0px;
    height: 0px;
  }

Mapbox实际上通过创建元素边框而不是元素内容的样式来创建与标准Leaflet稍有不同的方式,因此,如果您使用的是mapbox.js,则应该可以通过添加以下内容(在mapbox.css已加载):

Mapbox actually creates the tip in a slightly different way from standard Leaflet, by styling the element border rather than the element content, so if you are using mapbox.js, you should be able to do it by adding the following (after mapbox.css is loaded):

.leaflet-popup-tip {
    border: 0px;
  }

这篇关于如何在弹出窗口中隐藏尾三角形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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