0
嗨,那裏我有3個按鈕叫1.ADD,2.EDIT,3.DELETE .....和地圖id = comp_map ...我是使用開放街道地圖....如何啓用一個功能,只有在點擊一個特定的條件
function addComp() {
$("#comp_map").click(function() {
if (event.type !== 'mousemove') {
var containerPoint = comp_map.mouseEventToContainerPoint(event),
layerPoint = comp_map.containerPointToLayerPoint(containerPoint),
latlng = comp_map.layerPointToLatLng(layerPoint)
alert("Marker Location: "+latlng);
}
});
}
function editComp() {
// disable the map click
}
function delComp() {
// disable the map click
}
我的問題是我要的是點擊添加按鈕,只有當$("#comp_map").click
工作...但是當其他按鈕像編輯,刪除被點擊此功能不應該工作.. 。這是正確的方式做到這一點,或者如果我的方法是錯誤的,請糾正我...謝謝你...!
所以點擊地圖應根據哪個按鈕最近被點擊/活動而調用不同的功能?還是我誤解你的意圖? –
是的你是對的..... – troy