-/* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+/* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
and is published under the AGPL license. */
// avoid openlayers alerts
if (aPos.hasOwnProperty('lon') && aPos.hasOwnProperty('lat') && aPos.hasOwnProperty('zoom')) {
center = new OpenLayers.LonLat(parseFloat(aPos.lon), parseFloat(aPos.lat)).transform(WGS84, Mercator);
- zoom = parseInt(aPos.zoom);
+ zoom = parseInt(aPos.zoom, 10);
} else if (aPos.hasOwnProperty('minlon') && aPos.hasOwnProperty('minlat')
&& aPos.hasOwnProperty('maxlon') && aPos.hasOwnProperty('maxlat')) {
extent = new OpenLayers.Bounds(aPos.minlon, aPos.minlat, aPos.maxlon, aPos.maxlat)
} else {
this.map.setCenter(center, zoom);
}
+ this.resizeMap();
+ },
+
+ resizeMap: function() {
+ var map = $('map');
+ map.style.width = map.offsetWidth.toString() + 'px';
+ map.style.height = map.offsetHeight.toString() + 'px';
},
observer: function(evt) {
case 400:
case 404:
message = SyjStrings.requestError;
- if (transport.responseJSON) {
- switch (transport.responseJSON.message) {
- case "uniquepath":
- message = SyjStrings.uniquePathError;
- break;
- default:
- break;
- }
- }
break;
case 403:
message = "";
input = this.area.select('input[type="text"]')[0];
(function () {
input.activate();
- }).defer();
+ }.defer());
} else {
this.modalbox.hide();
}
return undefined;
}
};
+
+window.onresize = function() {
+ SYJView.resizeMap();
+};