Commit 3cfdcd94 authored by 郭铭瑶's avatar 郭铭瑶 🤘

地图添加本区小区勾边门牌幢点暂存

parent bc6b4440
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<body> <body>
<div id="app"></div> <div id="app"></div>
<script src="/shanghaiwuye_gis_map_api_3.2.210421/SMap.min.js"></script> <script src="/shanghaiwuye_gis_map_api_3.2.210914/SMap.min.js"></script>
<script src="/shanghaiwuye_gis_map_api_3.2.210421/Plugins.min.js"></script> <script src="/Plugins.min.js"></script>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
</body> </body>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
new SMap.Network().setNet(网络参数);
网络参数包括以下几个值:
'internet':表示互联网2D;
'affairs':表示政务网2D;
'local3D':表示局域网3D;
'affairs3D':表示政务网3D;
'njdl':表示南京东路政务网3D;
\ No newline at end of file
...@@ -227,6 +227,7 @@ const map = new SMap.Map('container', { ...@@ -227,6 +227,7 @@ const map = new SMap.Map('container', {
//"wg_gis_xq_point"为小区点, //"wg_gis_xq_point"为小区点,
//"wg_gis_xq_poly"为小区面, //"wg_gis_xq_poly"为小区面,
//"wg_gis_zb_jkd"为小区健康度 //"wg_gis_zb_jkd"为小区健康度
//"wg_gis_fwzl"为物业服务质量
//"wg_gis_mpz"为门牌幢点, //"wg_gis_mpz"为门牌幢点,
//"wg_gis_elevator"为电梯点, //"wg_gis_elevator"为电梯点,
//"wg_gis_sensor"为传感器 //"wg_gis_sensor"为传感器
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -54,6 +54,9 @@ const MainPage = token ? EditPage : ViewPage ...@@ -54,6 +54,9 @@ const MainPage = token ? EditPage : ViewPage
@font-face @font-face
font-family Pangmenzhengdao font-family Pangmenzhengdao
src url(./assets/font/pangmenzhengdao.ttf) src url(./assets/font/pangmenzhengdao.ttf)
@font-face
font-family BarlowExtraBold
src url(./assets/font/Barlow-ExtraBold.ttf)
html, body html, body
background #000 background #000
...@@ -75,12 +78,13 @@ html, body ...@@ -75,12 +78,13 @@ html, body
// background url('/src/assets/images/map.png') center/100% 100% no-repeat // background url('/src/assets/images/map.png') center/100% 100% no-repeat
color #fff color #fff
.orange-count .orange-count
font-size .14rem font-size .16rem
font-weight bold font-weight bold
background-clip text background-clip text
-webkit-background-clip text -webkit-background-clip text
-webkit-text-fill-color transparent -webkit-text-fill-color transparent
background-image linear-gradient(to bottom, #FFD1B2, #FF8635) background-image linear-gradient(to bottom, #FFD1B2, #FF8635)
font-family BarlowExtraBold, DIN, Avenir, Helvetica, Arial, sans-serif
/* 设置滚动条的样式 */ /* 设置滚动条的样式 */
::-webkit-scrollbar { ::-webkit-scrollbar {
......
...@@ -10,4 +10,5 @@ switch (process.env.NODE_ENV) { ...@@ -10,4 +10,5 @@ switch (process.env.NODE_ENV) {
export default { export default {
BASE_URL, BASE_URL,
CONFIGS: '/service-bigscreen/public/bigscreenConfigs', // 配置 CONFIGS: '/service-bigscreen/public/bigscreenConfigs', // 配置
COMMUNITYS: '/service-basicdatasync-ddd/public/communities', // 小区
} }
...@@ -96,3 +96,9 @@ export default defineComponent({ ...@@ -96,3 +96,9 @@ export default defineComponent({
}, },
}) })
</script> </script>
<style lang="stylus" scoped>
@import '../main.styl'
b
font-family $font-barlow
</style>
$font-pang = Pangmenzhengdao, 'Avenir', Helvetica, Arial, sans-serif $font-pang = Pangmenzhengdao, 'Avenir', Helvetica, Arial, sans-serif
$font-din = DIN, 'Avenir', Helvetica, Arial, sans-serif $font-din = DIN, 'Avenir', Helvetica, Arial, sans-serif
$font-barlow = BarlowExtraBold, 'Avenir', Helvetica, Arial, sans-serif
$full(w = 100%, h = 100%) $full(w = 100%, h = 100%)
width w width w
......
...@@ -21,6 +21,7 @@ declare const SMap: { ...@@ -21,6 +21,7 @@ declare const SMap: {
BMapGallery: any BMapGallery: any
BMapGalleryExpand: any BMapGalleryExpand: any
LngLat: any LngLat: any
load: any
} }
declare const Plugins: { declare const Plugins: {
MaskBoundary: new (view: any) => { MaskBoundary: new (view: any) => {
......
...@@ -46,7 +46,11 @@ const btns = computed(() => [ ...@@ -46,7 +46,11 @@ const btns = computed(() => [
{ key: 'full', icon: btn2 }, { key: 'full', icon: btn2 },
{ key: 'in', icon: btn3 }, { key: 'in', icon: btn3 },
{ key: 'out', icon: btn4 }, { key: 'out', icon: btn4 },
{ key: 'list', icon: btn5, hidden: props.onlyOneView }, {
key: 'list',
icon: btn5,
hidden: !props.isDefaultScreen || props.onlyOneView,
},
{ key: 'btn6', icon: btn6 }, { key: 'btn6', icon: btn6 },
]) ])
const onClick = (key: string) => { const onClick = (key: string) => {
......
...@@ -7,6 +7,7 @@ import icon1 from '@/assets/images/search.png' ...@@ -7,6 +7,7 @@ import icon1 from '@/assets/images/search.png'
import { MyMap } from '@/components/my-map' import { MyMap } from '@/components/my-map'
import { nextTick, onMounted } from 'vue' import { nextTick, onMounted } from 'vue'
import jinganPath from '@/utils/jingan-path.js' import jinganPath from '@/utils/jingan-path.js'
import { ajax, api } from '@/ajax'
let map: MyMap let map: MyMap
let pointsLayer: any let pointsLayer: any
...@@ -14,13 +15,13 @@ let linesLayer: any ...@@ -14,13 +15,13 @@ let linesLayer: any
let polygonLayer: any let polygonLayer: any
let boundary: any let boundary: any
defineExpose({ zoomIn, zoomOut }) defineExpose({ zoomIn, zoomOut, zoomTo, addPoints, remove })
onMounted(async () => { onMounted(async () => {
await nextTick() await nextTick()
map = MyMap.useMap('SMap').with({ map = MyMap.useMap('SMap').with({
el: 'container', el: 'container',
mode: '2D',
center: [-1931.2637583608503, 4334.0159596985895], center: [-1931.2637583608503, 4334.0159596985895],
zoom: 4, zoom: 4,
style: 'smap://styles/dark', style: 'smap://styles/dark',
...@@ -48,6 +49,12 @@ function onComplete() { ...@@ -48,6 +49,12 @@ function onComplete() {
color: '#ED6F30', color: '#ED6F30',
lineWidth: 2, lineWidth: 2,
}) })
// // eslint-disable-next-line
// map.instance.setFilter('wg_gis_xq_point', "HPB_NAME = '静安区'")
// eslint-disable-next-line
map.instance.setFilter('wg_gis_mpz', "HPB_NAME = '静安区'")
// eslint-disable-next-line
map.instance.setFilter('wg_gis_xq_poly', "HPB_NAME = '静安区'")
} }
function zoomIn() { function zoomIn() {
...@@ -56,32 +63,30 @@ function zoomIn() { ...@@ -56,32 +63,30 @@ function zoomIn() {
function zoomOut() { function zoomOut() {
map.zoomOut() map.zoomOut()
} }
function zoomTo() { function zoomTo(level: number) {
map.zoomTo(20) map.zoomTo(level)
}
function move() {
map.focus([121.59751247938203, 29.835174764721145], { zoom: 16 })
} }
function addPoints() { function addPoints(options) {
pointsLayer = map.add('point', { return map.add('point', options)
data: [ // map.add('point', {
{ // data: [
x: 121.59751247938203, // {
y: 29.835174764721145, // x: 121.59751247938203,
text: 'test message', // y: 29.835174764721145,
title: 'icon', // text: 'test message',
}, // title: 'icon',
], // },
size: 20, // ],
icon: icon1, // size: 20,
labelKey: 'title', // icon: icon1,
labelOptions: { // labelKey: 'title',
size: 20, // labelOptions: {
offset: [0, 20], // size: 20,
color: '#fff', // offset: [0, 20],
}, // color: '#fff',
}) // },
// })
} }
function addLines() { function addLines() {
linesLayer = map.add('line', { linesLayer = map.add('line', {
...@@ -109,6 +114,10 @@ function addPolygon() { ...@@ -109,6 +114,10 @@ function addPolygon() {
}) })
} }
function remove(layer) {
layer && map.remove(layer)
}
function removeLayers() { function removeLayers() {
map.remove(pointsLayer) map.remove(pointsLayer)
map.remove(linesLayer) map.remove(linesLayer)
......
...@@ -61,6 +61,7 @@ import { ajax, api } from '@/ajax' ...@@ -61,6 +61,7 @@ import { ajax, api } from '@/ajax'
import { NSpace, NButton } from 'naive-ui' import { NSpace, NButton } from 'naive-ui'
import MapBtns from './components/map-btns.vue' import MapBtns from './components/map-btns.vue'
import Map from './components/map.vue' import Map from './components/map.vue'
import { bus } from '@/utils/component-list'
const mapRef = shallowRef<any>(null) const mapRef = shallowRef<any>(null)
const { layout } = useLayout() const { layout } = useLayout()
...@@ -148,6 +149,11 @@ function handleMapBtnsEvents(key: string) { ...@@ -148,6 +149,11 @@ function handleMapBtnsEvents(key: string) {
break break
} }
} }
let pointsLayer: any
bus.on('addPoints', (data) => {
mapRef.value?.remove(pointsLayer)
pointsLayer = mapRef.value?.addPoints(data)
})
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
......
...@@ -12,6 +12,6 @@ export default defineConfig({ ...@@ -12,6 +12,6 @@ export default defineConfig({
}, },
}, },
server: { server: {
port: 3000, port: 3008,
}, },
}) })
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