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

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

parent bc6b4440
......@@ -10,8 +10,8 @@
<body>
<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.210421/Plugins.min.js"></script>
<script src="/shanghaiwuye_gis_map_api_3.2.210914/SMap.min.js"></script>
<script src="/Plugins.min.js"></script>
<script type="module" src="/src/main.ts"></script>
</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', {
//"wg_gis_xq_point"为小区点,
//"wg_gis_xq_poly"为小区面,
//"wg_gis_zb_jkd"为小区健康度
//"wg_gis_fwzl"为物业服务质量
//"wg_gis_mpz"为门牌幢点,
//"wg_gis_elevator"为电梯点,
//"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
@font-face
font-family Pangmenzhengdao
src url(./assets/font/pangmenzhengdao.ttf)
@font-face
font-family BarlowExtraBold
src url(./assets/font/Barlow-ExtraBold.ttf)
html, body
background #000
......@@ -75,12 +78,13 @@ html, body
// background url('/src/assets/images/map.png') center/100% 100% no-repeat
color #fff
.orange-count
font-size .14rem
font-size .16rem
font-weight bold
background-clip text
-webkit-background-clip text
-webkit-text-fill-color transparent
background-image linear-gradient(to bottom, #FFD1B2, #FF8635)
font-family BarlowExtraBold, DIN, Avenir, Helvetica, Arial, sans-serif
/* 设置滚动条的样式 */
::-webkit-scrollbar {
......
......@@ -10,4 +10,5 @@ switch (process.env.NODE_ENV) {
export default {
BASE_URL,
CONFIGS: '/service-bigscreen/public/bigscreenConfigs', // 配置
COMMUNITYS: '/service-basicdatasync-ddd/public/communities', // 小区
}
......@@ -96,3 +96,9 @@ export default defineComponent({
},
})
</script>
<style lang="stylus" scoped>
@import '../main.styl'
b
font-family $font-barlow
</style>
$font-pang = Pangmenzhengdao, '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%)
width w
......
......@@ -21,6 +21,7 @@ declare const SMap: {
BMapGallery: any
BMapGalleryExpand: any
LngLat: any
load: any
}
declare const Plugins: {
MaskBoundary: new (view: any) => {
......
......@@ -46,7 +46,11 @@ const btns = computed(() => [
{ key: 'full', icon: btn2 },
{ key: 'in', icon: btn3 },
{ key: 'out', icon: btn4 },
{ key: 'list', icon: btn5, hidden: props.onlyOneView },
{
key: 'list',
icon: btn5,
hidden: !props.isDefaultScreen || props.onlyOneView,
},
{ key: 'btn6', icon: btn6 },
])
const onClick = (key: string) => {
......
......@@ -7,6 +7,7 @@ import icon1 from '@/assets/images/search.png'
import { MyMap } from '@/components/my-map'
import { nextTick, onMounted } from 'vue'
import jinganPath from '@/utils/jingan-path.js'
import { ajax, api } from '@/ajax'
let map: MyMap
let pointsLayer: any
......@@ -14,13 +15,13 @@ let linesLayer: any
let polygonLayer: any
let boundary: any
defineExpose({ zoomIn, zoomOut })
defineExpose({ zoomIn, zoomOut, zoomTo, addPoints, remove })
onMounted(async () => {
await nextTick()
map = MyMap.useMap('SMap').with({
el: 'container',
mode: '2D',
center: [-1931.2637583608503, 4334.0159596985895],
zoom: 4,
style: 'smap://styles/dark',
......@@ -48,6 +49,12 @@ function onComplete() {
color: '#ED6F30',
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() {
......@@ -56,32 +63,30 @@ function zoomIn() {
function zoomOut() {
map.zoomOut()
}
function zoomTo() {
map.zoomTo(20)
}
function move() {
map.focus([121.59751247938203, 29.835174764721145], { zoom: 16 })
function zoomTo(level: number) {
map.zoomTo(level)
}
function addPoints() {
pointsLayer = map.add('point', {
data: [
{
x: 121.59751247938203,
y: 29.835174764721145,
text: 'test message',
title: 'icon',
},
],
size: 20,
icon: icon1,
labelKey: 'title',
labelOptions: {
size: 20,
offset: [0, 20],
color: '#fff',
},
})
function addPoints(options) {
return map.add('point', options)
// map.add('point', {
// data: [
// {
// x: 121.59751247938203,
// y: 29.835174764721145,
// text: 'test message',
// title: 'icon',
// },
// ],
// size: 20,
// icon: icon1,
// labelKey: 'title',
// labelOptions: {
// size: 20,
// offset: [0, 20],
// color: '#fff',
// },
// })
}
function addLines() {
linesLayer = map.add('line', {
......@@ -109,6 +114,10 @@ function addPolygon() {
})
}
function remove(layer) {
layer && map.remove(layer)
}
function removeLayers() {
map.remove(pointsLayer)
map.remove(linesLayer)
......
......@@ -61,6 +61,7 @@ import { ajax, api } from '@/ajax'
import { NSpace, NButton } from 'naive-ui'
import MapBtns from './components/map-btns.vue'
import Map from './components/map.vue'
import { bus } from '@/utils/component-list'
const mapRef = shallowRef<any>(null)
const { layout } = useLayout()
......@@ -148,6 +149,11 @@ function handleMapBtnsEvents(key: string) {
break
}
}
let pointsLayer: any
bus.on('addPoints', (data) => {
mapRef.value?.remove(pointsLayer)
pointsLayer = mapRef.value?.addPoints(data)
})
</script>
<style lang="stylus" scoped>
......
......@@ -12,6 +12,6 @@ export default defineConfig({
},
},
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