Permalink
Browse files

OpenCycleMap layers contributed by Morten Agerlin

  • Loading branch information...
1 parent 82b6c83 commit 75cbe11c44f03176127ce8626bc45ad00a5366be @pka pka committed Apr 9, 2012
Showing with 166 additions and 10 deletions.
  1. +51 −0 openlayers/html/ocm.html
  2. +51 −0 openlayers/html/ocm_landscape.html
  3. +51 −0 openlayers/html/ocm_transport.html
  4. +13 −10 openlayers/openlayers_plugin.py
View
@@ -0,0 +1,51 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>OpenLayers OpenStreetMap Layer</title>
+ <link rel="stylesheet" href="qgis.css" type="text/css">
+ <script src="OpenLayers.js"></script>
+ <script src="OlOverviewMarker.js"></script>
+ <script type="text/javascript">
+ var map;
+ var loadEnd;
+ var oloMarker; // OpenLayer Overview Marker
+ function init() {
+ map = new OpenLayers.Map('map', {
+ theme: null,
+ controls: [],
+ projection: new OpenLayers.Projection("EPSG:900913"),
+ units: "m",
+ maxResolution: 156543.0339,
+ maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)
+ });
+
+ loadEnd = false;
+ function layerLoadStart(event)
+ {
+ loadEnd = false;
+ }
+ function layerLoadEnd(event)
+ {
+ loadEnd = true;
+ }
+
+ var osm = new OpenLayers.Layer.OSM(
+ "OpenCyclemapMap",
+ "http://tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
+ {
+ eventListeners: {
+ "loadstart": layerLoadStart,
+ "loadend": layerLoadEnd
+ }
+ }
+ );
+ map.addLayer(osm);
+ map.addControl(new OpenLayers.Control.Attribution());
+ map.setCenter(new OpenLayers.LonLat(0, 0), 2);
+ oloMarker = new OlOverviewMarker(map, getPathUpper(document.URL) + '/x.png')
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <div id="map"></div>
+ </body>
+</html>
@@ -0,0 +1,51 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>OpenLayers OpenStreetMap Layer</title>
+ <link rel="stylesheet" href="qgis.css" type="text/css">
+ <script src="OpenLayers.js"></script>
+ <script src="OlOverviewMarker.js"></script>
+ <script type="text/javascript">
+ var map;
+ var loadEnd;
+ var oloMarker; // OpenLayer Overview Marker
+ function init() {
+ map = new OpenLayers.Map('map', {
+ theme: null,
+ controls: [],
+ projection: new OpenLayers.Projection("EPSG:900913"),
+ units: "m",
+ maxResolution: 156543.0339,
+ maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)
+ });
+
+ loadEnd = false;
+ function layerLoadStart(event)
+ {
+ loadEnd = false;
+ }
+ function layerLoadEnd(event)
+ {
+ loadEnd = true;
+ }
+
+ var osm = new OpenLayers.Layer.OSM(
+ "OpenCyclemapMap",
+ "http://tile3.opencyclemap.org/landscape/${z}/${x}/${y}.png",
+ {
+ eventListeners: {
+ "loadstart": layerLoadStart,
+ "loadend": layerLoadEnd
+ }
+ }
+ );
+ map.addLayer(osm);
+ map.addControl(new OpenLayers.Control.Attribution());
+ map.setCenter(new OpenLayers.LonLat(0, 0), 2);
+ oloMarker = new OlOverviewMarker(map, getPathUpper(document.URL) + '/x.png')
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <div id="map"></div>
+ </body>
+</html>
@@ -0,0 +1,51 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>OpenLayers OpenStreetMap Layer</title>
+ <link rel="stylesheet" href="qgis.css" type="text/css">
+ <script src="OpenLayers.js"></script>
+ <script src="OlOverviewMarker.js"></script>
+ <script type="text/javascript">
+ var map;
+ var loadEnd;
+ var oloMarker; // OpenLayer Overview Marker
+ function init() {
+ map = new OpenLayers.Map('map', {
+ theme: null,
+ controls: [],
+ projection: new OpenLayers.Projection("EPSG:900913"),
+ units: "m",
+ maxResolution: 156543.0339,
+ maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)
+ });
+
+ loadEnd = false;
+ function layerLoadStart(event)
+ {
+ loadEnd = false;
+ }
+ function layerLoadEnd(event)
+ {
+ loadEnd = true;
+ }
+
+ var osm = new OpenLayers.Layer.OSM(
+ "OpenCyclemapMap",
+ "http://tile2.opencyclemap.org/transport/${z}/${x}/${y}.png",
+ {
+ eventListeners: {
+ "loadstart": layerLoadStart,
+ "loadend": layerLoadEnd
+ }
+ }
+ );
+ map.addLayer(osm);
+ map.addControl(new OpenLayers.Control.Attribution());
+ map.setCenter(new OpenLayers.LonLat(0, 0), 2);
+ oloMarker = new OlOverviewMarker(map, getPathUpper(document.URL) + '/x.png')
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <div id="map"></div>
+ </body>
+</html>
@@ -108,17 +108,20 @@ def __init__(self, iface):
self.iface = iface
# Layers
self.olLayerTypeRegistry = OlLayerTypeRegistry()
- self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Physical', 'google_icon.png', 'google_physical.html') )
- self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Streets', 'google_icon.png', 'google_streets.html') )
- self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Hybrid', 'google_icon.png', 'google_hybrid.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Physical', 'google_icon.png', 'google_physical.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Streets', 'google_icon.png', 'google_streets.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Hybrid', 'google_icon.png', 'google_hybrid.html') )
self.olLayerTypeRegistry.add( OlLayerType(self, 'Google Satellite', 'google_icon.png', 'google_satellite.html') )
- self.olLayerTypeRegistry.add( OlLayerType(self, 'OpenStreetMap', 'osm_icon.png', 'osm.html') ) #OL LoadEnd disabled, see http://hub.qgis.org/issues/5037
- self.olLayerTypeRegistry.add( OlLayerType(self, 'Yahoo Street', 'yahoo_icon.png', 'yahoo_street.html') )
- self.olLayerTypeRegistry.add( OlLayerType(self, 'Yahoo Hybrid', 'yahoo_icon.png', 'yahoo_hybrid.html') )
- self.olLayerTypeRegistry.add( OlLayerType(self, 'Yahoo Satellite', 'yahoo_icon.png', 'yahoo_satellite.html') )
- self.olLayerTypeRegistry.add( OlLayerType(self, 'Road', 'bing_icon.png', 'bing_road.html') )
- self.olLayerTypeRegistry.add( OlLayerType(self, 'Bing Aerial', 'bing_icon.png', 'bing_aerial.html') )
- self.olLayerTypeRegistry.add( OlLayerType(self, 'Bing Aerial with labels', 'bing_icon.png', 'bing_aerial-labels.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'OpenStreetMap', 'osm_icon.png', 'osm.html') ) #OL LoadEnd disabled, see http://hub.qgis.org/issues/5037
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'OpenCycleMap', 'osm_icon.png', 'ocm.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'OCM Landscape', 'osm_icon.png', 'ocm_landscape.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'OCM Public Transport', 'osm_icon.png', 'ocm_transport.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'Yahoo Street', 'yahoo_icon.png', 'yahoo_street.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'Yahoo Hybrid', 'yahoo_icon.png', 'yahoo_hybrid.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'Yahoo Satellite', 'yahoo_icon.png', 'yahoo_satellite.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'Road', 'bing_icon.png', 'bing_road.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'Bing Aerial', 'bing_icon.png', 'bing_aerial.html') )
+ self.olLayerTypeRegistry.add( OlLayerType(self, 'Bing Aerial with labels', 'bing_icon.png', 'bing_aerial-labels.html') )
# Overview
self.olOverview = OLOverview( iface, self.olLayerTypeRegistry )

0 comments on commit 75cbe11

Please sign in to comment.