From a369d0170d5b6fff915196b6076b93dc0e72373f Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 1 Jun 2011 15:51:35 +0200 Subject: [PATCH] update map --- source/Ox.UI/js/List/Ox.List.js | 4 ++-- source/Ox.UI/js/Map/Ox.Map.js | 8 +++++++- source/Ox.UI/js/Map/Ox.MapPlace.js | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index cbaadf07..ff00ddbb 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -1111,8 +1111,8 @@ Ox.List = function(options, self) { self.options.items({ positions: [id], sort: self.options.sort - }, function(results) { - pos = results.data.positions[id]; + }, function(result) { + pos = result.data.positions[id]; select(pos, i); }); } diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index c485c795..31c97ee0 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -1297,8 +1297,14 @@ Ox.Map = function(options, self) { that.value = function(id, key, value) { // fixme: should be like the corresponding List/TextList/etc value function Ox.print('Map.value', id, key, value) - getPlaceById(id)[key] = value; + var place = getPlaceById(id); + place[key] = value; Ox.print('...', getPlaceById(id)) + if ([ + 'type', 'lat', 'lng', 'south', 'west', 'north', 'east' + ].indexOf(key) > -1) { + place.marker.options(key, value); + } } that.zoomToPlace = function() { diff --git a/source/Ox.UI/js/Map/Ox.MapPlace.js b/source/Ox.UI/js/Map/Ox.MapPlace.js index 1834c402..86537b7d 100644 --- a/source/Ox.UI/js/Map/Ox.MapPlace.js +++ b/source/Ox.UI/js/Map/Ox.MapPlace.js @@ -149,7 +149,8 @@ Ox.MapPlace = function(options) { // fixme: make this an Ox.Element to get options handling for free? that.options = function(options) { - Ox.forEach(function(value, key) { + options = Ox.makeOptions(arguments); + Ox.forEach(options, function(value, key) { that.key = value; }); update();