hzq-map
v1.0.112
Published
<!-- 例子:获取地图key和地图场景配置 --> <!-- 需要传应用key:appkey,和新建的场景名称:sceneName,container:是id为container的div盒子 --> const da = { appkey: '3da255189acebf77386fd9811c9e2f88', sceneName: '场景2', } const res = await setMap(da, 'container', [113.290326, 23.108727])
Downloads
8
Readme
const da = { appkey: '3da255189acebf77386fd9811c9e2f88', sceneName: '场景2', } const res = await setMap(da, 'container', [113.290326, 23.108727]) map.value = res.maps AMap.value = res.AMaps
let trafficLayer = new AMap.value.TileLayer.Traffic({
zIndex: 10,
zooms: [7, 22],
})
trafficLayer.setMap(map.value)
let satelliteLayer = new AMap.value.TileLayer.Satellite({
zIndex: 11,
zooms: [7, 22],
})
satelliteLayer.setMap(map.value)
const da = {
appKey: '3da255189acebf77386fd9811c9e2f88',
headers: {
Authorization: 'Bearer kAuSAVkJpMhE8saLDF3dNwhnBMXCLcjEvYIyfnkgKuqvvLYHnUkVBAtuPMq5fQwy',
},
params: {},
resName: '救援车',
}
const markerAlarm = await setMapAssets(map.value, AMap.value, da, (item: any, markerItem: any, ev) => {
console.log('wwwwwwwwwwwwwwwww', item, markerItem, ev)
markerItem.setLabel({
direction: 'top',
offset: new AMap.value.Pixel(10, 0), //设置文本标注偏移量
content: <div class='info'>我是司机${item.name}</div>
, //设置文本标注内容
})
map.value.setZoom(map.value.getZoom() + 1)
})