-function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,objid) {
- var toPrecision = zoomPrecision(zoom);
- var node;
-
- lat = toPrecision(lat);
- lon = toPrecision(lon);
-
- if (minlon) {
- minlon = toPrecision(minlon);
- minlat = toPrecision(minlat);
- maxlon = toPrecision(maxlon);
- maxlat = toPrecision(maxlat);
- }
-
- $(".geolink").each(function (index, link) {
- var args = getArgs(link.href);
-
- if ($(link).hasClass("llz")) {
- args.lat = lat;
- args.lon = lon;
- args.zoom = zoom;
- } else if (minlon && $(link).hasClass("bbox")) {
- args.bbox = minlon + "," + minlat + "," + maxlon + "," + maxlat;
- }
-
- if (layers && $(link).hasClass("layers")) {
- args.layers = layers;
- }
-
- if (objtype && $(link).hasClass("object")) {
- args[objtype] = objid;
+function updateLinks(loc, zoom, layers, object) {
+ $(".geolink").each(function(index, link) {
+ var href = link.href.split(/[?#]/)[0],
+ args = querystring.parse(link.search.substring(1)),
+ editlink = $(link).hasClass("editlink");
+
+ delete args['node'];
+ delete args['way'];
+ delete args['relation'];
+ delete args['changeset'];
+
+ if (object && editlink) {
+ args[object.type] = object.id;