From 1e166359b89282efa5725af35d7be1ed8310a1c6 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 14 Jun 2011 17:03:26 +0200 Subject: [PATCH] shift click to join places, part 8 --- source/Ox.UI/js/Map/Ox.ListMap.js | 4 +++- source/Ox.UI/js/Map/Ox.MapMarker.js | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index cb9c21e9..477faa8c 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -516,7 +516,9 @@ Ox.ListMap = function(options, self) { }) .css({float: 'left', margin: '4px 2px 4px 4px'}) .bindEvent({ - click: self.$map.newPlace + click: function() { + self.$map.newPlace(); + } }) .appendTo(self.$placeStatusbar); diff --git a/source/Ox.UI/js/Map/Ox.MapMarker.js b/source/Ox.UI/js/Map/Ox.MapMarker.js index f8bc61be..48668a32 100644 --- a/source/Ox.UI/js/Map/Ox.MapMarker.js +++ b/source/Ox.UI/js/Map/Ox.MapMarker.js @@ -54,9 +54,15 @@ Ox.MapMarker = function(options) { function click() { if (!that.place.selected) { if (that.map.getKey() == 'shift') { - var bounds = that.map.getSelectedPlace().bounds.union(that.place.bounds), - southWest = bounds.getSouthWest(), - northEast = bounds.getNorthEast(); + var place = that.map.getSelectedPlace(), + bounds = new google.maps.LatLngBounds( + new google.maps.LatLng(place.south, place.west), + new google.maps.LatLng(place.north, place.east) + ), + southWest, northEast; + bounds = bounds.union(that.place.bounds); + southWest = bounds.getSouthWest(); + northEast = bounds.getNorthEast(); that.map.newPlace(new Ox.MapPlace({ // fixme: duplicated, see Ox.Map.js alternativeNames: [],