1
0
Fork 0
forked from 0x2620/oxjs

improved geodata and tools

This commit is contained in:
rolux 2011-05-23 21:38:52 +02:00
commit 912f2121a4
47 changed files with 682294 additions and 3535 deletions

View file

@ -101,9 +101,9 @@ Ox.ListMap = function(options, self) {
{
align: 'right',
format: {type: 'area', args: [0]},
id: 'size',
id: 'area',
operator: '-',
title: 'Size',
title: 'Area',
visible: true,
width: 128
},

View file

@ -525,7 +525,9 @@ Ox.Map = function(options, self) {
callback = point;
point = self.map.getCenter();
}
Ox.print('CALLING ZOOM SERVICE', point.lat(), point.lng())
self.maxZoomService.getMaxZoomAtLatLng(point, function(data) {
Ox.print('ZOOM SERVICE', data.status, data.zoom)
callback(data.status == 'OK' ? data.zoom : null);
});
}
@ -660,6 +662,7 @@ Ox.Map = function(options, self) {
}
mapBounds = i == 0 ? bounds : mapBounds.union(bounds);
});
Ox.print('BOUNDS', mapBounds.getSouthWest(), mapBounds.getNorthEast(), mapBounds.getCenter())
self.center = mapBounds ? mapBounds.getCenter() : new google.maps.LatLng(0, 0);
self.zoom = 1; // fixme: should depend on height
that.map = self.map = new google.maps.Map(self.$map.$element[0], {
@ -722,7 +725,7 @@ Ox.Map = function(options, self) {
}
if (self.centerChanged) {
getMaxZoom(function(zoom) {
if (zoom != self.maxZoom) {
if (zoom && zoom != self.maxZoom) {
self.maxZoom = zoom;
if (self.map.getZoom() > zoom) {
self.map.setZoom(zoom);