From 6284e44d2e7cacd0cf587626c263a2f0d26354ee Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sat, 25 Feb 2012 16:18:43 -0700 Subject: [PATCH] Making the UTFGrid examples more like the rest. --- examples/utfgrid.html | 79 ++++++++++++++++------------------ examples/utfgrid_twogrids.html | 73 ++++++++++++++----------------- 2 files changed, 71 insertions(+), 81 deletions(-) diff --git a/examples/utfgrid.html b/examples/utfgrid.html index 32ebeb1545..8b28cb8db8 100644 --- a/examples/utfgrid.html +++ b/examples/utfgrid.html @@ -1,23 +1,29 @@ + - - OpenLayers UTFGrid Demo - + + + + + OpenLayers UTFGrid Demo + + -

OpenLayers UTFGrid Demo

+

OpenLayers UTFGrid Demo

-
-
-

- This page demostrates the use of the OpenLayers UTFGrid Controls. When the selected event is triggered, the underlying feature attributes are shown on the right. -

+
+
+ This page demonstrates the use of the OpenLayers UTFGrid Controls.
-
+
+
+

+ When the selected event is triggered, the underlying feature attributes are shown on the right. +

  • Click with custom callback
-
-
-
-
-
+

UTFGrids can be used to output highly optimized feature "hit grids". The UTFGrid encoding scheme encodes interactivity data for a tile in a space efficient manner. It is designed to be @@ -63,11 +65,9 @@ /* * Map */ - var map = new OpenLayers.Map('themap', { - projection: new OpenLayers.Projection("EPSG:900913"), - units: "m", - maxResolution: 156543.0339, - maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34), + var map = new OpenLayers.Map({ + div: "themap", + projection: "EPSG:900913", controls: [] // No default controls; no pan zoom for demo }); @@ -85,26 +85,26 @@ this.element.innerHTML = ''; return false; } - } + }; - controls = { - 'move': new OpenLayers.Control.UTFGrid({ - 'div': 'attrsdiv', - 'handlerMode': 'move' + var controls = { + move: new OpenLayers.Control.UTFGrid({ + div: 'attrsdiv', + handlerMode: 'move' }), - 'hover': new OpenLayers.Control.UTFGrid({ - 'div': 'attrsdiv', - 'handlerMode': 'hover' + hover: new OpenLayers.Control.UTFGrid({ + div: 'attrsdiv', + handlerMode: 'hover' }), - 'click': new OpenLayers.Control.UTFGrid({ - 'div': 'attrsdiv', - 'handlerMode': 'click' + click: new OpenLayers.Control.UTFGrid({ + div: 'attrsdiv', + handlerMode: 'click' }), - 'click_callback': new OpenLayers.Control.UTFGrid({ - 'handlerMode': 'click', - 'callback': callback + click_callback: new OpenLayers.Control.UTFGrid({ + handlerMode: 'click', + callback: callback }), - } + }; var control; for(var key in controls) { control = controls[key]; @@ -126,11 +126,8 @@ * Layers */ - var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", - "http://vmap0.tiles.osgeo.org/wms/vmap0", - {layers: 'basic'} - ); - map.addLayer(ol_wms); + var osm = new OpenLayers.Layer.OSM(); + map.addLayer(osm); var grid_layer = new OpenLayers.Layer.UTFGrid( 'Invisible UTFGrid Layer', diff --git a/examples/utfgrid_twogrids.html b/examples/utfgrid_twogrids.html index ad4baf8f0b..e62ef063f2 100644 --- a/examples/utfgrid_twogrids.html +++ b/examples/utfgrid_twogrids.html @@ -1,23 +1,26 @@ + - - OpenLayers Multiple UTFGrid Demo - + + + + + OpenLayers Multiple UTFGrid Demo + + -

OpenLayers Multiple UTFGrid Demo

+

OpenLayers Multiple UTFGrid Demo

-
-
-

- This page demostrates the use of the OpenLayers UTFGrid Controls with more than one UTFGrid Layer. -

+
+
+ This page demonstrates the use of the OpenLayers UTFGrid Controls with more than one UTFGrid Layer.
-
+
+
  • Move (both)
-
-
-