ignore when constructing the shortlink.
The shortlink was also broken for the new /?{node,way,relation}=id
construct since the code assumed that all URL parameters that weren't
lat/lon/zoom/layers could be safely ignored. I've added
node/way/relation to that list but for future-proofness it might be
better to simply check if there's anything left in ''args'' that we
don't know how to encode, rather than checking on values we know about
now.
- // little hack. may the gods of hardcoding please forgive me, or
- // show me the Right way to do it.
- if (layers && (layers != "B000FTF")) {
+ // This is a hack to omit the default mapnik layer (B000FTF) from
+ // the shortlink. B000FTFT is then the "Object" layer which we get
+ // on /?{node,way,relation}=id
+ if (layers && (layers != "B000FTF") && (layers != "B000FTFT")) {
+ }
+
+ // Here we're assuming that all parameters but ?layers= and
+ // ?{node,way,relation}= can be safely omitted from the shortlink
+ // which encodes lat/lon/zoom. If new URL parameters are added to
+ // the main slippy map this needs to be changed.
+ if (args["layers"] || args[objtype]) {
node.href = setArgs(prefix + "/go/" + code, args);
} else {
node.href = prefix + "/go/" + code;
node.href = setArgs(prefix + "/go/" + code, args);
} else {
node.href = prefix + "/go/" + code;