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