1
0
Fork 0
forked from 0x2620/oxjs
This commit is contained in:
rlx 2011-03-05 10:48:01 +00:00
commit dc86a5c53e
2 changed files with 137 additions and 114 deletions

View file

@ -9462,25 +9462,24 @@ requires
self.$statusbar = new Ox.Bar({
size: 24
})
.css({padding: '2px'})
.appendTo(that);
self.$placeNameInput = new Ox.Input({
placeholder: 'Name',
width: Math.floor((self.options.width - 112) / 2)
})
.css({float: 'left', margin: '2px'})
.css({float: 'left', margin: '4px 2px 4px 4px'})
.appendTo(self.$statusbar);
self.$placeGeonameInput = new Ox.Input({
placeholder: 'Geoname',
width: Math.ceil((self.options.width - 112) / 2)
})
.css({float: 'left', margin: '2px'})
.css({float: 'left', margin: '4px 2px 4px 2px'})
.appendTo(self.$statusbar)
self.$placeButton = new Ox.Button({
title: 'New Place',
width: 96
})
.css({float: 'left', margin: '2px'})
.css({float: 'left', margin: '4px 4px 4px 2px'})
.bindEvent({
click: clickPlaceButton
})
@ -9839,6 +9838,29 @@ requires
function mapChanged() {
// gets called after panning or zooming
Ox.print('mapChanged');
var bounds, places
if (self.boundsChanged) {
/*
bounds = self.map.getBounds();
places = Ox.clone(self.places).filter(function(place) {
return bounds.contains(place.center);
});
if (places.length > 100) {
places.sort(function(a, b) {
return a.size < b.size ? 1 : (a.size > b.size ? -1 : 0);
});
}
self.places.forEach(function(place) {
place.remove();
});
places.forEach(function(place, i) {
if (i < 100) {
place.add();
}
});
*/
self.boundsChanged = false;
}
if (self.centerChanged) {
getMaxZoom(function(zoom) {
if (zoom != self.maxZoom) {
@ -9846,10 +9868,11 @@ requires
constructZoomInput();
}
});
self.centerChanged = false;
}
if (self.zoomChanged) {
self.zoomChanged = false;
}
self.boundsChanged = false;
self.centerChanged = false;
self.zoomChanged = false;
}
function pan(x, y) {