- function init(){
- OpenLayers.Lang.en.permalink = "Larger Map";
- map = new OpenLayers.Map ("map", {
- controls:[
- new OpenLayers.Control.Attribution(),
- new OpenLayers.Control.ArgParser(),
- new OpenLayers.Control.Navigation(),
- new OpenLayers.Control.Permalink(null, "http://openstreetmap.org/", {updateLink:localUpdateLink})],
- maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,
- 20037508.34,20037508.34),
- numZoomLevels:20,
- maxResolution:156543.0339,
- displayProjection: new OpenLayers.Projection("EPSG:4326"),
- units:'m',
- projection: new OpenLayers.Projection("EPSG:900913")
- } );
- var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", {
- displayOutsideMaxExtent: true,
- wrapDateLine: true,
- attribution: '<a target="_parent" href="http://www.openstreetmap.org">OpenStreetMap</a>'
- });
- map.addLayer(mapnik);
+ if (!args.layer || args.layer == "mapnik" || args.layer == "osmarender") {
+ new L.OSM.Mapnik().addTo(map);
+ } else if (args.layer == "cyclemap" || args.layer == "cycle map") {
+ new L.OSM.CycleMap().addTo(map);
+ } else if (args.layer == "transportmap") {
+ new L.OSM.TransportMap().addTo(map);
+ } else if (args.layer == "mapquest") {
+ new L.OSM.MapQuestOpen().addTo(map);
+ }