opencyclemap.org support

Topics: Feature Requests
Nov 21, 2010 at 1:24 PM

Hi radioman,

as we have seen, you have already added some OSM Maps to your list.

Is there a chance, that you also add these two maps:

http://www.opencyclemap.org

and

http://www.wanderreitkarte.de/

Thank you for reading!

Jockel

Nov 21, 2010 at 1:34 PM

roger ;}

Nov 23, 2010 at 6:47 PM
Edited Nov 23, 2010 at 6:50 PM

opencyclemap done, so far on http://www.wanderreitkarte.de/ analyze:

//Eingrenzung auf ein Land
var leftBottom = new OpenLayers.LonLat(0.9,35.2)
.transform(
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
new OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection
)
var rightTop = new OpenLayers.LonLat(23,58.1)
.transform(
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
new OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection
)
var extent = new OpenLayers.Bounds(leftBottom.lon, leftBottom.lat, rightTop.lon, rightTop.lat);

var options = {
projection : "EPSG:900913",
numZoomLevels: 19,

controls: [ new OpenLayers.Control.KeyboardDefaults(), // keyboard must be first
new OpenLayers.Control.MouseDefaults(),
//new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.PanZoomBar(),

new OpenLayers.Control.ScaleLine({geodesic: true})
]
};

var map = new OpenLayers.Map('map', options);
map.restrictedExtent = extent;

var base = new OpenLayers.Layer.Topo('base', [
'http://base.wanderreitkarte.de/base/${z}/${x}/${y}.png',
'http://base2.wanderreitkarte.de/base/${z}/${x}/${y}.png'],
{isBaseLayer:true});
map.addLayer(base);

var hills = new OpenLayers.Layer.Contour("shade", [
"http://wanderreitkarte.de/hills/${z}/${x}/${y}.png",
'http://www.wanderreitkarte.de/hills/${z}/${x}/${y}.png'],
{minZoomLevel: 9, maxZoomLevel: 19 , isBaseLayer:false });
map.addLayer(hills);

var trails = new OpenLayers.Layer.Topo('topo', [
'http://topo.wanderreitkarte.de/topo/${z}/${x}/${y}.png',
'http://topo2.wanderreitkarte.de/topo/${z}/${x}/${y}.png'],
{isBaseLayer:false});
map.addLayer(trails);


// have to figure out how this can be done automatically
Proj4js.defs["EPSG:54004"] =
"+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ";
Proj4js.defs["EPSG:54004"] = "+proj=merc +lat_ts=0 +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m no_defs"
Proj4js.defs["EPSG:900913"] = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs";

p54004 = new Proj4js.Proj("EPSG:54004");
p4326 = new Proj4js.Proj("EPSG:4326");
p900913 = new Proj4js.Proj("EPSG:900913");

/*
function sizeMap(deltaPx) {
var e = document.getElementById('map');
var h = e.style.height;
if( h=='' ) h = window.getComputedStyle(e, null).height;
var height = parseInt(h)+deltaPx;
if( height<100 ) return;
e.style.height = ""+ height + 'px';
map.updateSize();
};
*/
/**
* convert from one projection to other.
* @param Proj4js.Proj pFrom input projection
* @param Proj4js.Proj pTo output projection
* @param OpenLayers.LonLat lonlat value to convert
*/
function p2p(pFrom, pTo, lonlat) {
var xy = {x: lonlat.lon, y:lonlat.lat};
xy = Proj4js.transform(pFrom, pTo, xy);
return new OpenLayers.LonLat(xy.x, xy.y);
};

function mapFullsize() {
var maph = window.innerHeight;
document.getElementById("map").style.height = maph+"px";
map.updateSize();
}

// parse URL parameters for lat, lon and zoom
/*var floatreString = "([-]?[0-9]+([.][0-9]+)?)($|&)";
var paramDef = {
lat : [new RegExp("[?&]lat="+floatreString), null],
lon : [new RegExp("[?&]lon="+floatreString), null],
zoom : [new RegExp("[?&]zoom=([0-9]|1[0-9])($|&)"), null],
//maph : [new RegExp("[?&]maph=([0-9][0-9][0-9][0-9]?)($|&)"), null],
//layer : [new RegExp("[?&]layer=([A-Za-z]+)($|&)"), "Mapnik"],
urlLang : [new RegExp("[?&]lang=(en|it)($|&)"), null]
};
var params = {};
for(key in paramDef) {
var m = location.search.match(paramDef[key][0]);
eval("var "+key+" = (m==null) ? paramDef[key][1] : m[1]");
};
*/

// initialize the map coordinates, zoom, size and layer from the URL
// parameters or from defaults. For the coordinates we remember
// whether we used the default. If yes, a track just loaded is allowed
// to override the settings to zoom to its extend.
if( lat && lon ) {
lonlatIsDefault = false;
var lonlat = new OpenLayers.LonLat(lon, lat);
} else {
lonlatIsDefault = true;
var lonlat = new OpenLayers.LonLat(11.75,49);
}
lonlat = p2p(p4326, p900913, lonlat);

if( zoom ) {
zoomIsDefault = false;
} else {
zoomIsDefault = true;
zoom = 5;
}

/*
if( maph ) {
document.getElementById('map').style.height = ""+maph+"px";
map.updateSize();
} else {
mapFullsize();
}
*/
mapFullsize();
//var l = map.getLayersByName("Reitkarte");
//if( l && l.length>0 ) map.setBaseLayer(l[0]);

map.events.register("zoomend", map, updateScale);
map.events.register("moveend", map, updateLocation);

// called at the end of the generated tail of index.html, just before
// the track points are created.
function initMapCoords(lonlat, zoom, map) {
map.setCenter(lonlat, zoom, false, false);
//updateScale.apply(map, null);
d = document.getElementById('mapWrapper');
 d.style.width=window.innerWidth-250;
}

Nov 23, 2010 at 7:21 PM
Edited Nov 23, 2010 at 7:23 PM

Hi radioman :-)

so this is very different from the ones we have seen integrated here before?

Nov 23, 2010 at 7:32 PM

hey,

..not so much, just another projection ;}