Commit c304ac41 authored by 郭铭瑶's avatar 郭铭瑶 🤘

曹路小区上色

parent db24a635
.DS_Store .DS_Store
node_modules/ node_modules/
/dist/ /dist/
/crawler/
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
......
...@@ -10,7 +10,15 @@ module.exports = { ...@@ -10,7 +10,15 @@ module.exports = {
// Paths // Paths
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
assetsPublicPath: '/', assetsPublicPath: '/',
proxyTable: {}, proxyTable: {
"/api": {
target: "http://www.gaode.com/service/poiInfo",
changeOrigin:true,
pathRewrite:{
'^/api':''
}
},
},
// Various Dev Server settings // Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST host: 'localhost', // can be overwritten by process.env.HOST
......
...@@ -267,6 +267,16 @@ ...@@ -267,6 +267,16 @@
} }
} }
}, },
"adler-32": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/adler-32/download/adler-32-1.2.0.tgz",
"integrity": "sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=",
"dev": true,
"requires": {
"exit-on-epipe": "~1.0.1",
"printj": "~1.1.0"
}
},
"ajv": { "ajv": {
"version": "5.5.2", "version": "5.5.2",
"resolved": "https://registry.npm.taobao.org/ajv/download/ajv-5.5.2.tgz", "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-5.5.2.tgz",
...@@ -516,6 +526,38 @@ ...@@ -516,6 +526,38 @@
"postcss-value-parser": "^3.2.3" "postcss-value-parser": "^3.2.3"
} }
}, },
"axios": {
"version": "0.19.0",
"resolved": "https://registry.npm.taobao.org/axios/download/axios-0.19.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faxios%2Fdownload%2Faxios-0.19.0.tgz",
"integrity": "sha1-jgm/89kSLhM/e4EByPvdAO09Krg=",
"requires": {
"follow-redirects": "1.5.10",
"is-buffer": "^2.0.2"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz",
"integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=",
"requires": {
"ms": "2.0.0"
}
},
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz",
"integrity": "sha1-e3qfmuov3/NnhqlP9kPtB/T/Xio=",
"requires": {
"debug": "=3.1.0"
}
},
"is-buffer": {
"version": "2.0.4",
"resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-2.0.4.tgz",
"integrity": "sha1-PlcvI8hBGlz9lVfISeNmXgspBiM="
}
}
},
"babel-code-frame": { "babel-code-frame": {
"version": "6.26.0", "version": "6.26.0",
"resolved": "https://registry.npm.taobao.org/babel-code-frame/download/babel-code-frame-6.26.0.tgz", "resolved": "https://registry.npm.taobao.org/babel-code-frame/download/babel-code-frame-6.26.0.tgz",
...@@ -1889,6 +1931,18 @@ ...@@ -1889,6 +1931,18 @@
"lazy-cache": "^1.0.3" "lazy-cache": "^1.0.3"
} }
}, },
"cfb": {
"version": "1.1.3",
"resolved": "https://registry.npm.taobao.org/cfb/download/cfb-1.1.3.tgz",
"integrity": "sha1-Bd5oFiWcjovDJxOrqQVgjuOF32Y=",
"dev": true,
"requires": {
"adler-32": "~1.2.0",
"commander": "^2.16.0",
"crc-32": "~1.2.0",
"printj": "~1.1.2"
}
},
"chalk": { "chalk": {
"version": "2.4.2", "version": "2.4.2",
"resolved": "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz?cache=0&sync_timestamp=1573282949696&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchalk%2Fdownload%2Fchalk-2.4.2.tgz", "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz?cache=0&sync_timestamp=1573282949696&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchalk%2Fdownload%2Fchalk-2.4.2.tgz",
...@@ -2087,6 +2141,24 @@ ...@@ -2087,6 +2141,24 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true "dev": true
}, },
"codepage": {
"version": "1.14.0",
"resolved": "https://registry.npm.taobao.org/codepage/download/codepage-1.14.0.tgz",
"integrity": "sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=",
"dev": true,
"requires": {
"commander": "~2.14.1",
"exit-on-epipe": "~1.0.1"
},
"dependencies": {
"commander": {
"version": "2.14.1",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz",
"integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao=",
"dev": true
}
}
},
"collection-visit": { "collection-visit": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/collection-visit/download/collection-visit-1.0.0.tgz", "resolved": "https://registry.npm.taobao.org/collection-visit/download/collection-visit-1.0.0.tgz",
...@@ -2357,6 +2429,16 @@ ...@@ -2357,6 +2429,16 @@
} }
} }
}, },
"crc-32": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz",
"integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=",
"dev": true,
"requires": {
"exit-on-epipe": "~1.0.1",
"printj": "~1.1.0"
}
},
"create-ecdh": { "create-ecdh": {
"version": "4.0.3", "version": "4.0.3",
"resolved": "https://registry.npm.taobao.org/create-ecdh/download/create-ecdh-4.0.3.tgz", "resolved": "https://registry.npm.taobao.org/create-ecdh/download/create-ecdh-4.0.3.tgz",
...@@ -4194,6 +4276,12 @@ ...@@ -4194,6 +4276,12 @@
"strip-eof": "^1.0.0" "strip-eof": "^1.0.0"
} }
}, },
"exit-on-epipe": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz",
"integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI=",
"dev": true
},
"expand-brackets": { "expand-brackets": {
"version": "2.1.4", "version": "2.1.4",
"resolved": "https://registry.npm.taobao.org/expand-brackets/download/expand-brackets-2.1.4.tgz", "resolved": "https://registry.npm.taobao.org/expand-brackets/download/expand-brackets-2.1.4.tgz",
...@@ -4657,6 +4745,12 @@ ...@@ -4657,6 +4745,12 @@
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
"dev": true "dev": true
}, },
"frac": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/frac/download/frac-1.1.2.tgz",
"integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs=",
"dev": true
},
"fragment-cache": { "fragment-cache": {
"version": "0.2.1", "version": "0.2.1",
"resolved": "https://registry.npm.taobao.org/fragment-cache/download/fragment-cache-0.2.1.tgz", "resolved": "https://registry.npm.taobao.org/fragment-cache/download/fragment-cache-0.2.1.tgz",
...@@ -6914,8 +7008,7 @@ ...@@ -6914,8 +7008,7 @@
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz", "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
"dev": true
}, },
"multicast-dns": { "multicast-dns": {
"version": "6.2.3", "version": "6.2.3",
...@@ -7081,6 +7174,16 @@ ...@@ -7081,6 +7174,16 @@
} }
} }
}, },
"node-xlsx": {
"version": "0.15.0",
"resolved": "https://registry.npm.taobao.org/node-xlsx/download/node-xlsx-0.15.0.tgz",
"integrity": "sha1-HxsNetzlxwboa/2WpaoABb+KncM=",
"dev": true,
"requires": {
"buffer-from": "^1.1.0",
"xlsx": "^0.14.1"
}
},
"normalize-package-data": { "normalize-package-data": {
"version": "2.5.0", "version": "2.5.0",
"resolved": "https://registry.npm.taobao.org/normalize-package-data/download/normalize-package-data-2.5.0.tgz", "resolved": "https://registry.npm.taobao.org/normalize-package-data/download/normalize-package-data-2.5.0.tgz",
...@@ -9993,6 +10096,12 @@ ...@@ -9993,6 +10096,12 @@
"utila": "~0.4" "utila": "~0.4"
} }
}, },
"printj": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/printj/download/printj-1.1.2.tgz",
"integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI=",
"dev": true
},
"private": { "private": {
"version": "0.1.8", "version": "0.1.8",
"resolved": "https://registry.npm.taobao.org/private/download/private-0.1.8.tgz", "resolved": "https://registry.npm.taobao.org/private/download/private-0.1.8.tgz",
...@@ -11165,6 +11274,15 @@ ...@@ -11165,6 +11274,15 @@
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true "dev": true
}, },
"ssf": {
"version": "0.10.2",
"resolved": "https://registry.npm.taobao.org/ssf/download/ssf-0.10.2.tgz",
"integrity": "sha1-ZbK0/N/ZZ7yOg4OkE0kAmJMRWXY=",
"dev": true,
"requires": {
"frac": "~1.1.2"
}
},
"ssri": { "ssri": {
"version": "5.3.0", "version": "5.3.0",
"resolved": "https://registry.npm.taobao.org/ssri/download/ssri-5.3.0.tgz", "resolved": "https://registry.npm.taobao.org/ssri/download/ssri-5.3.0.tgz",
...@@ -12728,6 +12846,21 @@ ...@@ -12728,6 +12846,21 @@
"safe-buffer": "~5.1.0" "safe-buffer": "~5.1.0"
} }
}, },
"xlsx": {
"version": "0.14.5",
"resolved": "https://registry.npm.taobao.org/xlsx/download/xlsx-0.14.5.tgz",
"integrity": "sha1-NjfpFNeRvcpzgoFuFz99cl7Q4NI=",
"dev": true,
"requires": {
"adler-32": "~1.2.0",
"cfb": "^1.1.2",
"codepage": "~1.14.0",
"commander": "~2.17.1",
"crc-32": "~1.2.0",
"exit-on-epipe": "~1.0.1",
"ssf": "~0.10.2"
}
},
"xtend": { "xtend": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://registry.npm.taobao.org/xtend/download/xtend-4.0.2.tgz", "resolved": "https://registry.npm.taobao.org/xtend/download/xtend-4.0.2.tgz",
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"build": "node build/build.js" "build": "node build/build.js"
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"view-design": "^4.0.2", "view-design": "^4.0.2",
"vue": "^2.5.2", "vue": "^2.5.2",
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
"friendly-errors-webpack-plugin": "^1.6.1", "friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1", "html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2", "node-notifier": "^5.1.2",
"node-xlsx": "^0.15.0",
"optimize-css-assets-webpack-plugin": "^3.2.0", "optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0", "ora": "^1.2.0",
"portfinder": "^1.0.13", "portfinder": "^1.0.13",
......
...@@ -4,11 +4,17 @@ import 'babel-polyfill' ...@@ -4,11 +4,17 @@ import 'babel-polyfill'
import Vue from 'vue' import Vue from 'vue'
import App from './App' import App from './App'
import router from './router' import router from './router'
import {Button} from 'view-design' import common from './util/common'
import {Dropdown, DropdownMenu, DropdownItem, Icon, Button} from 'view-design'
import 'view-design/dist/styles/iview.css' import 'view-design/dist/styles/iview.css'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(Button) Vue.prototype.$com = common
Vue.component('Dropdown', Dropdown)
Vue.component('DropdownMenu', DropdownMenu)
Vue.component('DropdownItem', DropdownItem)
Vue.component('Button', Button)
Vue.component('Icon', Icon)
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
el: '#app', el: '#app',
......
export default {
'name': '曹路',
'location': [121.656, 31.2937],
'path': [
[121.646363, 31.29713],
[121.661593, 31.30153],
[121.675209, 31.30371],
[121.675881, 31.303618],
[121.676832, 31.303294],
[121.67823, 31.303185],
[121.679124, 31.302861],
[121.679767, 31.302276],
[121.680419, 31.301644],
[121.681295, 31.30119],
[121.68259, 31.300895],
[121.683932, 31.300442],
[121.687175, 31.298457],
[121.68929, 31.296572],
[121.692103, 31.293451],
[121.695846, 31.288259],
[121.701526, 31.279237],
[121.703446, 31.276131],
[121.707933, 31.268612],
[121.711758, 31.262316],
[121.715581, 31.255922],
[121.715386, 31.254919],
[121.713599, 31.254459],
[121.709216, 31.253588],
[121.707854, 31.253216],
[121.695794, 31.250289],
[121.680466, 31.246842],
[121.662889, 31.241375],
[121.646032, 31.237801],
[121.644289, 31.237299],
[121.644152, 31.237426],
[121.644152, 31.239502],
[121.644229, 31.246859],
[121.64423, 31.253181],
[121.64423, 31.26025],
[121.644388, 31.260599],
[121.644489, 31.26476],
[121.644475, 31.268883],
[121.644306, 31.271548],
[121.644293, 31.276035],
[121.644293, 31.282393],
[121.644402, 31.288574],
[121.644452, 31.294857],
[121.644684, 31.296042],
[121.646363, 31.29713]
],
'community': [{
name: '民风小区',
address: '川沙路326弄',
level: 2,
location: [121.666008, 31.279523],
path: [
[121.665317, 31.278676],
[121.665207, 31.27902],
[121.665177, 31.279194],
[121.665107, 31.279372],
[121.665439, 31.279533],
[121.665143, 31.280003],
[121.666219, 31.280522],
[121.667141, 31.279102],
[121.665317, 31.278676]
]
}, {
'name': '金钻苑北区',
'address': '海松路421弄1-92号',
'level': 2,
'location': [121.680712, 31.27919],
'path': [
[121.68277, 31.27854],
[121.682678, 31.278476],
[121.681734, 31.278246],
[121.681155, 31.278092],
[121.679775, 31.2777],
[121.679655, 31.277697],
[121.679561, 31.277731],
[121.679465, 31.27784],
[121.679226, 31.278372],
[121.678856, 31.279123],
[121.67966, 31.279399],
[121.679272, 31.28024],
[121.681177, 31.280862],
[121.681222, 31.280851],
[121.682779, 31.278657],
[121.68277, 31.27854]
]
}, {
'name': '金钻苑南区',
'address': '海顺路359弄1-55号',
'level': 2,
'location': [121.682226, 31.27657],
'path': [
[121.684844, 31.275891],
[121.68485, 31.275849],
[121.684826, 31.275811],
[121.684773, 31.275789],
[121.6819, 31.274868],
[121.681623, 31.275517],
[121.680631, 31.275192],
[121.679771, 31.277218],
[121.679779, 31.27732],
[121.67984, 31.277394],
[121.679921, 31.27745],
[121.683032, 31.278275],
[121.683105, 31.278276],
[121.683154, 31.278256],
[121.683199, 31.278224],
[121.68482, 31.275948],
[121.684844, 31.275891]
]
}, {
'name': '爱法花园二期',
'address': '民耀路423弄1-48号',
'level': 3,
'location': [121.655664, 31.270347],
'path': [
[121.65462, 31.270798],
[121.654666, 31.270694],
[121.654611, 31.270672],
[121.655177, 31.26964],
[121.655192, 31.26962],
[121.655218, 31.2696],
[121.655252, 31.269599],
[121.655319, 31.269613],
[121.655375, 31.269626],
[121.655453, 31.26948],
[121.656754, 31.269943],
[121.656049, 31.271218],
[121.65462, 31.270798]
]
}, {
'name': '民胜苑',
'address': '民耀路290弄',
'level': 3,
'location': [121.653058, 31.270105],
'path': [
[121.652308, 31.268948],
[121.652258, 31.268975],
[121.651488, 31.270402],
[121.653791, 31.271292],
[121.654105, 31.270736],
[121.654613, 31.26986],
[121.654621, 31.269821],
[121.654612, 31.269791],
[121.654587, 31.269771],
[121.654166, 31.269621],
[121.653167, 31.269251],
[121.652308, 31.268948]
]
}, {
'name': '上川路1468弄',
'address': '民雪路1468弄1-12号',
'level': 3,
'location': [121.663432, 31.276896],
'path': [
[121.663288, 31.277229],
[121.664056, 31.277335],
[121.664152, 31.276782],
[121.664022, 31.276747],
[121.66396, 31.276746],
[121.66342, 31.276654],
[121.663435, 31.276579],
[121.662759, 31.276466],
[121.662645, 31.276939],
[121.663327, 31.277041],
[121.663288, 31.277229]
]
}, {
'name': '民春苑',
'address': '曹路镇民春路399弄',
'level': 2,
'location': [121.664949, 31.275344],
'path': [
[121.664438, 31.274904],
[121.664333, 31.275158],
[121.664193, 31.275394],
[121.664087, 31.275556],
[121.665295, 31.275936],
[121.665606, 31.27554],
[121.665813, 31.27515],
[121.664514, 31.274734],
[121.664438, 31.274904]
]
}, {
'name': '丰怡苑',
'address': '龚华路50弄1-93号',
'level': 3,
'location': [121.681596, 31.266324],
'path': [
[121.678898, 31.266412],
[121.683599, 31.267628],
[121.68417, 31.266217],
[121.679791, 31.265025],
[121.678898, 31.266412]
]
}, {
'name': '银丰苑',
'address': '银峰路549弄1-171号',
'level': 2,
'location': [121.68779, 31.267045],
'path': [
[121.688748, 31.268906],
[121.689072, 31.268079],
[121.690026, 31.268327],
[121.690604, 31.267452],
[121.691199, 31.266595],
[121.691144, 31.266528],
[121.689779, 31.2662],
[121.686918, 31.265548],
[121.685417, 31.265199],
[121.684914, 31.266508],
[121.685739, 31.266789],
[121.685133, 31.267954],
[121.688748, 31.268906]
]
}, {
'name': '盛世春晓苑',
'address': '民春路501弄',
'level': 1,
'location': [121.666022, 31.277193],
'path': [
[121.667103, 31.276606],
[121.667653, 31.276824],
[121.668269, 31.275984],
[121.667047, 31.275591],
[121.666392, 31.27698],
[121.665244, 31.276644],
[121.665472, 31.276013],
[121.664063, 31.27557],
[121.66401, 31.275578],
[121.663968, 31.275599],
[121.663859, 31.275748],
[121.663801, 31.275819],
[121.663782, 31.275886],
[121.663783, 31.275935],
[121.663865, 31.276101],
[121.663879, 31.27614],
[121.663875, 31.276175],
[121.663794, 31.276382],
[121.663774, 31.276487],
[121.663898, 31.27651],
[121.664146, 31.276565],
[121.664186, 31.2766],
[121.664205, 31.276648],
[121.664153, 31.276902],
[121.664111, 31.277264],
[121.666689, 31.277602],
[121.667103, 31.276606]
]
}, {
'name': '丰舍西苑',
'address': '民雨路336弄1-46号',
'level': 1,
'location': [121.662002, 31.275083],
'path': [
[121.661549, 31.273864],
[121.66098, 31.275778],
[121.66267, 31.276149],
[121.663018, 31.275208],
[121.662523, 31.275057],
[121.662591, 31.274914],
[121.662635, 31.274756],
[121.662804, 31.27426],
[121.661549, 31.273864]
]
}, {
'name': '丰舍东苑',
'address': '民春路516弄1-52号',
'level': 1,
'location': [121.668075, 31.274709],
'path': [
[121.666823, 31.275305],
[121.667003, 31.274917],
[121.666798, 31.274826],
[121.667385, 31.273453],
[121.668632, 31.273986],
[121.669621, 31.274462],
[121.668577, 31.275878],
[121.667638, 31.275573],
[121.666823, 31.275305]
]
}, {
name: '顾路阳光苑南区',
address: '民耀路268弄1-34号',
level: 1,
location: [121.652693, 31.272165],
path: [
[121.651742, 31.272826],
[121.651767, 31.272874],
[121.652638, 31.273241],
[121.652685, 31.273246],
[121.652716, 31.273222],
[121.653644, 31.271515],
[121.653628, 31.271486],
[121.653443, 31.271395],
[121.653408, 31.27135],
[121.652757, 31.271074],
[121.652696, 31.271094],
[121.651748, 31.272781],
[121.651742, 31.272826]
]
}, {
'name': '民同路176弄',
'address': '民同路88号附近',
'level': 1,
'location': [121.651443, 31.271735],
'path': [
[121.651962, 31.270898],
[121.651367, 31.270659],
[121.651167, 31.270983],
[121.650961, 31.271285],
[121.650303, 31.272043],
[121.650197, 31.272187],
[121.651612, 31.272792],
[121.65165, 31.272781],
[121.65196, 31.272258],
[121.652445, 31.27141],
[121.652563, 31.271158],
[121.651962, 31.270898]
]
}, {
'name': '民耀路97弄',
'address': '上川路698号',
'level': 1,
'location': [121.653028, 31.274562],
'path': [
[121.65355, 31.275371],
[121.654287, 31.274049],
[121.653413, 31.273664],
[121.652891, 31.273445],
[121.65284, 31.273449],
[121.652814, 31.273465],
[121.652748, 31.273577],
[121.652444, 31.274106],
[121.651832, 31.275188],
[121.651809, 31.275253],
[121.651828, 31.275304],
[121.652632, 31.275658],
[121.652943, 31.275205],
[121.65355, 31.275371]
]
}, {
'name': '民同路10弄',
'address': '民同路10弄1-6号',
'level': 1,
'location': [121.650247, 31.274278],
'path': [
[121.650771, 31.274374],
[121.649799, 31.274002],
[121.649706, 31.27416],
[121.65067, 31.274557],
[121.650771, 31.274374]
]
}, {
name: '阳光苑1期至3期',
address: '民同路40弄',
level: 1,
location: [121.650688, 31.273385],
path: [
[121.649847, 31.2739],
[121.650016, 31.273596],
[121.650148, 31.27336],
[121.650235, 31.273177],
[121.65042, 31.272923],
[121.650663, 31.27256],
[121.651509, 31.272897],
[121.651542, 31.272941],
[121.651541, 31.273023],
[121.651141, 31.273674],
[121.650782, 31.274284],
[121.649847, 31.2739]
]
}, {
name: '顾路阳光苑-北区',
address: '民耀路98弄1-27号民耀路96、100号',
level: 1,
location: [121.65162, 31.274128],
path: [
[121.651835, 31.273364],
[121.651502, 31.273237],
[121.650608, 31.274762],
[121.651638, 31.27517],
[121.652248, 31.27409],
[121.65261, 31.273394],
[121.651974, 31.273111],
[121.651835, 31.273364]
]
}, {
name: '民区路265弄',
address: '民区路265弄1-42号',
level: 1,
location: [121.654436, 31.275226],
path: [
[121.655856, 31.274704],
[121.654808, 31.274273],
[121.654297, 31.27405],
[121.653585, 31.275403],
[121.652942, 31.275221],
[121.652619, 31.275707],
[121.653047, 31.275812],
[121.653369, 31.275891],
[121.654347, 31.276045],
[121.655026, 31.27615],
[121.655856, 31.274704]
]
}, {
'name': '佳伟景苑',
'address': '金钻路669弄1-65号',
'level': 1,
'location': [121.67658, 31.284098],
'path': [
[121.67381, 31.284206],
[121.673797, 31.284239],
[121.673795, 31.284269],
[121.673812, 31.284316],
[121.673822, 31.284338],
[121.673841, 31.284358],
[121.673854, 31.284366],
[121.673871, 31.284371],
[121.67515, 31.284754],
[121.675159, 31.284755],
[121.675167, 31.28475],
[121.675177, 31.284723],
[121.675383, 31.284196],
[121.676396, 31.284496],
[121.676171, 31.285056],
[121.677369, 31.285412],
[121.67778, 31.285541],
[121.677867, 31.285545],
[121.678214, 31.285043],
[121.678792, 31.284253],
[121.679059, 31.283871],
[121.679087, 31.283795],
[121.679094, 31.283757],
[121.679095, 31.283731],
[121.67909, 31.283712],
[121.679085, 31.283698],
[121.679066, 31.283683],
[121.679035, 31.283663],
[121.677179, 31.283075],
[121.675823, 31.28262],
[121.675794, 31.282613],
[121.675774, 31.282613],
[121.675756, 31.282617],
[121.675737, 31.282623],
[121.675717, 31.282631],
[121.675558, 31.282767],
[121.67381, 31.284206]
]
}, {
'name': '新芳邻',
'address': '曹路镇民耀路227弄',
'level': 2,
'location': [121.654274, 31.272719],
'path': [
[121.654122, 31.27155],
[121.653074, 31.273392],
[121.654379, 31.273924],
[121.654406, 31.27392],
[121.654427, 31.273906],
[121.65445, 31.273879],
[121.654781, 31.273245],
[121.655037, 31.272756],
[121.655095, 31.272661],
[121.655249, 31.272392],
[121.655401, 31.272118],
[121.655467, 31.271984],
[121.655463, 31.271972],
[121.655455, 31.271961],
[121.654122, 31.27155]
]
}, {
'name': '龚路新城',
'address': '龚华路479弄',
'level': 3,
'location': [121.689056, 31.259685],
'path': [
[121.691383, 31.258272],
[121.688972, 31.257925],
[121.687862, 31.257787],
[121.687809, 31.257799],
[121.686584, 31.260723],
[121.690094, 31.261882],
[121.691466, 31.258394],
[121.691383, 31.258272]
]
}, {
'name': '龚华新村',
'address': '浦东龚华路425弄1-26号',
'level': 3,
'location': [121.6875, 31.261641],
'path': [
[121.686577, 31.260788],
[121.688013, 31.261252],
[121.689244, 31.261661],
[121.689172, 31.261857],
[121.689821, 31.262019],
[121.689734, 31.262257],
[121.688304, 31.261901],
[121.688497, 31.261429],
[121.688012, 31.261274],
[121.687792, 31.261827],
[121.687604, 31.262318],
[121.686065, 31.261958],
[121.686577, 31.260788]
]
}, {
'name': '龚华苑',
'address': '龚华新村溪平路425弄',
'level': 3,
'location': [121.689001, 31.262391],
'path': [
[121.689645, 31.262784],
[121.689773, 31.262345],
[121.688484, 31.262023],
[121.688357, 31.262058],
[121.688194, 31.262422],
[121.689645, 31.262784]
]
}, {
'name': '龚华公寓',
'address': '龚华路406弄',
'level': 3,
'location': [121.685816, 31.260781],
'path': [
[121.685173, 31.261645],
[121.685699, 31.261796],
[121.686448, 31.259896],
[121.685961, 31.259744],
[121.685173, 31.261645]
]
}, {
name: '爱法花园一期',
address: '民雪路918弄1-39号',
level: 1,
location: [121.658801, 31.271699],
path: [
[121.659861, 31.27119],
[121.658505, 31.270685],
[121.657713, 31.272218],
[121.659055, 31.272659],
[121.659146, 31.272648],
[121.659193, 31.272605],
[121.659861, 31.27119]
]
},
// {
// // 查无小区
// "name": "民建小区(补)",
// "level": 2
// },
{
'name': '申华小区',
'address': '民耀路391弄1-16号',
'level': 2,
'location': [121.655013, 31.271323],
'path': [
[121.654384, 31.270772],
[121.654348, 31.270768],
[121.654332, 31.270776],
[121.654311, 31.27079],
[121.65421, 31.270962],
[121.654019, 31.271309],
[121.654007, 31.271346],
[121.65401, 31.271371],
[121.654025, 31.271382],
[121.655703, 31.27189],
[121.655872, 31.271573],
[121.656009, 31.271331],
[121.656034, 31.27127],
[121.655813, 31.271204],
[121.655356, 31.27107],
[121.655022, 31.270966],
[121.654384, 31.270772]
]
}
]
}
export default{
switchBuildingColor(level) {
switch (level) {
case 1:
return ['ff99ff00', 'ff999900']
case 2:
return ['ffffff00', 'ffffcc00']
case 3:
return ['ffcc0000', 'ffaa0000']
default:
return []
}
},
}
<template> <template>
<div id="container"/> <div id="container">
<Dropdown class="dropdown" >
<Button type="primary" icon="ios-arrow-down">小区列表</Button>
<DropdownMenu class="dropdown-menu" slot="list">
<DropdownItem @click.native="handleSelect(item)" v-for="item in area.community" :key="item.name">{{item.name}}</DropdownItem>
</DropdownMenu>
</Dropdown>
</div>
</template> </template>
<script> <script>
const {AMap} = window const {AMap} = window
import axios from 'axios'
import caolu from '@/mock/caolu.js'
export default { export default {
name: 'Map3D', name: 'Map3D',
data() { data() {
...@@ -48,37 +57,7 @@ export default { ...@@ -48,37 +57,7 @@ export default {
}, },
] ]
}, },
buildingOptions2: { mapConfig: {
hideWithoutStyle:false,//是否隐藏设定区域外的楼块
areas:[
{ //围栏1
// visible:false,//是否可见
rejectTexture:false,//是否屏蔽自定义地图的纹理
color1: 'ffffff00',//楼顶颜色
color2: 'ffffcc00',//楼面颜色
path: [
[121.666232,31.28054],
[121.667163,31.279096],
[121.66531,31.278672],
[121.6651,31.279373],
[121.665428,31.279536],
[121.665146,31.280012],
]
},
]
},
}
},
mounted() {
this.$nextTick(this.initMap)
},
methods: {
initMap() {
const buildingLayer = new AMap.Buildings({zIndex:130,merge:false,sort:false,zooms:[17,20]})
buildingLayer.setStyle(this.buildingOptions)
this.map = new AMap.Map('container', {
resizeEnable: true, resizeEnable: true,
rotateEnable:true, rotateEnable:true,
pitchEnable:true, pitchEnable:true,
...@@ -90,40 +69,78 @@ export default { ...@@ -90,40 +69,78 @@ export default {
buildingAnimation:true,//楼块出现是否带动画 buildingAnimation:true,//楼块出现是否带动画
expandZoomRange:true, expandZoomRange:true,
// zooms:[17,20], // zooms:[17,20],
zooms: [10,20], zooms: [15,20],
// center:[121.497915,31.218138], // 黄浦 // center:[121.497915,31.218138], // 黄浦
// center: [121.558,31.0727], //航头镇 // center: [121.558,31.0727], //航头镇
// center: [121.502, 31.1956], //南码头 // center: [121.502, 31.1956], //南码头
// center: [121.656, 31.2937], // 曹路 center: [121.656, 31.2937], // 曹路
center: [121.666008,31.279523], // 曹路 - 民风小区
showIndoorMap:false, showIndoorMap:false,
// mapStyle:'amap://styles/light', // mapStyle:'amap://styles/light',
features:['bg','point','road'], features:['bg','point','road'],
layers:[ },
new AMap.TileLayer({}), area: caolu,
buildingLayer
]
})
this.map.addControl(new AMap.ControlBar({
showZoomBar:false,
showControlButton:true,
position:{
right:'10px',
top:'10px'
} }
})) },
mounted() {
this.$nextTick(this.initMap)
},
methods: {
initMap() {
this.map = new AMap.Map('container', this.mapConfig)
this.highlightArea(caolu)
this.initLayers(caolu)
this.addController()
this.addMarker()
this.addEvents()
this.highlightPudong()
},
handleSelect({name, address, location}) {
this.map.setZoomAndCenter(18, location)
this.showDetail(null, location, {title: name, content: address})
},
initLayers(area) { // 添加基础图层和建筑物图层
const buildingOptions = {
areas: area.community.map(item => {
new AMap.Polygon({ new AMap.Polygon({
bubble:false, bubble:false,
fillColor: 'green', fillColor: 'green',
fillOpacity:0.2, fillOpacity:0.2,
strokeWeight:1, strokeWeight:1,
path:this.buildingOptions.areas[0].path, path: item.path,
map:this.map map:this.map
}).on('click', e => {
const location = [e.lnglat.getLng(), e.lnglat.getLat()]
this.map.setZoomAndCenter(18.8, location)
this.showDetail(e, location, {title: item.name, content: item.address})
}) })
return {
rejectTexture:true,//是否屏蔽自定义地图的纹理
color1: this.$com.switchBuildingColor(item.level)[0],//楼顶颜色
color2: this.$com.switchBuildingColor(item.level)[1],//楼面颜色
path: item.path
}
})
}
const buildingLayer = new AMap.Buildings({zIndex:130,merge:false,sort:false,zooms:[10,20]})
buildingLayer.setStyle(buildingOptions)
this.map.setLayers([
new AMap.TileLayer({}),
buildingLayer
])
// 框起的建筑物区域底板颜色(不写则无底色,不影响建筑颜色)
// new AMap.Polygon({
// bubble:false,
// fillColor: 'green',
// fillOpacity:0.2,
// strokeWeight:1,
// path: buildingOptions.areas[0].path,
// map:this.map
// }).on('click', e => {
// const location = [e.lnglat.getLng(), e.lnglat.getLat()]
// this.map.setZoomAndCenter(18.8, location)
// })
// new AMap.Polygon({ // new AMap.Polygon({
// bubble:true, // bubble:true,
// fillOpacity:0.2, // fillOpacity:0.2,
...@@ -131,12 +148,19 @@ export default { ...@@ -131,12 +148,19 @@ export default {
// path:this.buildingOptions.areas[1].path, // path:this.buildingOptions.areas[1].path,
// map:this.map // map:this.map
// }) // })
this.map.on('click', e => { },
const location = [e.lnglat.getLng(), e.lnglat.getLat()] addController() { // 添加地图控制器
this.map.setZoomAndCenter(18.8, location) this.map.addControl(new AMap.ControlBar({
console.log(e, e.lnglat.getLng() + ',' + e.lnglat.getLat()) showZoomBar:false,
}) showControlButton:true,
const marker = new AMap.Marker({ position:{
right:'10px',
top:'10px'
}
}))
},
addMarker() {
new AMap.Marker({
map: this.map, map: this.map,
position: [121.498973,31.218018], position: [121.498973,31.218018],
extData: { extData: {
...@@ -148,20 +172,50 @@ export default { ...@@ -148,20 +172,50 @@ export default {
image: require('@/assets/images/attorney.png'), image: require('@/assets/images/attorney.png'),
// imageOffset: new AMap.Pixel(0, -60) // imageOffset: new AMap.Pixel(0, -60)
}) })
}) }).on('click', e => {
marker.on('click', e => {
const location = [e.lnglat.getLng(), e.lnglat.getLat()] const location = [e.lnglat.getLng(), e.lnglat.getLat()]
this.showDetail(e, location, marker.getExtData()) this.showDetail(e, location, marker.getExtData())
}) })
},
const searcher = new AMap.DistrictSearch({ showDetail(e, location, data) {
level: 'district', // TODO
subdistric: 1, const infoWindow = new AMap.InfoWindow({
content: `
<div>
<b>${data.title}</b>
<p>${data.content || '暂无其他信息'}</p>
</div>
`
})
infoWindow.open(this.map, location)
},
addEvents() {
this.map.on('click', e => {
const location = [e.lnglat.getLng(), e.lnglat.getLat()]
this.map.setZoomAndCenter(18.8, location)
console.log(e, e.lnglat.getLng() + ',' + e.lnglat.getLat())
}) })
searcher.search('浦东新区', (status, result) => { },
console.log('---浦东新区街镇---', result.districtList[0].districtList) highlightArea(area) {
const polygon = new AMap.Polygon({
strokeWeight: 3,
strokeStyle:'dashed',
path: area.path,
fillOpacity: 0.2,
fillColor: '#80d8ff',
strokeColor: '#0091ea'
}) })
this.map.add([polygon])
},
highlightPudong() {
// new AMap.DistrictSearch({
// level: 'district',
// subdistric: 1,
// }).search('浦东新区', (status, result) => {
// console.log('---浦东新区街镇---', result.districtList[0].districtList)
// })
// 给浦东新区添加蓝色遮罩
// new AMap.DistrictSearch({ // new AMap.DistrictSearch({
// level: 'district', // level: 'district',
// extensions: 'all', // extensions: 'all',
...@@ -221,18 +275,6 @@ export default { ...@@ -221,18 +275,6 @@ export default {
// this.map.add(polygon) // this.map.add(polygon)
// }) // })
}, },
showDetail(e, location, data) {
// TODO
const infoWindow = new AMap.InfoWindow({
content: `
<div>
<b>${data.title}</b>
<p>${data.content}</p>
</div>
`
})
infoWindow.open(this.map, location)
},
}, },
} }
</script> </script>
...@@ -242,6 +284,12 @@ export default { ...@@ -242,6 +284,12 @@ export default {
width 100% width 100%
height 100% height 100%
resize both resize both
position relative
.dropdown
position absolute
top 2rem
left 2rem
z-index 100
</style> </style>
<style lang="stylus"> <style lang="stylus">
.amap-logo .amap-logo
......
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