Commit 2b0b4157 by 王志慧

Merge branch 'V1.0-0311-wzh' into 'yc_v1.0.0'

车位标记

See merge request !3
2 parents 66066c63 4e9f4c0d
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"bignumber.js": "^9.1.1", "bignumber.js": "^9.1.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
......
.marker {
height: 36px;
background: #5850ff;
border-radius: 4px;
font-size: 14px;
color: #ffffff;
display: flex;
align-items: center;
padding: 0 16px;
box-sizing: border-box;
font-weight: 400;
span {
margin-right: 8px;
font-size: 18px;
}
}
.amap-info-content {
width: 314px;
height: 243px;
background: #FFFFFF !important;
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px 0 #00000014, 0 9px 28px 8px #0000000d !important;
border-radius: 4px !important;
padding: 12px 0 !important;
overflow: hidden!important;
}
.custom-infowindow {
.title {
width: 100%;
font-weight: 600;
font-size: 16px;
color: #333333;
border-bottom: 1px solid #E5E5E5;
padding-left: 20px;
padding-bottom: 12px;
box-sizing: border-box;
}
.custom-item {
padding: 12px 20px;
box-sizing: border-box;
border-bottom: 1px solid #E5E5E5;
.item {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 12px;
span {
font-size: 14px;
color: #999999;
}
.item-text {
color: #000000a6;
}
}
}
.footer {
height: 48px;
width: 100%;
display: flex;
justify-content: flex-end;
align-items: center;
padding-right: 20px;
box-sizing: border-box;
div {
width: 44px;
height: 24px;
border: 1px solid #D1D1D1;
border-radius: 4px;
text-align: center;
line-height: 24px;
}
.cancel {
font-size: 14px;
color: #666666;
margin-right: 12px;
}
.confirm {
background: #5850FF;
color: #FFFFFF;
}
.del{
background: #5850FF;
color: #FFFFFF;
}
}
}
\ No newline at end of file \ No newline at end of file
...@@ -29,3 +29,4 @@ html { ...@@ -29,3 +29,4 @@ html {
display:flex; display:flex;
// align-items: center; // align-items: center;
} }
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
import Vue from 'vue' import Vue from 'vue'
import glsxDialog from '@/components/glsx-dialog/index.vue' import glsxDialog from '@/components/glsx-dialog/index.vue'
import GlsxCombiForm from '@/components/glsx-combi-form/index.vue' import GlsxCombiForm from '@/components/glsx-combi-form/index.vue'
import MapContainer from '@/components/map-container/index.vue'
Vue.component('glsx-dialog', glsxDialog) Vue.component('glsx-dialog', glsxDialog)
Vue.component('GlsxCombiForm', GlsxCombiForm) Vue.component('GlsxCombiForm', GlsxCombiForm)
Vue.component('MapContainer', MapContainer)
\ No newline at end of file \ No newline at end of file
export default function ContextMenu(map) {
var me = this
//地图中添加鼠标工具MouseTool插件
this.mouseTool = new AMap.MouseTool(map)
this.contextMenuPositon = null
var content = []
content.push("<div class='info context_menu'>")
content.push(" <p onclick='menu.addMarkerMenu()'>新增车位标记</p>")
content.push('</div>')
//通过content自定义右键菜单内容
this.contextMenu = new AMap.ContextMenu({ isCustom: true, content: content.join('') })
//地图绑定鼠标右击事件——弹出右键菜单
map.on('rightclick', function(e) {
me.contextMenu.open(map, e.lnglat)
me.contextMenuPositon = e.lnglat //右键菜单位置
})
}
ContextMenu.prototype.zoomMenu = function zoomMenu(tag) {
//右键菜单缩放地图
if (tag === 0) {
map.zoomOut()
}
if (tag === 1) {
map.zoomIn()
}
this.contextMenu.close()
}
ContextMenu.prototype.distanceMeasureMenu = function() {
//右键菜单距离量测
this.mouseTool.rule()
this.contextMenu.close()
}
ContextMenu.prototype.addMarkerMenu = function() {
//右键菜单添加Marker标记
this.mouseTool.close()
var marker = new AMap.Marker({
map: map,
position: this.contextMenuPositon || map.getCenter() //基点位置
})
this.contextMenu.close()
}
...@@ -11,6 +11,7 @@ import Vue from 'vue' ...@@ -11,6 +11,7 @@ import Vue from 'vue'
import apis from './api' import apis from './api'
import './public-path' import './public-path'
import '@/assets/css/public.scss' import '@/assets/css/public.scss'
import '@/assets/css/marker.scss'
import '@/components' import '@/components'
import { start } from '@/setup' import { start } from '@/setup'
Vue.config.productionTip = false Vue.config.productionTip = false
......
...@@ -7,6 +7,11 @@ const staticRoutes = Object.freeze([{ ...@@ -7,6 +7,11 @@ const staticRoutes = Object.freeze([{
path: '/Radar/index', path: '/Radar/index',
component: resolve => require([`@/views/Radar/index.vue`], resolve), component: resolve => require([`@/views/Radar/index.vue`], resolve),
meta: {} meta: {}
}, }, {
name: 'radar',
path: '/Map/index',
component: resolve => require([`@/views/Map/index.vue`], resolve),
meta: {}
}
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
<template>
<map-container width="100%" height='100%'></map-container>
</template>
<script>
export default {}
</script>
<style>
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!