shift click to join places, part 4

This commit is contained in:
rolux 2011-06-14 16:45:29 +02:00
parent 6162b0cc33
commit 466293b2f9
2 changed files with 2 additions and 6 deletions

View file

@ -381,7 +381,8 @@ Ox.Map = function(options, self) {
} }
function addPlaceToMap(place) { function addPlaceToMap(place) {
// via find, click, or new place button // via find, click, shift-click, or new place button
Ox.print('addPlaceToMap', place)
var exists = false; var exists = false;
if (!place) { if (!place) {
var bounds = self.map.getBounds(), var bounds = self.map.getBounds(),
@ -398,8 +399,6 @@ Ox.Map = function(options, self) {
editable: true, editable: true,
geoname: '', geoname: '',
id: '_' + Ox.encodeBase32(Ox.uid()), // fixme: stupid id: '_' + Ox.encodeBase32(Ox.uid()), // fixme: stupid
lat: center.lat(),
lng: center.lng(),
map: that, map: that,
name: '', name: '',
type: 'feature', type: 'feature',

View file

@ -55,12 +55,9 @@ Ox.MapMarker = function(options) {
if (!that.place.selected) { if (!that.place.selected) {
if (that.map.getKey() == 'shift') { if (that.map.getKey() == 'shift') {
var bounds = that.map.getSelectedPlace().bounds.union(that.place.bounds), var bounds = that.map.getSelectedPlace().bounds.union(that.place.bounds),
center = bounds.getCenter(),
southWest = bounds.getSouthWest(), southWest = bounds.getSouthWest(),
northEast = bounds.getNorthEast(); northEast = bounds.getNorthEast();
that.map.newPlace(new Ox.MapPlace({ that.map.newPlace(new Ox.MapPlace({
lat: center.lat(),
lng: center.lng(),
south: southWest.lat(), south: southWest.lat(),
west: southWest.lng(), west: southWest.lng(),
north: northEast.lat(), north: northEast.lat(),