btxtgxq-system-city/src/main/resources/static/route/specialreportcase/map-case-mark.html
2024-01-19 16:36:17 +08:00

78 lines
4.0 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<base href="/servicecity/">
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" type="text/css" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" type="text/css" href="assets/js/vendor/bootstrap/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="assets/css/minimal.css"/>
<link rel="stylesheet" type="text/css" href="assets/css/system.css"/>
<link rel="stylesheet" type="text/css" href="assets/css/menu.css"/>
<link rel="stylesheet" type="text/css" href="assets/css/system-style1.css"/>
</head>
<body>
<div id="content" class="edit-content" style="padding: 0px;">
<div id="mapContainer" style="width:100%;height:520px;border:1px solid silver;"></div>
</div>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=pFMM3KjMlPlpzEGTXwB5vdj6cDCfB6Py"></script>
<script type="text/javascript" src="assets/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="assets/js/vendor/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/js/vue.min.js"></script>
<script type="text/javascript" src="assets/js/common.js"></script>
<script type="text/javascript">
new Vue({
el: '#content',
data: {
reportCaseId: top.restAjax.params(window.location.href).reportCaseId,
markPoint: {
caseLongitude: null,
caseLatitude: null,
casePosition: null
}
},
watch: {},
methods: {
initData: function() {
var self = this;
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/specialreportcase/getspecialeeportcase/{reportCaseId}', [self.reportCaseId]), {}, null, function(code, data) {
self.markPoint.caseLongitude = data.caseLongitude;
self.markPoint.caseLatitude = data.caseLatitude;
self.markPoint.casePosition = data.casePosition;
self.$nextTick(function() {
self.initMap();
});
}, function(code, data) {
top.DialogBox.msg(data.msg);
}, function() {
loadLayerIndex = top.DialogBox.msg(TextMessage.loading, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.DialogBox.close(loadLayerIndex);
});
},
mapMarkPoint: function(map, point) {
var marker = new BMap.Marker(point);
map.addOverlay(marker);
},
initMap: function() {
var self = this;
var map = new BMap.Map('mapContainer', {enableMapClick: false});
var point = new BMap.Point(self.markPoint.caseLongitude, self.markPoint.caseLatitude);
self.mapMarkPoint(map, point);
map.centerAndZoom(point, 15);
map.enableScrollWheelZoom();
map.addControl(new BMap.NavigationControl());
map.addControl(new BMap.ScaleControl());
map.addControl(new BMap.OverviewMapControl());
}
},
mounted: function() {
var self = this;
self.initData();
}
});
</script>
</body>
</html>