I want to set the variable zoom as the map.GetZoom() but I have been getting the following error in both Chrome and Firefox:
Chrome
Uncaught TypeError: Object # has no method ‘getZoom’
Firefox
gmap.getZoom is not a function
zoom = gmap.getZoom();
First question What error did I make in my codes?
default.js
window.gmap = {
zoom_Changed: function() {
zoom = gmap.getZoom();
if(zoom > 15) {
document.write("hello");
} else {
}
}
};
Edit: Gmap is defined in my views.py and the zoom_Changed function is for the event listener in my views.py.
views.py
maps.event.addListener(gmap, 'zoom_changed', 'gmap.zoom_Changed');
Instead of
zoom = gmap.getZoom();, it should bezoom = this.getZoom();.