1. 程式人生 > 其它 >應急指揮中心繫統的研究與設計

應急指揮中心繫統的研究與設計

通過GIS與虛擬模擬技術,對園區內企業生產設施、市政消防設施、公共管廊等進行三維建模,真實還原園區整體環境。以三維場景為依託,以智慧化工園區平臺為核心,融合多個應用系統的資料,實現化工園區智慧化管理。對園區內企業安全生產資料,環保監測,交通運輸,車輛管理等資料進行綜合展示,為園區管理部門對園區內突發事件的應急指揮,以及園區內環保監測管理,交通管理等提供強有力的資訊保障。

  安全環保一張圖

  以園區安全、環保、視訊監控為主要內容,對園區企業資訊、重大危險源監控資料、危險源報警資訊、環保監測資料、視訊監控等內容進行集中管理和展示。

  交通運輸一張圖

  以園區交通和物流資訊為主要內容,對園區內危化品車輛實時定位和軌跡、電子運單資訊、船舶定位和資訊、園區車輛統計、園區企業危化品裝車統計等內容進行集中展示。


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title data-i18n="resources.title_heatGridMapLayer"></title>
<script type="text/javascript" include="bootstrap,widgets.alert" src="../js/include-web.js"></script>
<script type="text/javascript" exclude="iclient-classic" src="../../dist/classic/include-classic.js"></script>
<style type="text/css">
        body {
            margin: 0;
            overflow: hidden;
            background: #fff;
            width: 100%;
            height: 100%
        }

        #map {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        #toolbar {
            position: absolute;
            top: 50px;
            right: 10px;
            width: 300px;
            text-align: center;
            z-index: 100;
            border-radius: 4px;
        }
    </style>
