<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String basePath = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="../../../common/admin/head.jsp"></jsp:include>
    <link  rel="stylesheet" type="text/css" href="<%=basePath%>/resource/css/admin/home/index.css">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        body, html {width: 100%;height: 100%;margin:0;font-family:"微软雅黑";}
        #allmap{width:100%;height:500px;}
    </style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=RleRpI1DQegNo17XGsVvUUS1e3oiubUG"></script>

</head>
<body>
<jsp:include page="../../../common/admin/body_pre.jsp"></jsp:include>
<div class="row hidden-print">
    <div class="col-lg-12">
        <div class="ibox">
            <div class="ibox-title">
                <h2>城市运行监测预警</h2>
                <ol class="breadcrumb">
                    <li>
                        <a href="javascript:void(0);" >城市资产</a>
                    </li>
                    <li class="active">
                        <strong>公共设施</strong>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>
<%--////////////////--%>

<div class="row hidden-print">
    <div style="position: absolute;z-index: 999; font-weight: bold;font-size: 20px;background: #fff;left:26px"></div>
    <div class="col-lg-12 col-md-12">
        <div class="ibox shortcut">
            <div id="divChart5" style="width: 100%;height: 600px;"></div>
        </div>
    </div>
</div>
<jsp:include page="../../../common/admin/body_post.jsp"></jsp:include>
<script type="text/javascript" src="<%=basePath%>/resource/plugins/echarts/echarts-liquidfill.js"></script>
</body>
<script type="text/javascript">
    map = new BMap.Map("divChart5");
    map.centerAndZoom(new BMap.Point(115.675402, 37.745191), 15);
    $.get('<%=basePath%>/admin/facilities/getPublish.action',function(result){
        normalArray=result.data.array;
        for (var i = 0; i < normalArray.length; i++) {
            var vectorMarker = new BMap.Marker(new BMap.Point(normalArray[i].longitude,normalArray[i].latitude),{
                // 指定Marker的icon属性为Symbol
                icon: new BMap.Symbol(BMap_Symbol_SHAPE_POINT, {
                    scale: 1,//图标缩放大小
                    fillColor: "green",//填充颜色
                    fillOpacity: 0.8//填充透明度
                })
            });
            var content = "名称："+normalArray[i].name+"<br/>面积："+ normalArray[i].acreage+"<br/>绿化率："+normalArray[i].greeningRate;
            map.addOverlay(vectorMarker);
            addClickHandler(content,vectorMarker);
        }
        var opts = {
            width : 250,     // 信息窗口宽度
            height: 80,     // 信息窗口高度
           title : "详细信息" , // 信息窗口标题
            enableMessage:true//设置允许信息窗发送短息
        };

        function addClickHandler(content,marker){
            marker.addEventListener("click",function(e){
                openInfo(content,e)}
            );
        }
        function openInfo(content,e){
            var p = e.target;
            var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
            var infoWindow = new BMap.InfoWindow(content,opts);  // 创建信息窗口对象
            map.openInfoWindow(infoWindow,point); //开启信息窗口
        }
        //vectorMarker.show();
    });

</script>
</html>

