From e3adb645e72f01a0aea8d8dbafa08bc37c64cc49 Mon Sep 17 00:00:00 2001 From: Arvind Date: Tue, 12 Mar 2013 20:03:56 +0530 Subject: [PATCH] Fixing UX issues - The mural now does not move out of the screen, it stays fixed at the center of viewport. - Adding expermimental code for buffering tiles at the client side. --- static/myVector.js | 25 +++++++++++++++++++++---- templates/index.html | 11 ++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/static/myVector.js b/static/myVector.js index c53db7d..ecacf10 100644 --- a/static/myVector.js +++ b/static/myVector.js @@ -129,7 +129,8 @@ function init(){ controls: [], maxExtent: new OpenLayers.Bounds( 0.0, -4668.0, 31110.0, 0.0 ), maxResolution: 128.000000, - numZoomLevels: 8 + numZoomLevels: 8, + restrictedExtent: new OpenLayers.Bounds( 0.0, -4668.0, 31110.0, 0.0 ) }; map = new OpenLayers.Map('map', options); $.get(config.indexer+"/fetch", function(data){ @@ -145,12 +146,28 @@ function init(){ } }); + + buffer0 = new OpenLayers.Layer.TMS( "TMS Layer","static/", + { url: '', serviceVersion: '.', layername: 'buffer0', alpha: true, + type: 'png', getURL: overlay_getTileURL, buffer:0, singleTile: false + }); + + buffer1 = new OpenLayers.Layer.TMS( "TMS Layer","static/", + { url: '', serviceVersion: '.', layername: 'buffer1', alpha: true, + type: 'png', getURL: overlay_getTileURL, buffer:1, singleTile: false + }); + + buffer2 = new OpenLayers.Layer.TMS( "TMS Layer","static/", + { url: '', serviceVersion: '.', layername: 'buffer2', alpha: true, + type: 'png', getURL: overlay_getTileURL, buffer:2, singleTile: false + }); + var layer = new OpenLayers.Layer.TMS( "TMS Layer","static/", { url: '', serviceVersion: '.', layername: '.', alpha: true, - type: 'png', getURL: overlay_getTileURL + type: 'png', getURL: overlay_getTileURL, isBaseLayer:true }); boxes = new OpenLayers.Layer.Vector( "Boxes" ); - map.addLayers([layer, boxes]); + map.addLayers([layer, buffer0, buffer1, buffer2, boxes]); boxes.events.register('featureadded', boxes, myfeatureadded); box2 = new OpenLayers.Layer.Vector( "Boxes" ); @@ -196,7 +213,7 @@ function init(){ addLabel('4263.0000','-1345.33337', 'Video'); map.addControl(new OpenLayers.Control.PanZoomBar()); map.addControl(new OpenLayers.Control.MousePosition()); - map.addControl(new OpenLayers.Control.MouseDefaults()); + map.addControl(new OpenLayers.Control.Navigation()); map.addControl(new OpenLayers.Control.KeyboardDefaults()); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.zoomToExtent( mapBounds ); diff --git a/templates/index.html b/templates/index.html index 4e680af..01ca4c3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,7 +1,8 @@ - - + + + - +