don't throw errors when resizing uninitialized map (fixes #480, interestingly)
This commit is contained in:
parent
8ab8d8d67a
commit
476f8b8d26
2 changed files with 19 additions and 15 deletions
|
@ -1518,21 +1518,24 @@ Ox.Map = function(options, self) {
|
||||||
|
|
||||||
self.options.height = that.$element.height();
|
self.options.height = that.$element.height();
|
||||||
self.options.width = that.$element.width();
|
self.options.width = that.$element.width();
|
||||||
self.mapHeight = getMapHeight();
|
// check if map has initialized
|
||||||
self.minZoom = getMinZoom();
|
if (self.map) {
|
||||||
if (self.minZoom > self.map.getZoom()) {
|
self.mapHeight = getMapHeight();
|
||||||
self.map.setZoom(self.minZoom);
|
self.minZoom = getMinZoom();
|
||||||
|
if (self.minZoom > self.map.getZoom()) {
|
||||||
|
self.map.setZoom(self.minZoom);
|
||||||
|
}
|
||||||
|
self.$map.css({
|
||||||
|
height: self.mapHeight + 'px',
|
||||||
|
width: self.options.width + 'px'
|
||||||
|
});
|
||||||
|
self.options.zoombar && self.$zoomInput.options({
|
||||||
|
size: self.options.width
|
||||||
|
});
|
||||||
|
updateFormElements();
|
||||||
|
Ox.print('triggering google maps resize event, height', self.options.height)
|
||||||
|
google.maps.event.trigger(self.map, 'resize');
|
||||||
}
|
}
|
||||||
self.$map.css({
|
|
||||||
height: self.mapHeight + 'px',
|
|
||||||
width: self.options.width + 'px'
|
|
||||||
});
|
|
||||||
self.options.zoombar && self.$zoomInput.options({
|
|
||||||
size: self.options.width
|
|
||||||
});
|
|
||||||
updateFormElements();
|
|
||||||
Ox.print('triggering google maps resize event, height', self.options.height)
|
|
||||||
google.maps.event.trigger(self.map, 'resize');
|
|
||||||
return that;
|
return that;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -524,7 +524,8 @@ Ox.AnnotationFolder = function(options, self) {
|
||||||
self.editing = false;
|
self.editing = false;
|
||||||
}
|
}
|
||||||
if (value && self.options.collapsed) {
|
if (value && self.options.collapsed) {
|
||||||
self.$panel.options({collapsed: false});
|
//self.$panel.options({collapsed: false});
|
||||||
|
toggleLayer();
|
||||||
}
|
}
|
||||||
self.$annotations.options({selected: value});
|
self.$annotations.options({selected: value});
|
||||||
} else if (key == 'sort') {
|
} else if (key == 'sort') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue