本文介绍了如何使用Bing地图API temporaily阻止地图缩放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Bing地图API,我必须阻止temporaily变焦。普莱舍告诉我该怎么做,使用Java脚本?我relize我必须阻止某些关键控制和去除+ / - 从默认冰地图控制按钮
I am using Bing Maps API and I have to temporaily block zoom. Plese tell me how to do that using Java Script? I relize that I have to block some key controls and remove + / - buttons from default Bing Map controls.
Edit(编辑)
要隐藏controlls我可以使用VEMap.HideDashboard方法。
但如何阻止某些键的反应?我必须重载一些方法?
Edit;To hide controlls I can use VEMap.HideDashboard Method.But how to block response for some keys? Do I have to overload some methods?
推荐答案
您可以覆盖在地图上的事件是这样的:
You could override the events on map like this:
var bloc_zoom = false;
var bloc_pan = false;
function PaintMap()
{
var VEMap = new VEMap(MapDivId);
VEMap.AttachEvent("ondoubleclick", block_zoom);
VEMap.AttachEvent("onkeydown", block_zoom);
VEMap.AttachEvent("onmousedown", block_pan);
VEMap.AttachEvent("onmousewheel", block_zoom);
}
function block_zoom(e)
{
if(block_zoom)
{
return true ;
}
}
function block_pan(e)
{
if(block_pan)
{
return true ;
}
}
刚上标志时,转要阻止金额和/或平移
Just turn on the flag when you want to block sum and/or Pan
这篇关于如何使用Bing地图API temporaily阻止地图缩放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!