From 2176013e242ad869639bf049e40b1ebfca7b8445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Junod?= Date: Fri, 15 Oct 2010 11:43:53 +0000 Subject: [PATCH] Use an OSM layer instead of TMS with a custom getURL. Non functional change. git-svn-id: http://svn.openlayers.org/trunk/openlayers@10836 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/sundials-spherical-mercator.html | 24 +---------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/examples/sundials-spherical-mercator.html b/examples/sundials-spherical-mercator.html index b4f5e0b6ee..c7a21f0d77 100644 --- a/examples/sundials-spherical-mercator.html +++ b/examples/sundials-spherical-mercator.html @@ -31,15 +31,7 @@ 20037508.34, 20037508.34) }; map = new OpenLayers.Map('map', options); - var mapnik = new OpenLayers.Layer.TMS( - "OpenStreetMap (Mapnik)", - "http://tile.openstreetmap.org/", - { - type: 'png', getURL: osm_getTileURL, - displayOutsideMaxExtent: true, - attribution: 'OpenStreetMap' - } - ); + var mapnik = new OpenLayers.Layer.OSM("OpenStreetMap (Mapnik)"); var gmap = new OpenLayers.Layer.Google("Google", {sphericalMercator:true}); var sundials = new OpenLayers.Layer.Vector("KML", { projection: map.displayProjection, @@ -96,20 +88,6 @@ delete feature.popup; } } - function osm_getTileURL(bounds) { - var res = this.map.getResolution(); - var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w)); - var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h)); - var z = this.map.getZoom(); - var limit = Math.pow(2, z); - - if (y < 0 || y >= limit) { - return OpenLayers.Util.getImagesLocation() + "404.png"; - } else { - x = ((x % limit) + limit) % limit; - return this.url + z + "/" + x + "/" + y + "." + this.type; - } - }