forked from 0x2620/oxjs
improved geodata and tools
This commit is contained in:
parent
4d9a8537ef
commit
912f2121a4
47 changed files with 682294 additions and 3535 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue