fix a bug where selecting a not-yet-loaded place on a list map would not pan but zoom to that place
This commit is contained in:
parent
02838540db
commit
7eb73dd4fb
3 changed files with 9 additions and 7 deletions
|
@ -1,5 +1,4 @@
|
||||||
Ox.load('UI', {debug: true}, function() {
|
Ox.load({UI: {}, Geo:{}}, function() {
|
||||||
Ox.load('Geo', function() {
|
|
||||||
|
|
||||||
var $body = $("body"),
|
var $body = $("body"),
|
||||||
$panel = $("<div>")
|
$panel = $("<div>")
|
||||||
|
@ -1202,5 +1201,4 @@ Ox.load('Geo', function() {
|
||||||
})
|
})
|
||||||
.appendTo($panel);
|
.appendTo($panel);
|
||||||
|
|
||||||
});
|
|
||||||
});
|
});
|
|
@ -769,7 +769,7 @@ Ox.Map = function(options, self) {
|
||||||
self.$findInput.options({value: self.options.find})
|
self.$findInput.options({value: self.options.find})
|
||||||
.triggerEvent('submit', {value: self.options.find});
|
.triggerEvent('submit', {value: self.options.find});
|
||||||
} else if (self.options.selected) {
|
} else if (self.options.selected) {
|
||||||
selectPlace(self.options.selected);
|
selectPlace(self.options.selected, true);
|
||||||
} else {
|
} else {
|
||||||
mapBounds && self.map.fitBounds(mapBounds);
|
mapBounds && self.map.fitBounds(mapBounds);
|
||||||
///*
|
///*
|
||||||
|
@ -1058,7 +1058,7 @@ Ox.Map = function(options, self) {
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectPlace(id) {
|
function selectPlace(id, zoom) {
|
||||||
// id can be null (deselect)
|
// id can be null (deselect)
|
||||||
var place,
|
var place,
|
||||||
selected = getSelectedMarker();
|
selected = getSelectedMarker();
|
||||||
|
@ -1087,7 +1087,11 @@ Ox.Map = function(options, self) {
|
||||||
}, result.data.items[0])).add();
|
}, result.data.items[0])).add();
|
||||||
self.places.push(place);
|
self.places.push(place);
|
||||||
select();
|
select();
|
||||||
zoomToPlace();
|
if (zoom) {
|
||||||
|
zoomToPlace();
|
||||||
|
} else {
|
||||||
|
panToPlace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,7 +185,7 @@ Ox.MapMarker = function(options) {
|
||||||
// workaround to prevent marker from appearing twice
|
// workaround to prevent marker from appearing twice
|
||||||
// after setting draggable from true to false (google maps bug)
|
// after setting draggable from true to false (google maps bug)
|
||||||
var fix = that.marker.getDraggable() && !that.place.editing;
|
var fix = that.marker.getDraggable() && !that.place.editing;
|
||||||
Ox.print('setOptions, that.map: ', that.map)
|
//Ox.print('setOptions, that.map: ', that.map)
|
||||||
if (that.map.options('showTypes')) {
|
if (that.map.options('showTypes')) {
|
||||||
that.color = typeColor[that.place.type];
|
that.color = typeColor[that.place.type];
|
||||||
that.size = 8;
|
that.size = 8;
|
||||||
|
|
Loading…
Reference in a new issue