From 6162b0cc33ec7de686cb235f855ab7765399fed6 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 14 Jun 2011 16:41:20 +0200 Subject: [PATCH] shift click to join places, part 3 --- source/Ox.UI/js/Map/Ox.Map.js | 11 +++-------- source/Ox.UI/js/Map/Ox.MapMarker.js | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index 0bdcb98c..2a12507e 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -382,10 +382,10 @@ Ox.Map = function(options, self) { function addPlaceToMap(place) { // via find, click, or new place button - var bounds, exists = false; + var exists = false; if (!place) { - bounds = self.map.getBounds(); - var center = self.map.getCenter(), + var bounds = self.map.getBounds(), + center = self.map.getCenter(), southwest = new google.maps.LatLngBounds( bounds.getSouthWest(), center ).getCenter(), @@ -408,11 +408,6 @@ Ox.Map = function(options, self) { north: northeast.lat(), east: northeast.lng() }); - } else { - bounds = new google.maps.LatLngBounds( - new google.maps.LatLng(place.south, place.west), - new google.maps.LatLng(place.north, place.east) - ); } Ox.forEach(self.places, function(p, i) { if (place.bounds.equals(p.bounds)) { diff --git a/source/Ox.UI/js/Map/Ox.MapMarker.js b/source/Ox.UI/js/Map/Ox.MapMarker.js index 86e8b0fd..8becf1e6 100644 --- a/source/Ox.UI/js/Map/Ox.MapMarker.js +++ b/source/Ox.UI/js/Map/Ox.MapMarker.js @@ -58,14 +58,14 @@ Ox.MapMarker = function(options) { center = bounds.getCenter(), southWest = bounds.getSouthWest(), northEast = bounds.getNorthEast(); - that.map.newPlace({ + that.map.newPlace(new Ox.MapPlace({ lat: center.lat(), lng: center.lng(), south: southWest.lat(), west: southWest.lng(), north: northEast.lat(), east: northEast.lng() - }); + })); } else { that.map.options({selected: that.place.id}); }