From a612302a117365284d9da43d7aaabdceb24b6119 Mon Sep 17 00:00:00 2001 From: tschaub Date: Thu, 17 May 2012 11:06:21 -0600 Subject: [PATCH] Demonstrating the use of MapQuest tiles in OL. --- examples/mapquest.html | 28 ++++++++++++++++++++++++++++ examples/mapquest.js | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 examples/mapquest.html create mode 100644 examples/mapquest.js diff --git a/examples/mapquest.html b/examples/mapquest.html new file mode 100644 index 0000000000..0fc02ec9e6 --- /dev/null +++ b/examples/mapquest.html @@ -0,0 +1,28 @@ + + + + + + + OpenLayers MapQuest Demo + + + + +

OpenLayers with MapQuest Tiles

+
+ This example demonstrates the use of MapQuest tiles with OpenLayers. +
+
+ MapQuest, OSM, XYZ +
+
+
+

+ See the mapquest.js source for + detail on using MapQuest tiles in OpenLayers. +

+
+ + + \ No newline at end of file diff --git a/examples/mapquest.js b/examples/mapquest.js new file mode 100644 index 0000000000..708cfdc4ad --- /dev/null +++ b/examples/mapquest.js @@ -0,0 +1,36 @@ +var map = new OpenLayers.Map({ + div: "map", + projection: "EPSG:900913", + layers: [ + new OpenLayers.Layer.XYZ( + "OpenStreetMap", + [ + "http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", + "http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", + "http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", + "http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png" + ], + { + attribution: "Tiles Courtesy of MapQuest ", + transitionEffect: "resize" + } + ), + new OpenLayers.Layer.XYZ( + "Imagery", + [ + "http://oatile1.mqcdn.com/naip/${z}/${x}/${y}.png", + "http://oatile2.mqcdn.com/naip/${z}/${x}/${y}.png", + "http://oatile3.mqcdn.com/naip/${z}/${x}/${y}.png", + "http://oatile4.mqcdn.com/naip/${z}/${x}/${y}.png" + ], + { + attribution: "Tiles Courtesy of MapQuest ", + transitionEffect: "resize" + } + ) + ], + center: [0, 0], + zoom: 1 +}); + +map.addControl(new OpenLayers.Control.LayerSwitcher()); \ No newline at end of file