Commit 10176464 authored by mahui's avatar mahui

111

parent 7e9cb9ac
/build/
/config/
/dist/
/*.js
/test/unit/coverage/
/* eslint-disable */
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
......@@ -13,8 +13,8 @@ module.exports = {
proxyTable: {},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
host: '192.168.1.162', // can be overwritten by process.env.HOST
port: 80, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
......
......@@ -3,8 +3,8 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>gongche</title>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=4R80wtlWhGSZFWH3yUHfqkuBjgMTnEzY"></script>
<title>监控</title>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=yu8L3gbGEjjy6VkqsUWE7slPnZoQ6npG"></script>
</head>
<body>
<div id="app"></div>
......
This diff is collapsed.
{
"name": "gongche",
"name": "monitor",
"version": "1.0.0",
"description": "gongche",
"description": "monitor",
"author": "urey",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
"build": "node build/build.js"
},
"dependencies": {
......@@ -37,7 +33,6 @@
"copy-webpack-plugin": "^4.0.1",
"cross-spawn": "^5.0.1",
"css-loader": "^0.28.0",
"eslint": "^4.15.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
......
......@@ -57,83 +57,75 @@
{label:'岛石镇',value:'岛石镇'},
{label:'清凉峰镇',value:'清凉峰镇'}
],
map_data:[
{
label:'青山-青罗线与岗阳街路口对角A2B4',
x:119.817653,
y:30.303568
},
map: undefined,
keywords: '',
all_data: [
],
search_data: [
{
label:'青山-青罗线与岗阳街路口对角A2B4',
longitude:119.817653,
latitude:30.303568
},
{
label:'青山-胜联路十字路口A1',
x:119.828229,
y:30.274509
longitude:119.828229,
latitude:30.274509
},
{
label:'青山-胜联路第三个叉路口路灯杆A1',
x:119.831894,
y:30.3048
longitude:119.831894,
latitude:30.3048
},
{
label:'青山-杭瑞高速与汪宫线路口A1',
x:119.87221,
y:30.251338
longitude:119.87221,
latitude:30.251338
},
{
label:'青山-华旺厂门口A1',
x:119.850356,
y:30.269257
longitude:119.850356,
latitude:30.269257
},
{
label:'青山-发达路与科技大道路灯杆A1',
x:119.842598,
y:30.262775,
longitude:119.842598,
latitude:30.262775,
},
],
map: undefined,
keywords: '',
all_data: [],
search_data: [],
data: {}
}
},
mounted() {
this.clearOverlays();
this.$nextTick(()=>{
this.clearOverlays();
})
},
methods: {
clearOverlays: function() {
let self = this;
clearOverlays() {
// 百度地图API功能
this.map = new BMap.Map("allmap");
var coordinate = new BMap.Point(119.352500, 30.234125); // 创建标注
let coordinate = new BMap.Point(119.352500, 30.234125); // 创建标注
this.map.centerAndZoom(coordinate, 11);
this.map.addControl(new BMap.NavigationControl()); // 添加平移缩放控件
this.map.addControl(new BMap.ScaleControl()); // 添加比例尺控件
this.map.addControl(new BMap.OverviewMapControl()); //添加缩略地图控件
this.map.enableScrollWheelZoom();
setTimeout(function() {
self.getBoundary(self.map, true, 0);
setTimeout(()=>{
this.getBoundary(this.map);
}, 2000);
},
key_input:function(val) {
this.search_data = [];
if (val != '') {
this.api('',val);
} else if (val == '') {
this.api(this.value,val);
}
},
mapShow: function(coordinate, item) {
mapShow(coordinate, item) {
let self = this;
var opts = {
let opts = {
position: coordinate, // 指定文本标注所在的地理位置
offset: new BMap.Size(5, -40) //设置文本偏移量
offset: new BMap.Size(5, 0) //设置文本偏移量
}
var label = new BMap.Label('<p>' + item.position + '</p>', opts); // 创建文本标注对象
let label = new BMap.Label('<p>' + item.label + '</p>', opts); // 创建文本标注对象
label.setStyle({
color: "#444",
fontSize: "12px",
height: "20px",
lineHeight: "20px",
padding: '5px',
borderColor: '#aaa',
borderRadius: '5px',
......@@ -141,8 +133,8 @@
fontFamily: "微软雅黑"
});
this.map.addOverlay(label);
var myIcon = new BMap.Icon("static/blue.png", new BMap.Size(12,16));
var marker = new BMap.Marker(coordinate,{icon:myIcon});
let myIcon = new BMap.Icon("static/blue.png", new BMap.Size(12,16));
let marker = new BMap.Marker(coordinate,{icon:myIcon});
this.map.addOverlay(marker); // 将标注添加到地图中
marker.addEventListener("click", function() {
self.$emit('town_accept',item);
......@@ -239,6 +231,9 @@
self.getBoundary(self.map, false, -1);
}
});
},
api(town,position) {
}
}
});
......
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 to comment