gpt4 book ai didi

javascript - map 上元素的 Bootstrap 和 map 设计

转载 作者:太空宇宙 更新时间:2023-11-04 13:53:19 26 4
gpt4 key购买 nike

我正在使用 Bootstrap 和 map API。 Map Api 使用 %100 高度。我想在 map 上显示带有 Bootstrap 的创建元素。 Jsfiddle在这里。

我想这样显示。

enter image description here

最佳答案

您必须用另一个 div 包装您的 ma​​pDiv,使“包装器”和“面板”绝对这样您的面板就可以在 map 上方飞行,您可以将面板的位置设置为顶部、左侧、底部或右侧。

wrapperMap:

<div class="wrapperMap">
<div id="mapDiv"></div>
</div>

<div id="fly" class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">Layers Not Found</h3>
</div>
<div class="panel-body">Sorry, I could not list layers!</div>
</div>

CSS:

#fly {
position: absolute;
clear: none;
left: 20%;
}
.wrapperMap {
height: 100%;
width: 100%;
position: absolute;
clear: none;
}

看看这个JS Fiddle

关于javascript - map 上元素的 Bootstrap 和 map 设计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22063737/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com