1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <title>OpenStreetMap Embedded</title>
5 <style type="text/css">
10 .olControlAttribution {
11 bottom: 3px!important;
14 <script src="http://openstreetmap.org/openlayers/OpenLayers.js" type="text/javascript"></script>
15 <script src="http://openstreetmap.org/openlayers/OpenStreetMap.js" type="text/javascript"></script>
16 <script type="text/javascript">
20 map = new OpenLayers.Map ("map", {
22 new OpenLayers.Control.Attribution(),
23 new OpenLayers.Control.Navigation()
25 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,
26 20037508.34,20037508.34),
28 maxResolution: 156543.0339,
29 displayProjection: new OpenLayers.Projection("EPSG:4326"),
31 projection: new OpenLayers.Projection("EPSG:900913")
34 var attribution = 'Data by <a target="_parent" href="http://www.openstreetmap.org">OpenStreetMap</a>';
35 var args = OpenLayers.Util.getParameters();
36 if (!args.layer || args.layer == "mapnik") {
37 var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", {
38 displayOutsideMaxExtent: true,
40 attribution: attribution
43 } else if (args.layer == "osmarender") {
44 var osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender", {
45 displayOutsideMaxExtent: true,
47 attribution: attribution
49 map.addLayer(osmarender);
50 } else if (args.layer == "cycle map") {
51 var cyclemap = new OpenLayers.Layer.OSM.CycleMap("Cycle Map", {
52 displayOutsideMaxExtent: true,
54 attribution: attribution
56 map.addLayer(cyclemap);
60 var markers = new OpenLayers.Layer.Markers();
61 map.addLayer(markers);
62 markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(args.marker[1], args.marker[0]).transform(map.displayProjection, map.getProjectionObject())));
67 var bounds = OpenLayers.Bounds.fromArray(args.bbox).transform(map.displayProjection, map.getProjectionObject());
68 map.zoomToExtent(bounds)
70 map.zoomToMaxExtent();
73 var size = map.getSize();
75 map.addControl(new OpenLayers.Control.PanZoomBar());
77 map.addControl(new OpenLayers.Control.PanZoom());
84 <body onload="init()">