Using the following code to try and display a custom control on the maps:
var myCustomControlDiv = document.createElement('div');
var myCustomControl = new MyCustomControl(myCustomControlDiv);
$('#map_canvas').gmap('addControl', 'myCustomControl', google.maps.ControlPosition.LEFT_TOP);
function MyCustomControl(controlDiv) {
var control = this;
var testBtn = document.createElement('div');
testBtn.id = 'testBtn';
testBtn.innerHTML = 'Alert!';
controlDiv.appendChild(testBtn);
// wire up jquery click
$(testBtn).click(function () {
alert('jquery click event');
});
// wire up jquery hover
$(testBtn).hover(function () {
$(this).toggleClass('btnHover');
});
}
The control will not appear for some reason. I couldn't find any good examples
of this and was hoping you could help me out.
Original issue reported on code.google.com by raged...@students.ipfw.edu on 16 Feb 2012 at 8:34
Original issue reported on code.google.com by
raged...@students.ipfw.edu
on 16 Feb 2012 at 8:34