shift click to join places, part 2
This commit is contained in:
parent
4d449232d5
commit
bf64450ada
1 changed files with 8 additions and 3 deletions
|
@ -382,10 +382,10 @@ Ox.Map = function(options, self) {
|
||||||
|
|
||||||
function addPlaceToMap(place) {
|
function addPlaceToMap(place) {
|
||||||
// via find, click, or new place button
|
// via find, click, or new place button
|
||||||
var exists = false;
|
var bounds, exists = false;
|
||||||
if (!place) {
|
if (!place) {
|
||||||
var bounds = self.map.getBounds(),
|
bounds = self.map.getBounds();
|
||||||
center = self.map.getCenter(),
|
var center = self.map.getCenter(),
|
||||||
southwest = new google.maps.LatLngBounds(
|
southwest = new google.maps.LatLngBounds(
|
||||||
bounds.getSouthWest(), center
|
bounds.getSouthWest(), center
|
||||||
).getCenter(),
|
).getCenter(),
|
||||||
|
@ -408,6 +408,11 @@ Ox.Map = function(options, self) {
|
||||||
north: northeast.lat(),
|
north: northeast.lat(),
|
||||||
east: northeast.lng()
|
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) {
|
Ox.forEach(self.places, function(p, i) {
|
||||||
if (place.bounds.equals(p.bounds)) {
|
if (place.bounds.equals(p.bounds)) {
|
||||||
|
|
Loading…
Reference in a new issue