]> git.openstreetmap.org Git - rails.git/blobdiff - public/javascripts/site.js
Fix automatic size detection for map popups.
[rails.git] / public / javascripts / site.js
index 781940fa6494a84a8c578b034a6b18b881ea61d6..95ef1f53631f34627d04c8762b0ca59e1ef3bcf9 100644 (file)
@@ -1,21 +1,13 @@
-function updatelinks(lon,lat,zoom) {
-  var links = new Object();
-  links['viewanchor'] = '/index.html';
-  //links['editanchor'] = 'edit.html';
-  links['uploadanchor'] = '/traces';
-  links['loginanchor'] = '/login.html';
-  links['logoutanchor'] = '/logout.html';
-  links['registeranchor'] = '/create-account.html';
-
+function updatelinks(lon,lat,zoom,layers) {
   var node;
-  var anchor;
-  for (anchor in links) {
-    node = document.getElementById(anchor);
-    if (! node) { continue; }
+
+  node = document.getElementById("viewanchor");
+  if (node) {
     var args = getArgs(node.href);
     args["lat"] = lat;
     args["lon"] = lon;
     args["zoom"] = zoom;
+    args["layers"] = layers;
     node.href = setArgs(node.href, args);
   }
 
@@ -69,3 +61,17 @@ function setArgs(url, args) {
 
    return url.replace(/\?.*$/, "") + "?" + queryitems.join("&");
 }
+
+function getStyle(el, property) {
+  var style;
+
+  if (el.currentStyle) {
+    style = el.currentStyle[property];
+  } else if( window.getComputedStyle ) {
+    style = document.defaultView.getComputedStyle(el,null).getPropertyValue(property);
+  } else {
+    style = el.style[property];
+  }
+
+  return style;
+}