Commit 200143e5 authored by 郭铭瑶's avatar 郭铭瑶 🤘

地图修改暂存

parent 442972d1
......@@ -14,7 +14,7 @@
<!-- <script src="/SMap.min.js"></script> -->
<!-- <script src="/dev/SMap.min.js"></script> -->
<!-- <script src="/Plugins.min.js"></script> -->
<!-- <script src="/hls.js"></script> -->
<script src="/hls.js"></script>
<script type="module" src="/src/main.ts"></script>
</body>
......
......@@ -36,6 +36,7 @@ export default defineComponent({
let map: any = null
function initMap(config?: any) {
map = new JMap()
window.jMap = map
map.createMap(
'MapContainer',
'6b446c2db7094389aef2acb11e9cd27b',
......@@ -55,7 +56,10 @@ export default defineComponent({
map_complete_callback: function () {
ctx.emit('complete', map)
// addListener()
hideCommunity()
// hideCommunity()
map.queryDistrict('南京东路街道')
map.switchBuildingModel('BM_G_JianLan,BM_D_JianLan')
// map.switchBuildingModel('BM_qianlan_bai')
},
}
)
......@@ -260,7 +264,7 @@ export default defineComponent({
url: item.icon || icon,
width: sizeProp[0],
height: sizeProp[1],
pixelOffset: [0, -13],
pixelOffset: [0, 0],
},
label: {
text: labelKey ? (item[labelKey] || item[key]) + '' : '',
......@@ -297,7 +301,7 @@ export default defineComponent({
// 删除点
function remove(points?: string[]) {
if (!map) return
map.Locate.clearLocate(points)
points && map.Locate.clearLocate(points)
}
// 添加线状覆盖物
......
......@@ -25,29 +25,30 @@
jMap.Locate.pointLocate([{
id: "100001",
position: {
x: 121.47953245042869, y: 31.23356958247664, z: 0
x: 121.46948524003477, y: 31.240552337919738, z: 0
},
attributes: {
name: "黄浦区大数据中心",
name: "贵州路263号",
description: "测试自定义字段信息"
},
label: {
text: "黄浦区大数据中心",
text: "贵州路263号",
font: "16px Helvetica",
color: "rgb(135, 206, 235, 1)",
pixelOffset: [0, -50]
},
image: {
url: "http://localhost:3002/star.png",
width: 29.5,
height: 48.5,
pixelOffset: [0, -13]
width: 14,
height: 14,
pixelOffset: [0, 0]
}
}], {
isZoom: false,
click: (res) => {
},
})
console.log('---', CoordUtil.gcj02towgs84(121.474008, 31.238613))
},
map_left_click_callback: function (obj, type, movement) {
......
......@@ -116,9 +116,6 @@ export default defineComponent({
}
})
const { handleMapComplete, selectArea, handleZoom } = useSwitchMap(map)
// function handleMapComplete() {}
// function selectArea() {}
// function handleZoom() {}
const onMapClick = (data: any) => {
console.log('click: ', data)
}
......
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