1、Popup标注
Popup标注,即通过冒泡的方式显示标注点的信息,一般与基本的标注点一起使用,而且可以结合HTML、CSS等样式自定义标注信息样式,在弹出框中描述详细点的信息;
2、代码实现
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="../css/ol.css" rel="stylesheet" />
<script src="../lib/jquery/jquery.js"></script>
<script src="../lib/ol/ol.js"></script>
<style type="text/css">
body, html
{
border:none;
padding:0;
margin:0;
}
#menu
{
width:100%;
height:20px;
padding:5px 10px;
font-size:14px;
font-family:"微软雅黑";
left:10px;
}
.ol-popup
{
position:absolute;
background-color:white;
padding:15px;
border-radius:10px;
border:1px solid #cccccc;
bottom:12px;
left:-50px;
}
.ol-popup:after,.ol-popup:before
{
top:100%;
border:solid transparent;
content:" ";
height:0px;
width:0px;
position:absolute;
pointer-events:none;
}
.ol-popup:after
{
border-top-color:white;
border-width:10px;
left:48px;
margin-left:-10px;
}
.ol-popup:before
{
border-top-color:#cccccc;
border-width:11px;
left: 48px;
left:-11px;
}
.ol-popup-closer
{
text-decoration:none;
position:absolute;
top:2px;
right:8px;
}
#popup-content
{
font-size:14px;
font-family:"微软雅黑";
}