Commit 584650bd by hanjixin

infoWindow.setAnchor(`${updown}-${leftright}`)

parent 2d5b9bd7
......@@ -104,7 +104,6 @@ class Map3D {
_renderClusterMarker(context, markers.length,icon);
}
});
var res = await Promise.all(markers)
return res
}
......@@ -195,7 +194,10 @@ class Map3D {
marker._data = item
marker.on('click', (params) => {
console.log(item, params);
let updown = map3d.map.getCenter().lat>parseFloat(item.lat)?'bottom':'top'
let leftright = map3d.map.getCenter().lng>parseFloat(item.lon)?'left':'right'
infoWindow.setAnchor(`${updown}-${leftright}`)
infoWindow.open(this.map, marker.getPosition());
})
......@@ -261,6 +263,9 @@ class Map3D {
marker._data = item
marker.on('click', (params) => {
console.log(item, params);
let updown = map3d.map.getCenter().lat>parseFloat(item.lat)?'bottom':'top'
let leftright = map3d.map.getCenter().lng>parseFloat(item.lon)?'left':'right'
infoWindow.setAnchor(`${updown}-${leftright}`)
infoWindow.open(this.map, marker.getPosition());
})
......@@ -398,6 +403,9 @@ class Map3D {
marker._data = item
marker.on('click', (params) => {
console.log(item, params);
let updown = map3d.map.getCenter().lat>parseFloat(item.lat)?'bottom':'top'
let leftright = map3d.map.getCenter().lng>parseFloat(item.lon)?'left':'right'
infoWindow.setAnchor(`${updown}-${leftright}`)
infoWindow.open(this.map, marker.getPosition());
})
......
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 sign in to comment