|
@@ -1,7 +1,10 @@
|
|
|
<!DOCTYPE html>
|
|
|
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
|
|
+<!--<html lang="en" xmlns:th="http://www.thymeleaf.org">-->
|
|
|
+<html xmlns:th="http://www.w3.org/1999/xhtml">
|
|
|
<head>
|
|
|
<th:block th:include="include :: header('【事件信息(历史火情)】列表')" />
|
|
|
+ <script th:src="@{/visualization/superMap/examples/js/include-web.js}"></script>
|
|
|
+
|
|
|
</head>
|
|
|
<body class="gray-bg">
|
|
|
<div class="container-div">
|
|
@@ -46,6 +49,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<th:block th:include="include :: footer" />
|
|
|
+ <div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
|
|
|
+ <script type="text/javascript" src="../../../dist/leaflet/include-leaflet.js"></script>
|
|
|
<script th:inline="javascript">
|
|
|
|
|
|
function openDetailsDia(eventId){
|
|
@@ -440,5 +445,92 @@
|
|
|
$.modal.open("修改【火险管理】", url);
|
|
|
}
|
|
|
</script>
|
|
|
+
|
|
|
+
|
|
|
+ <script type="text/javascript">
|
|
|
+ var host = "http://218.27.1.157:8090";
|
|
|
+ var map, resultLayer,
|
|
|
+ url = "http://218.27.1.157:8090/iserver/services/map-SiPingLinYe4326/rest/maps/1%E6%9E%97%E5%9C%BA%E5%BD%B1%E5%83%8F";
|
|
|
+ map = L.map('map', {
|
|
|
+ preferCanvas: true,
|
|
|
+ crs: L.CRS.EPSG4326,
|
|
|
+ center: [43.15, 124.78],
|
|
|
+ maxZoom: 10,
|
|
|
+ zoom: 10
|
|
|
+ });
|
|
|
+ L.supermap.tiledMapLayer(url).addTo(map);
|
|
|
+ resultLayer = L.featureGroup().addTo(map);
|
|
|
+ //measureDistance();
|
|
|
+ var pointsArray = new Array();
|
|
|
+
|
|
|
+ function addMark() {
|
|
|
+ map.on("click",addMarkSuccess)
|
|
|
+ }
|
|
|
+
|
|
|
+ function offMark() {
|
|
|
+ if(pointsArray.length > 1){
|
|
|
+ var distanceLength = 0;
|
|
|
+ for (var i = 0; i < pointsArray.length - 1; i++) {
|
|
|
+ var polyLine = L.polyline([ pointsArray[i], pointsArray[i + 1] ], {color: "red"});
|
|
|
+ // resultLayer.addLayer(polyLine);
|
|
|
+ var distanceMeasureParam = new SuperMap.MeasureParameters(polyLine);
|
|
|
+ L.supermap.measureService(url).measureDistance(distanceMeasureParam, function (serviceResult) {
|
|
|
+ distanceLength += serviceResult.result.distance;
|
|
|
+ $("#distanceLength").html(distanceLength + distanceLength + resources.msg_m);
|
|
|
+ // alert(i)
|
|
|
+ // alert(pointsArray.length)
|
|
|
+ // if(i === pointsArray.length - 2){//最后一个点上显示总长度
|
|
|
+ // alert(distanceLength)
|
|
|
+ // var content = resources.text_distance + ":" + distanceLength + resources.msg_m;
|
|
|
+ // markerFinal.bindPopup(content).openPopup(markerFinal.getLatLng());
|
|
|
+ // }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ pointsArray = new Array();
|
|
|
+ map.off("click");
|
|
|
+ }
|
|
|
+ function addMarkSuccess(e) {
|
|
|
+ pointsArray.push([e.latlng.lat,e.latlng.lng]);
|
|
|
+ if(pointsArray.length > 1){
|
|
|
+ var polyLine = L.polyline([ pointsArray[pointsArray.length-2],[e.latlng.lat,e.latlng.lng] ], {color: "red"});
|
|
|
+ resultLayer.addLayer(polyLine);
|
|
|
+ var distanceMeasureParam = new SuperMap.MeasureParameters(polyLine);
|
|
|
+ L.supermap.measureService(url).measureDistance(distanceMeasureParam, function (serviceResult) {
|
|
|
+ var marker = L.marker([e.latlng.lat,e.latlng.lng]);
|
|
|
+ resultLayer.addLayer(marker);
|
|
|
+ var content = resources.text_distance + ":" + serviceResult.result.distance + resources.msg_m;
|
|
|
+ marker.bindPopup(content).openPopup(marker.getLatLng());
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ var marker = L.marker([e.latlng.lat,e.latlng.lng]);
|
|
|
+ resultLayer.addLayer(marker);
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(e.latlng.lat,e.latlng.lng)
|
|
|
+ //markerFinal = marker;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ function measureDistance(lon,lat) {
|
|
|
+ var polyLine = L.polyline([ [43.15,124.78], [43.15,124.79] ], {color: "red"});
|
|
|
+ var marker1 = L.marker([43.15,124.78]);
|
|
|
+ var marker2 = L.marker([43.15,124.79]);
|
|
|
+ resultLayer.addLayer(polyLine);
|
|
|
+ resultLayer.addLayer(marker1);
|
|
|
+ resultLayer.addLayer(marker2);
|
|
|
+ var distanceMeasureParam = new SuperMap.MeasureParameters(polyLine);
|
|
|
+ L.supermap
|
|
|
+ .measureService(url)
|
|
|
+ .measureDistance(distanceMeasureParam, function (serviceResult) {
|
|
|
+ var content = resources.text_distance + ":" + serviceResult.result.distance + resources.msg_m;
|
|
|
+ marker1.bindPopup(content).openPopup(marker1.getLatLng());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+
|
|
|
</body>
|
|
|
</html>
|