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
41 var osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender", {
42 displayOutsideMaxExtent: true,
44 attribution: attribution
46 map.addLayer(osmarender);
50 var markers = new OpenLayers.Layer.Markers();
51 map.addLayer(markers);
52 markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(args.marker[1], args.marker[0]).transform(map.displayProjection, map.getProjectionObject())));
57 var bounds = OpenLayers.Bounds.fromArray(args.bbox).transform(map.displayProjection, map.getProjectionObject());
58 map.zoomToExtent(bounds)
60 map.zoomToMaxExtent();
63 var size = map.getSize();
65 map.addControl(new OpenLayers.Control.PanZoomBar());
67 map.addControl(new OpenLayers.Control.PanZoom());
72 <body onload="init()">