]> dev.renevier.net Git - syj.git/blobdiff - public/js/syjraw.js
enable navigation in raw mode
[syj.git] / public / js / syjraw.js
index ec783f4d677685ddf82e1d4cb5fc5d267940e5eb..3606018658cb7560ab22918a3227e589ac221396 100644 (file)
@@ -11,9 +11,18 @@ var styleMap = {
     })
 };
 
+function resizeMap() {
+    var map = document.getElementById('map');
+    map.style.width = map.offsetWidth.toString() + 'px';
+    map.style.height = map.offsetHeight.toString() + 'px';
+}
+
 function init() {
     var map = new OpenLayers.Map('map', {
-                controls: [ new OpenLayers.Control.Attribution() ],
+                controls: [
+                    new OpenLayers.Control.Navigation(),
+                    new OpenLayers.Control.Attribution()
+                ],
                 theme: null}),
 
          baseLayer = new OpenLayers.Layer.OSM("OSM", null, { attribution: SyjStrings.osmAttribution }),
@@ -31,9 +40,13 @@ function init() {
     extent = viewLayer.getDataExtent();
     map.updateSize();
     map.zoomToExtent(extent);
-
+    resizeMap();
 }
 
+window.onresize = function() {
+    resizeMap();
+};
+
 if (window.addEventListener) {
     window.addEventListener("load", init, false);
 } else {