1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <style type="text/css">
8 .olControlAttribution {
12 <script src="http://openstreetmap.org/openlayers/OpenLayers.js"></script>
13 <script src="http://openstreetmap.org/openlayers/OpenStreetMap.js"></script>
14 <script type="text/javascript">
17 map = new OpenLayers.Map ("map", {
19 new OpenLayers.Control.Attribution(),
20 new OpenLayers.Control.Navigation()
22 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,
23 20037508.34,20037508.34),
25 maxResolution: 156543.0339,
26 displayProjection: new OpenLayers.Projection("EPSG:4326"),
28 projection: new OpenLayers.Projection("EPSG:900913")
31 var attribution = 'Data by <a target="_parent" href="http://www.openstreetmap.org">OpenStreetMap</a>';
32 var args = OpenLayers.Util.getParameters();
33 if (!args.layer || args.layer == "mapnik") {
34 var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", {
35 displayOutsideMaxExtent: true,
37 attribution: attribution
40 } else if (args.layer == "osmarender") {
41 var osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender", {
42 displayOutsideMaxExtent: true,
44 attribution: attribution
46 map.addLayer(osmarender);
47 } else if (args.layer == "cycle map") {
48 var cyclemap = new OpenLayers.Layer.OSM.CycleMap("Cycle Map", {
49 displayOutsideMaxExtent: true,
51 attribution: attribution
53 map.addLayer(cyclemap);
57 var markers = new OpenLayers.Layer.Markers();
58 map.addLayer(markers);
59 markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(args.marker[1], args.marker[0]).transform(map.displayProjection, map.getProjectionObject())));
64 var bounds = OpenLayers.Bounds.fromArray(args.bbox).transform(map.displayProjection, map.getProjectionObject());
65 map.zoomToExtent(bounds)
67 map.zoomToMaxExtent();
70 var size = map.getSize();
72 map.addControl(new OpenLayers.Control.PanZoomBar());
74 map.addControl(new OpenLayers.Control.PanZoom());
79 <body onload="init()">