Commit 079d3a90 by hanjixin

map

parent 2fcd2bf2
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
ENV = 'development' ENV = 'development'
# base api # base api
#VUE_APP_BASE_API = 'http://172.16.4.63:8090' # VUE_APP_BASE_API = 'http://172.16.4.63:8090'
VUE_APP_BASE_API = 'http://123.56.149.208:8090' # VUE_APP_BASE_API = 'http://123.56.149.208:8090'
VUE_APP_BASE_API = 'http://172.16.2.186:8090'
VUE_APP_BASE_API_MOCK = '/dev-api' VUE_APP_BASE_API_MOCK = '/dev-api'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
......
...@@ -29,9 +29,8 @@ export default [ ...@@ -29,9 +29,8 @@ export default [
url: '/publics/login', url: '/publics/login',
type: 'post', type: 'post',
response: config => { response: config => {
const { username } = config.body const { userName } = config.body
const token = tokens[username] const token = tokens[userName]
// mock error // mock error
if (!token) { if (!token) {
return { return {
...@@ -39,7 +38,6 @@ export default [ ...@@ -39,7 +38,6 @@ export default [
message: 'Account and password are incorrect.' message: 'Account and password are incorrect.'
} }
} }
return { return {
code: 20000, code: 20000,
data: token data: token
......
...@@ -28,6 +28,7 @@ import * as filters from './filters' // global filters ...@@ -28,6 +28,7 @@ import * as filters from './filters' // global filters
* please remove it before going online! ! ! * please remove it before going online! ! !
*/ */
// import { mockXHR } from '../mock' // import { mockXHR } from '../mock'
// mockXHR()
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
// mockXHR() // mockXHR()
} }
......
...@@ -14,7 +14,6 @@ const service = axios.create({ ...@@ -14,7 +14,6 @@ const service = axios.create({
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
// do something before request is sent // do something before request is sent
if (store.getters.token) { if (store.getters.token) {
// let each request carry token // let each request carry token
// ['X-Token'] is a custom headers key // ['X-Token'] is a custom headers key
......
...@@ -170,3 +170,8 @@ body, ...@@ -170,3 +170,8 @@ body,
width: 40%; width: 40%;
float: left; float: left;
} }
.hide{
display: none;
opacity: 0;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta
name="viewport"
content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=0"
/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MAP</title>
<link rel="stylesheet" href="css/main.css" />
<style></style>
</head>
<body>
<div id="container"></div>
<!-- <div id="nav">
<div class="item" onclick="go(0)">
<span class="icon icon1"></span>预警信息
</div>
<div class="item" onclick="go(1)">
<span class="icon icon2"></span>设备
</div>
<div class="subnav subnav1">
<div class="" onclick="go(1,0)">大喇叭</div>
<div onclick="go(1,1)">显示屏</div>
<div onclick="go(1,2)">北斗</div>
</div>
<div class="item" onclick="go(2)">
<span class="icon icon3"></span>人员
</div>
<div class="subnav subnav2">
<div onclick="go(2,0)">信息员</div>
<div onclick="go(2,1)">应急责任人</div>
</div>
</div> -->
<script src="https://cache.amap.com/lbs/static/es5.min.js"></script>
<!-- <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script> -->
<script src="./js/jq.js"></script>
<script src="./js/api.js"></script>
<script src="https://webapi.amap.com/maps?v=1.4.15&key=ee7327615de4d673c4e455a772da45fd&plugin=Map3D,AMap.DistrictSearch,ElasticMarker,AMap.MarkerClusterer"></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<style>
.amap-logo,
.amap-copyright {
opacity: 0;
display: none !important;
}
</style>
<script src="./js/tools.js"></script>
<script src="./js/Map3D.js"></script>
<script language="javascript">
// <script language=javascript type=module>
//http://106.120.82.243:8080/qxyj/pageHtml/login.html wis 12379
// import { Map3D } from './js/Map3D.js';
// import { GetParams } from './js/tools.js';
window.urlParams = GetParams();
//成都 重庆 天津 北京 上海 大连 三沙 湖北 中国
//350200
//350500
//320300 370100
window.map3d = new Map3D(
urlParams.adcode || "610000" || "成都",
"container",
urlParams,
_map3d => {
go(0);
}
);
window.review = function(params) {
map3d.review();
};
window.delPoi = function(params) {
try {
map3d.map.clearInfoWindow();
map3d.delPoi(pois);
map3d.map.remove(pois);
map3d.cluster.clearMarkers();
if(params)window.pois = [];
} catch (error) {}
};
window.addPoiByApi = function(api, type, type1) {
console.log(api);
window.delPoi(1);
// window.review();
$.get(api).then(res => {
var currentDetailList = res.data;
console.log(currentDetailList);
if (type1 == "MassMarks") {
window.delPoi(0);
map3d
.addPoisMassMarks(currentDetailList, type)
.then(res => (window.pois = res,console.log(1)));
} else if (type1 == "Single") {
window.delPoi(0);
map3d
.addPoisSingle(currentDetailList, type)
.then(res => (window.pois = res,console.log(1)));
} else {
window.delPoi(0);
map3d
.addPoisMarkerClusterer(currentDetailList, type)
.then(res => (window.pois = res,console.log(1)));
}
});
};
</script>
<script>
var oldi1 = 0,
oldi2 = 0;
function popclose() {
console.log("popclose");
map3d.map.clearInfoWindow();
}
function go(i1, i2) {
console.log(oldi1, oldi2);
console.log(i1, i2);
if (i1 == oldi1 && i2 == oldi2) {
return false;
}
$(".item")
.removeClass("active")
.removeClass("text-shadow");
$(".item")
.eq(i1)
.addClass("active text-shadow");
$(".subnav").hide();
$(".subnav" + i1).show();
$(".subnav" + i1)
.find("div")
.removeClass("active")
.removeClass("text-shadow");
if (typeof i2 != "undefined") {
$(".subnav" + i1)
.find("div")
.eq(i2)
.addClass("active text-shadow");
}
if (i1 == 0 && typeof i2 == "undefined") {
//预警信息
addPoiByApi(
"http://123.56.149.208:8091/external/get/early/warn/city/two/list/" +
urlParams.adcode,
"setWarnPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 1 && i2 == 0) {
//大喇叭
addPoiByApi(
`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=1`,
"setEquipmentPoint",
"Cluster"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 1 && i2 == 1) {
//显示屏
addPoiByApi(
`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=2`,
"setEquipmentPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 1 && i2 == 2) {
//北斗
addPoiByApi(
`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=3`,
"setEquipmentPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 2 && i2 == 0) {
//信息员
addPoiByApi(
"http://123.56.149.208:8091/external/get/early/warn/people/two/info/" +
urlParams.adcode,
"setPersonalPoint",
"Cluster"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 2 && i2 == 1) {
//应急责任人
addPoiByApi(
"http://123.56.149.208:8091/external/get/early/warn/people/two/principal/" +
urlParams.adcode,
"setPrincipalPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
}
}
// go(i1,i2)
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta
name="viewport"
content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=0"
/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MAP</title>
<link rel="stylesheet" href="css/main.css?123" />
<style></style>
</head>
<body>
<div id="container"></div>
<div id="nav">
<div class="item hide" onclick="go(0)">
<span class="icon icon1"></span>预警信息
</div>
<div class="item" onclick="go(1)">
<span class="icon icon2"></span>设备
</div>
<div class="subnav subnav1">
<div class="" onclick="go(1,0)">大喇叭</div>
<div onclick="go(1,1)">显示屏</div>
<div onclick="go(1,2)">北斗</div>
</div>
<div class="item" onclick="go(2)">
<span class="icon icon3"></span>人员
</div>
<div class="subnav subnav2">
<div onclick="go(2,0)">信息员</div>
<div onclick="go(2,1)">应急责任人</div>
</div>
</div>
<script src="https://cache.amap.com/lbs/static/es5.min.js"></script>
<!-- <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script> -->
<script src="./js/jq.js"></script>
<script src="./js/api.js"></script>
<script src="https://webapi.amap.com/maps?v=1.4.15&key=ee7327615de4d673c4e455a772da45fd&plugin=Map3D,AMap.DistrictSearch,ElasticMarker,AMap.MarkerClusterer"></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<style>
.amap-logo,
.amap-copyright {
opacity: 0;
display: none !important;
}
</style>
<script src="./js/tools.js"></script>
<script src="./js/Map3D.js"></script>
<script language="javascript">
// <script language=javascript type=module>
//http://106.120.82.243:8080/qxyj/pageHtml/login.html wis 12379
// import { Map3D } from './js/Map3D.js';
// import { GetParams } from './js/tools.js';
window.urlParams = GetParams();
//成都 重庆 天津 北京 上海 大连 三沙 湖北 中国
//350200
//350500
//320300 370100
window.map3d = new Map3D(
urlParams.adcode || "610000" || "成都",
"container",
urlParams,
_map3d => {
go(1,0)
}
);
window.review = function(params) {
map3d.review();
};
window.delPoi = function(params) {
try {
map3d.map.clearInfoWindow();
map3d.delPoi(pois);
map3d.map.remove(pois);
map3d.cluster.clearMarkers();
if(params)window.pois = [];
} catch (error) {}
};
window.addPoiByApi = function(api, type, type1) {
console.log(api);
window.delPoi(1);
// window.review();
$.get(api).then(res => {
var currentDetailList = res.data;
console.log(currentDetailList);
if (type1 == "MassMarks") {
window.delPoi(0);
map3d
.addPoisMassMarks(currentDetailList, type)
.then(res => (window.pois = res,console.log(1)));
} else if (type1 == "Single") {
window.delPoi(0);
map3d
.addPoisSingle(currentDetailList, type)
.then(res => (window.pois = res,console.log(1)));
} else {
window.delPoi(0);
map3d
.addPoisMarkerClusterer(currentDetailList, type)
.then(res => (window.pois = res,console.log(1)));
}
});
};
</script>
<script>
var oldi1 = 0,
oldi2 = 0;
function popclose() {
console.log("popclose");
map3d.map.clearInfoWindow();
}
function go(i1, i2) {
console.log(oldi1, oldi2);
console.log(i1, i2);
if (i1 == oldi1 && i2 == oldi2) {
return false;
}
$(".item")
.removeClass("active")
.removeClass("text-shadow");
$(".item")
.eq(i1)
.addClass("active text-shadow");
$(".subnav").hide();
$(".subnav" + i1).show();
$(".subnav" + i1)
.find("div")
.removeClass("active")
.removeClass("text-shadow");
if (typeof i2 != "undefined") {
$(".subnav" + i1)
.find("div")
.eq(i2)
.addClass("active text-shadow");
}
if (i1 == 0 && typeof i2 == "undefined") {
//预警信息
addPoiByApi(
"http://123.56.149.208:8091/external/get/early/warn/city/two/list/" +
urlParams.adcode,
"setWarnPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 1 && i2 == 0) {
//大喇叭
addPoiByApi(
`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=1`,
"setEquipmentPoint",
"Cluster"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 1 && i2 == 1) {
//显示屏
addPoiByApi(
`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=2`,
"setEquipmentPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 1 && i2 == 2) {
//北斗
addPoiByApi(
`http://123.56.149.208:8091/external/get/early/warn/equipment/two?code=${urlParams.adcode}&clientStyle=3`,
"setEquipmentPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 2 && i2 == 0) {
//信息员
addPoiByApi(
"http://123.56.149.208:8091/external/get/early/warn/people/two/info/" +
urlParams.adcode,
"setPersonalPoint",
"Cluster"
);
(oldi1 = i1), (oldi2 = i2);
}
if (i1 == 2 && i2 == 1) {
//应急责任人
addPoiByApi(
"http://123.56.149.208:8091/external/get/early/warn/people/two/principal/" +
urlParams.adcode,
"setPrincipalPoint",
"Single"
);
(oldi1 = i1), (oldi2 = i2);
}
}
// go(i1,i2)
</script>
</body>
</html>
...@@ -65,6 +65,7 @@ class Map3D { ...@@ -65,6 +65,7 @@ class Map3D {
} }
async addPoisSingle(pois, poiFnStr) { async addPoisSingle(pois, poiFnStr) {
debugger
let markers = [] let markers = []
pois.map(item => { pois.map(item => {
markers.push(this[poiFnStr](item)) markers.push(this[poiFnStr](item))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment