<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Frm_BaiDu_grgj.aspx.cs" Inherits="Web.BBCX.Frm_BaiDu_grgj" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        body, html, #allmap
        {
            width: 100%;
            height: 100%;
            overflow: hidden;
            margin: 0;
        }
        #l-map
        {
            height: 100%;
            width: 78%;
            float: left;
            border-right: 2px solid #bcbcbc;
        }
        #r-result
        {
            height: 100%;
            width: 20%;
            float: left;
        }
    </style>
    <script type="text/javascript">
        var map = new BMap.Map("allmap");
        var arralls = "<%=arrall %>";
        var arrgps = arralls.split("#");
        for (var j = 0; j < arrgps.length; j++) {
            var arrgpsname = arrgps[j].split("*");
            for (var k = 0; k < arrgpsname.length; k++) {
                var arrall = arrgpsname[0].split("|");
                var arr0 = arrall[0].split(",");
                var point = new BMap.Point(arr0[0], arr0[1]);
                map.centerAndZoom(point, 10);
                var PointArr = [];
                for (var i = 0; i < arrall.length; i++) {
                    var arrsin = arrall[i].split(",");
                    PointArr.push(new BMap.Point(arrsin[0], arrsin[1]));

                    //转折点画点
                    var point = new BMap.Point(arrsin[0], arrsin[1]);
                    map.centerAndZoom(point, 15);
                    // 编写自定义函数,创建标注
                    function addMarker(point) {
                        var marker = new BMap.Marker(point);
                        map.addOverlay(marker);
                    }

                    var polyline = new BMap.Polyline(
    PointArr, { strokeColor: "blue", strokeWeight: 4, strokeOpacity: 0.5 });
                    map.addOverlay(polyline);
                    map.addControl(new BMap.NavigationControl());
                    map.addControl(new BMap.ScaleControl());
                    map.addControl(new BMap.OverviewMapControl());
                    map.addControl(new BMap.MapTypeControl());
                    map.enableScrollWheelZoom();
                    var marker1 = new BMap.Marker(point);
                    map.addOverlay(marker1);
                    //           时间
                    var label = new BMap.Label(arrgpsname[1] + arrsin[2], { offset: new BMap.Size(20, -10) });
                    marker1.setLabel(label);
                    var infoWindow1 = new BMap.InfoWindow(arrgpsname[1] + arrsin[2]);

                }
            }
        }
</script>
</head>
<body>
<div id="allmap">
    </div>
</body>
</html>
