2 <html xmlns="http://www.w3.org/1999/xhtml">
5 <title>OpenStreetMap Embedded</title>
6 <style type="text/css">
20 .olControlAttribution {
21 bottom: 3px!important;
24 <script src="/openlayers/OpenLayers.js" type="text/javascript"></script>
25 <script src="/openlayers/OpenStreetMap.js" type="text/javascript"></script>
26 <script type="text/javascript">
30 map = new OpenLayers.Map ("map", {
32 new OpenLayers.Control.Attribution(),
33 new OpenLayers.Control.Navigation()
36 displayProjection: new OpenLayers.Projection("EPSG:4326")
39 var attribution = '© <a target="_parent" href="http://www.openstreetmap.org">OpenStreetMap</a> and contributors, under an <a target="_parent" href="http://www.openstreetmap.org/copyright">open license</a>';
40 var args = OpenLayers.Util.getParameters();
41 if (!args.layer || args.layer == "mapnik" || args.layer == "osmarender") {
42 var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", {
44 attribution: attribution
47 } else if (args.layer == "cyclemap" || args.layer == "cycle map") {
48 var cyclemap = new OpenLayers.Layer.OSM.CycleMap("Cycle Map", {
50 attribution: attribution
52 map.addLayer(cyclemap);
53 } else if (args.layer == "transportmap") {
54 var transportmap = new OpenLayers.Layer.OSM.TransportMap("Transport Map", {
56 attribution: attribution
58 map.addLayer(transportmap);
59 } else if (args.layer == "mapquest") {
60 var mapquestmap = new OpenLayers.Layer.OSM("MapQuest Open Map", [
61 "http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
62 "http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
63 "http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
64 "http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png"], {
66 attribution: "Tiles courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"
68 map.addLayer(mapquestmap);
72 var markers = new OpenLayers.Layer.Markers();
73 map.addLayer(markers);
74 markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(args.marker[1], args.marker[0]).transform(map.displayProjection, map.getProjectionObject())));
79 var bounds = OpenLayers.Bounds.fromArray(args.bbox).transform(map.displayProjection, map.getProjectionObject());
80 map.zoomToExtent(bounds)
82 map.zoomToMaxExtent();
85 var size = map.getSize();
87 map.addControl(new OpenLayers.Control.PanZoomBar());
89 map.addControl(new OpenLayers.Control.Zoom());
96 <body onload="init()">