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

地图修改暂存

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