移动端简单支持
This commit is contained in:
parent
7496c9bb37
commit
b12e066b7a
@ -261,7 +261,7 @@ function search() {
|
||||
// text,
|
||||
})
|
||||
|
||||
marker.on('mouseover', (e) => {
|
||||
function show(e) {
|
||||
let position = e.data.data && e.data.data.position;
|
||||
|
||||
if (position) {
|
||||
@ -284,11 +284,16 @@ function search() {
|
||||
data.tmpMarker.setPosition(position);
|
||||
map.add(data.tmpMarker);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
marker.on('mouseout', () => {
|
||||
function hide() {
|
||||
map.remove(data.tmpMarker);
|
||||
});
|
||||
}
|
||||
|
||||
marker.on('mouseover', (e)=>show(e));
|
||||
marker.on('touchstart', (e)=>show(e));
|
||||
marker.on('mouseout', ()=>hide());
|
||||
marker.on('touchend', ()=>hide());
|
||||
|
||||
return marker;
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user