summaryrefslogtreecommitdiff
path: root/misc/openlayers/examples/utfgrid.js
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2015-10-17 21:36:38 +0200
committerChris Schlaeger <chris@linux.com>2015-10-17 21:36:38 +0200
commite30f267181d990947e67909de4809fa941698c85 (patch)
tree46e9f94c2b3699ed378963b420b8a8d361286ea1 /misc/openlayers/examples/utfgrid.js
parente763ceb183f389fcd314a4a6a712d87c9d4cdb32 (diff)
downloadpostrunner-e30f267181d990947e67909de4809fa941698c85.zip
Upgrading openlayers to 3.x
Diffstat (limited to 'misc/openlayers/examples/utfgrid.js')
-rw-r--r--misc/openlayers/examples/utfgrid.js61
1 files changed, 0 insertions, 61 deletions
diff --git a/misc/openlayers/examples/utfgrid.js b/misc/openlayers/examples/utfgrid.js
deleted file mode 100644
index dc06c41..0000000
--- a/misc/openlayers/examples/utfgrid.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var osm = new OpenLayers.Layer.OSM();
-
-var utfgrid = new OpenLayers.Layer.UTFGrid({
- url: "utfgrid/world_utfgrid/${z}/${x}/${y}.json",
- utfgridResolution: 4, // default is 2
- displayInLayerSwitcher: false
-});
-
-var map = new OpenLayers.Map({
- div: "map",
- projection: "EPSG:900913",
- controls: [],
- layers: [osm, utfgrid],
- center: [0, 0],
- zoom: 1
-});
-
-var callback = function(infoLookup) {
- var msg = "";
- if (infoLookup) {
- var info;
- for (var idx in infoLookup) {
- // idx can be used to retrieve layer from map.layers[idx]
- info = infoLookup[idx];
- if (info && info.data) {
- msg += "[" + info.id + "] <strong>In 2005, " +
- info.data.NAME + " had a population of " +
- info.data.POP2005 + " people.</strong> ";
- }
- }
- }
- document.getElementById("attrs").innerHTML = msg;
-};
-
-var controls = {
- move: new OpenLayers.Control.UTFGrid({
- callback: callback,
- handlerMode: "move"
- }),
- hover: new OpenLayers.Control.UTFGrid({
- callback: callback,
- handlerMode: "hover"
- }),
- click: new OpenLayers.Control.UTFGrid({
- callback: callback,
- handlerMode: "click"
- })
-};
-for (var key in controls) {
- map.addControl(controls[key]);
-}
-
-function toggleControl(el) {
- for (var c in controls) {
- controls[c].deactivate();
- }
- controls[el.value].activate();
-}
-
-// activate the control that responds to mousemove
-toggleControl({value: "move"});