1
0
Fork 0
forked from 0x2620/oxjs

in manage places, make south/west/north/east editable directly (fixes #411)

This commit is contained in:
rlx 2012-02-21 09:37:50 +00:00
commit 8851a9c454
3 changed files with 15 additions and 50 deletions

View file

@ -1448,14 +1448,6 @@ Ox.Map = function(options, self) {
return that;
};
/*
that.editPlace = function(data) {
var place = getPlaceById(self.options.selected);
place.$marker.options(data);
return that;
};
*/
that.findPlace = function(name, callback) {
getPlaceByName(name, function(place) {
if (place) {
@ -1466,10 +1458,12 @@ Ox.Map = function(options, self) {
}
callback(place);
});
return that;
};
that.newPlace = function(place) {
addPlaceToMap(place);
return that;
};
that.panToPlace = function() {
@ -1484,41 +1478,8 @@ Ox.Map = function(options, self) {
};
that.resizeMap = function() {
/*
Ox.Log('Map', 'resizeMap', self.options.width, self.options.height);
var center = self.map.getCenter();
self.mapHeight = getMapHeight();
self.minZoom = getMinZoom();
that.css({
height: self.options.height + 'px',
width: self.options.width + 'px'
});
self.$map.css({
height: self.mapHeight + 'px',
width: self.options.width + 'px'
});
google.maps.event.trigger(self.map, 'resize');
self.map.setCenter(center);
*/
/*
Ox.Log('Map', 'Ox.Map.resizeMap()');
var center = self.map.getCenter();
self.options.height = that.$element.height();
self.options.width = that.$element.width();
Ox.Log('Map', self.options.width, self.options.height)
self.$map.css({
height: self.mapHeight + 'px',
width: self.options.width + 'px'
});
google.maps.event.trigger(self.map, 'resize');
self.map.setCenter(center);
self.options.zoombar && self.$zoomInput.options({
size: self.options.width
});
*/
// keep center on resize has been commented out
// var center = self.map.getCenter();
self.options.height = that.$element.height();
self.options.width = that.$element.width();
// check if map has initialized
@ -1536,15 +1497,17 @@ Ox.Map = function(options, self) {
size: self.options.width
});
updateFormElements();
Ox.print('triggering google maps resize event, height', self.options.height)
Ox.Log('Map', 'triggering google maps resize event, height', self.options.height)
google.maps.event.trigger(self.map, 'resize');
// self.map.setCenter(center);
}
return that;
}
that.value = function(id, key, value) {
// fixme: should be like the corresponding List/TextList/etc value function
Ox.print('Map', 'Map.value', id, key, value)
Ox.print('Map', 'Map.value', id, key, value);
getPlaceById(id).options(key, value);
if (id == self.options.selected) {
if (key == 'name') {
self.$placeControls.name.options({title: value});
@ -1556,7 +1519,7 @@ Ox.Map = function(options, self) {
);
}
}
getPlaceById(id).options(key, value);
return that;
}
that.zoomToPlace = function() {