]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/index.html.erb
Don't create the map until after the div for it is made visible
[rails.git] / app / views / site / index.html.erb
index 1f1313c53999a799b6c0e8d995ed9946b4db1b0c..c4d990618af9a4163372bb561220565d2c2775ae 100644 (file)
@@ -18,7 +18,7 @@
 
 <div id="map">
   <div id="permalink">
-    <a href="/" id="permalinkanchor"><%= t 'site.index.permalink' %></a><br/>
+    <a href="/" id="permalinkanchor" class="geolink llz layers object"><%= t 'site.index.permalink' %></a><br/>
     <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a>
   </div>
 </div>
@@ -66,7 +66,13 @@ if params['node'] or params['way'] or params['relation']
 end
 
 # Decide on a lat lon to initialise the map with. Various ways of doing this
-if params['minlon'] and params['minlat'] and params['maxlon'] and params['maxlat']
+if params['bbox']
+    bbox = true
+    minlon, minlat, maxlon, maxlat = h(params['bbox']).split(",")
+    layers = h(params['layers'])
+    box = true if params['box']=="yes"
+    object_zoom = false
+elsif params['minlon'] and params['minlat'] and params['maxlon'] and params['maxlat']
     bbox = true
     minlon = h(params['minlon'])
     minlat = h(params['minlat'])