//初始化地图....
//用于创建文字和代码的代码拉布勒;
var optionControlDiv = document.createElement('div');
optionControlDiv.id='options';
var optionControl = new OptionControl(optionControlDiv, map);
optionControlDiv.index = 1;
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(optionControlDiv);
var optionControlDivText = document.createElement('div');
optionControlDivText.id='optionss';
var optionControlText = new OptionControlText(optionControlDivText, map);
optionControlDivText.index = 2;
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(optionControlDivText);
//调用lable&的函数复选框
function OptionControl(controlDiv, map) {
controlDiv.style.padding = '5px';
controlDiv.style.right = '90px';
var controlUI = document.createElement('input');
controlUI.type="checkbox";
controlUI.id="arrowcheck";
google.maps.event.addDomListener(controlUI,'click',function(){
checkboxclicked();
// alert($('#arrowcheck').is(':checked'));
});
controlDiv.appendChild(controlUI);
}
function OptionControlText(controlDiv, map) {
controlDiv.style.padding = '8px';
controlDiv.style.right = '111px';
var controlUI = document.createElement('label');
controlUI.type="label";
controlUI.innerHTML="Lable";
controlDiv.appendChild(controlUI);
}
当我点击复选框
时,我正在调用checkboxclicked() function checkboxclicked()
{
alert($('#arrowcheck').is(':checked')); // its shows flase when i checked
}
答案 0 :(得分:0)