|
@@ -332,39 +332,21 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function initMap() {
|
|
function initMap() {
|
|
|
- var center = new TMap.LatLng(31.228721, 121.524761);
|
|
|
|
|
- //初始化地图
|
|
|
|
|
- map.value = new TMap.Map("map-container", {
|
|
|
|
|
- zoom: 12, //设置地图缩放级别
|
|
|
|
|
- center: center, //设置地图中心点坐标
|
|
|
|
|
|
|
+ map.value = new AMap.Map("map-container", {
|
|
|
|
|
+ zoom: 11, //级别
|
|
|
|
|
+ center: [121.524761, 31.228721], //中心点坐标
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function setShipMarker(longitude, latitude) {
|
|
|
|
|
- var marker = new TMap.MultiMarker({
|
|
|
|
|
- id: "marker-layer", //图层id
|
|
|
|
|
- map: map.value,
|
|
|
|
|
- styles: {
|
|
|
|
|
- //点标注的相关样式
|
|
|
|
|
- marker: new TMap.MarkerStyle({
|
|
|
|
|
- width: 25,
|
|
|
|
|
- height: 35,
|
|
|
|
|
- anchor: { x: 16, y: 32 },
|
|
|
|
|
- src: "https://hhd-pat-1255802371.cos.ap-shanghai.myqcloud.com/frontend/ship-red-icon.png",
|
|
|
|
|
- }),
|
|
|
|
|
- },
|
|
|
|
|
- geometries: [
|
|
|
|
|
- {
|
|
|
|
|
- //点标注数据数组
|
|
|
|
|
- id: "demo",
|
|
|
|
|
- styleId: "marker",
|
|
|
|
|
- position: new TMap.LatLng(31.228721, 121.524761),
|
|
|
|
|
- properties: {
|
|
|
|
|
- title: "marker",
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ function setShipMarker(longitude = 121.524761, latitude = 31.228721) {
|
|
|
|
|
+ var marker = new AMap.Marker({
|
|
|
|
|
+ position: new AMap.LngLat(longitude, latitude),
|
|
|
|
|
+ // offset: new AMap.Pixel(-10, -10),
|
|
|
|
|
+ size: new AMap.Size(80, 80),
|
|
|
|
|
+ icon: "https://hhd-pat-1255802371.cos.ap-shanghai.myqcloud.com/frontend/ship-red-icon.png", // 添加 Icon 图标 URL
|
|
|
|
|
+ title: "北京",
|
|
|
});
|
|
});
|
|
|
|
|
+ map.value.add(marker);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let disabledStatus = ref(true);
|
|
let disabledStatus = ref(true);
|