1
0
Fork 0
forked from 0x2620/oxjs

various annotation-related bugfixes

This commit is contained in:
rlx 2012-01-27 19:59:11 +05:30
commit a7a3f167c9
10 changed files with 135 additions and 75 deletions

View file

@ -40,6 +40,7 @@ Ox.Map <function> Basic map object
statusbar <b|false> If true, the map has a statusbar
toolbar <b|false> If true, the map has a toolbar
zoombar <b|false> If true, the map has a zoombar
zoomOnlyWhenFocused <b|false> If true, scroll-zoom only when focused
self <o|{}> Shared private variable
# EVENTS -------------------------------------------------------------------
addplace <!> Fires when a place has been added
@ -110,15 +111,19 @@ Ox.Map = function(options, self) {
showTypes: false,
statusbar: false, // FIXME: showStatusbar
toolbar: false, // FIXME: showToolbar
zoombar: false // FIXME: showZoombar
zoombar: false, // FIXME: showZoombar
zoomOnlyWhenFocused: false
// fixme: width, height
})
.options(options || {})
.addClass('OxMap')
.click(function(e) {
!$(e.target).is('input') && that.gainFocus();
})
.bindEvent({
gainfocus: function() {
self.options.zoomOnlyWhenFocused && self.map.setOptions({scrollwheel: true});
},
losefocus: function() {
self.options.zoomOnlyWhenFocused && self.map.setOptions({scrollwheel: false});
},
key_0: function() {
panToPlace()
},
@ -181,7 +186,10 @@ Ox.Map = function(options, self) {
key_up: function() {
pan(0, -1);
},
key_z: undo
key_z: undo,
mousedown: function(e) {
!$(e.target).is('input') && that.gainFocus();
}
});
self.isAsync = Ox.isFunction(self.options.places);
@ -808,6 +816,7 @@ Ox.Map = function(options, self) {
disableDoubleClickZoom: true,
mapTypeId: google.maps.MapTypeId[getMapType()],
noClear: true,
scrollwheel: !self.options.zoomOnlyWhenFocused,
zoom: self.zoom
});
google.maps.event.addListener(self.map, 'bounds_changed', boundsChanged);