Yes I have. :-)
<br/><br/><!DOCTYPE HTML>
<br/><html>
<br/> <head>
<br/> <title>Rectangular tiles</title>
<br/> <style type="text/css">
<br/> html, body, #map {
<br/> width: 100%;
<br/> height: 100%;
<br/> margin: 0;
<br/> }
<br/> </style>
<br/> <script src="<a href="http://www.openlayers.org/api/OpenLayers.js" target="_top" rel="nofollow" link="external">http://www.openlayers.org/api/OpenLayers.js</a>"></script>
<br/> <script>
<br/> function get_my_url(bounds) {
<br/> var res = this.map.getResolution();
<br/> var x = Math.round((bounds.left - this.maxExtent.left) / (res *
<br/>this.tileSize.w));
<br/> var y = Math.round((this.maxExtent.top - bounds.top) / (res *
<br/>this.tileSize.h));
<br/> var z = this.map.getZoom();
<br/><br/> // tiles are named like 0001 instead of simply 1
<br/> x = "000" + x;
<br/> x = x.substring(4, 0);
<br/> y = "000" + y;
<br/> y = y.substring(4, 0);
<br/><br/> var path = z + "/" + x + "/tile_" + y + "." + this.type;
<br/> var url = this.url;
<br/> if( url instanceof Array) {
<br/> url = this.selectUrl(path, url);
<br/> }
<br/> return url + path;
<br/> }
<br/><br/> var map, point, markers;
<br/><br/> function init() {
<br/> point = new OpenLayers.LonLat(54.167258, -131.662903);
<br/> map = new OpenLayers.Map("map", {
<br/> tileSize : new OpenLayers.Size(512, 512)
<br/> });
<br/> map.addLayer(new OpenLayers.Layer.TMS("Name",
<br/>"<a href="http://www.bananenhand.de/background/level" target="_top" rel="nofollow" link="external">http://www.bananenhand.de/background/level</a>", {
<br/> 'type' : 'jpg',
<br/> 'getURL' : get_my_url
<br/> }));
<br/> map.setCenter(point, 2);
<br/><br/> markers = new OpenLayers.Layer.Markers("Markers");
<br/> map.addLayer(markers);
<br/> markers.addMarker(new OpenLayers.Marker(point));
<br/> }
<br/> </script>
<br/> </head>
<br/> <body onload="init();">
<br/> <div id="map"></div>
<br/> </body>
<br/></html>
<br/>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/Own-map-layer-in-different-projection-tp4984150p4984159.html">Re: Own map layer in different projection</a><br/>
Sent from the <a href="http://osgeo-org.1560.n6.nabble.com/OpenLayers-Users-f3910695.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br/>