</head>
<body>
<div id="map"></div>
<script>
    var map, layer, heatGridLayer, selectGrid, infowin;
    //定義網格的styles
    var items = [
        {
            start: 0,
            end: 2,
            style: {
                strokeColor: "#C69944",
                strokeWidth: 1,
                fillColor: "#B8E4B8",
                fillOpacity: 0.5
            }
        },
        {
            start: 2,
            end: 4,
            style: {
                strokeColor: "#C69944",
                strokeWidth: 1,
                fillColor: "#66dd66",
                fillOpacity: 0.5
            }
        },
        {
            start: 4,
            end: 6,
            style: {
                strokeColor: "#C69944",
                strokeWidth: 1,
                fillColor: "#00ee00",
                fillOpacity: 0.5
            }
        },
        {
            start: 6,
            end: 8,
            style: {
                strokeColor: "#C69944",
                strokeWidth: 1,
                fillColor: "#008800",
                fillOpacity: 0.5
            }
        },
        {
            start: 8,
            end: 10,
            style: {
                strokeColor: "#C69944",
                strokeWidth: 1,
                fillColor: "#df8505",
                fillOpacity: 0.5
            }
        },
        {
            start: 10,
            end: 12,
            style: {
                strokeColor: "#C69944",
                strokeWidth: 1,
                fillColor: "#CC9933",
                fillOpacity: 0.5
            }
        },
        {
            start: 12,
            end: 16,
            style: {
                strokeColor: "#C69944",
                strokeWidth: 1,
                fillColor: "#FF0000",
                fillOpacity: 0.5
            }
        }
    ];
    var host = window.isLocal ? window.server : "https://iserver.supermap.io";
    var url = host + "/iserver/services/map-world/rest/maps/World";
    //初始化
    init();

    function init() {
        map = new SuperMap.Map("map", {
            controls: [
                new SuperMap.Control.ScaleLine(),
                new SuperMap.Control.Zoom(),
                new SuperMap.Control.LayerSwitcher(),
                new SuperMap.Control.Navigation({
                    dragPanOptions: {
                        enableKinetic: true
                    }
                })]
        });
        map.addControl(new SuperMap.Control.MousePosition());
        layer = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, {
            transparent: true,
            cacheEnabled: true
        }, {maxResolution: "auto"});
        //建立熱點網格圖
        heatGridLayer = new SuperMap.Layer.HeatGridLayer("heatGrid");
        layer.events.on({"layerInitialized": addLayer});
    }

    //新增圖層、註冊事件、啟用格網選擇控制元件
    function addLayer() {
        map.addLayers([layer, heatGridLayer]);
        map.setCenter(new SuperMap.LonLat(0, 0), 0);
        // 建立格網選擇控制元件
        var select = new SuperMap.Control.SelectGrid(heatGridLayer, {
            callbacks: {
                //點選feature事件
                clickFeature: function (f) {
                    closeInfoWin();
                    openInfoWin(f);
                },
                clickout: function () {
                    closeInfoWin();
                }
            }
        });
        map.events.on({
            "movestart": function () {
                closeInfoWin();
            }
        });
        map.addControl(select);
        select.activate();
        createHeatPoints();
    }

    //向伺服器傳送請求,獲取資料
    function createHeatPoints() {
        var points = [new SuperMap.Geometry.Point(-180, 90),
                new SuperMap.Geometry.Point(180, 90),
                new SuperMap.Geometry.Point(180, -90),
                new SuperMap.Geometry.Point(-180, -90)
            ],
            linearRings = new SuperMap.Geometry.LinearRing(points),
            region = new SuperMap.Geometry.Polygon([linearRings]);
        var queryParam, queryByGeometryParameters, queryService;
        //設定查詢資料集的查詢過濾引數
        queryParam = new SuperMap.REST.FilterParameter({name: "[email protected]"});
        //設定 Geometry查詢的相關引數
        queryByGeometryParameters = new SuperMap.REST.QueryByGeometryParameters({
            queryParams: [queryParam],
            geometry: region,
            spatialQueryMode: SuperMap.REST.SpatialQueryMode.INTERSECT
        });
        queryService = new SuperMap.REST.QueryByGeometryService(url, {
            eventListeners: {
                "processCompleted": processCompleted,
                "processFailed": processFailed
            }
        });
        queryService.processAsync(queryByGeometryParameters);


    }

    function processCompleted(queryEventArgs) {
        var i, j, result = queryEventArgs.result;
        var heatFeatures = [];
        if (result && result.recordsets) {
            for (i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
                if (recordsets[i].features) {
                    for (j = 0; j < recordsets[i].features.length; j++) {
                        var feature = recordsets[i].features[j];
                        var point = feature.geometry;
                        if (point.CLASS_NAME == SuperMap.Geometry.Point.prototype.CLASS_NAME) {

                            feature.attributes.temperature = parseInt(Math.random() * 45 * 10) / 10;
                            feature.style = {
                                pointRadius: 4,
                                graphic: true,
                                externalGraphic: "images/country.png",
                                graphicWidth: 6,
                                graphicHeight: 6
                            };
                            heatFeatures.push(feature);
                        }

                    }
                }
            }
        }
        //設定地圖在第4級的時候進行格網散開
        heatGridLayer.spreadZoom = 4;
        heatGridLayer.items = items;
        //設定label顯示的資料為欄位temperature的內容
        heatGridLayer.dataField = "temperature";
        heatGridLayer.addFeatures(heatFeatures);
    }

    function processFailed(e) {
        widgets.alert.showAlert(e.error.errorMsg,false);
    }

    //彈出資訊框
    function openInfoWin(feature) {
        var geo = feature.geometry;
        var bounds = geo.getBounds();
        var center = bounds.getCenterLonLat();
        var contentHTML = "<div style='font-size:.8em; opacity: 0.8; overflow-y:hidden;'>";
        contentHTML += "<div>" + "SmID:" + feature.data.SmID + "<br />" + resources.text_country + feature.data.COUNTRY + "<br />" + resources.text_capital + feature.data.CAPITAL + "</div></div>";

        var popup = new SuperMap.Popup.FramedCloud("popwin",
            new SuperMap.LonLat(center.lon, center.lat),
            null,
            contentHTML,
            null,
            true);

        feature.popup = popup;
        infowin = popup;
        map.addPopup(popup);
    }

    //關閉資訊框
    function closeInfoWin() {
        if (infowin) {
            try {
                infowin.hide();
                infowin.destroy();
            }
            catch (e) {
            }
        }
    }

</script>
</body>
</html>