From 209dece7d3b3b4161ede2f84784ab0cd63ed2166 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 30 Apr 2008 08:44:57 +0000 Subject: [PATCH] Tidy things up a bit. --- app/views/export/_start.rhtml | 9 +++--- app/views/export/start.rjs | 60 +++++++++++++++++++++-------------- public/export/embed.html | 21 ++++++------ 3 files changed, 52 insertions(+), 38 deletions(-) diff --git a/app/views/export/_start.rhtml b/app/views/export/_start.rhtml index 4fbbff047..9776261ea 100644 --- a/app/views/export/_start.rhtml +++ b/app/views/export/_start.rhtml @@ -58,11 +58,10 @@

Options

-

- Add a marker to the map -

+

Add a marker to the map

+
diff --git a/app/views/export/start.rjs b/app/views/export/start.rjs index 7f9453122..2a7985037 100644 --- a/app/views/export/start.rjs +++ b/app/views/export/start.rjs @@ -99,34 +99,47 @@ page << <'; $("export_html_text").value = html; diff --git a/public/export/embed.html b/public/export/embed.html index 7fe7d4683..41cd75f43 100644 --- a/public/export/embed.html +++ b/public/export/embed.html @@ -71,29 +71,32 @@ var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", { displayOutsideMaxExtent: true, wrapDateLine: true, - attribution: attribution + attribution: attribution }); map.addLayer(mapnik); - } else { + } else { var osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender", { displayOutsideMaxExtent: true, wrapDateLine: true, - attribution: attribution + attribution: attribution }); - map.addLayer(osmarender); - } + map.addLayer(osmarender); + } + if (args.marker) { var markers = new OpenLayers.Layer.Markers(); map.addLayer(markers); - markers.addMarker( new OpenLayers.Marker(new OpenLayers.LonLat(args.marker[1], args.marker[0]).transform(map.displayProjection, map.getProjectionObject()))); + markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(args.marker[1], args.marker[0]).transform(map.displayProjection, map.getProjectionObject()))); map.marker = true; - } - if (args.bbox) { + } + + if (args.bbox) { var bounds = OpenLayers.Bounds.fromArray(args.bbox).transform(map.displayProjection, map.getProjectionObject()); map.zoomToExtent(bounds) } else { - map.zoomToMaxExtent(); + map.zoomToMaxExtent(); } + var size = map.getSize(); if (size.h > 320) { map.addControl(new OpenLayers.Control.PanZoomBar()); -- 2.43.2