Additionally, we could encode the coords using this approach:
function makeEncoder(baseString) {
var len = baseString.length
var d = {}
var i = 0
// map char -> value
var (var i=0; i<len; i++) {
d[baseString[i]] = i
}
if Object.keys(d).length != len {
throw Exception("Duplicate characters in encoding string")
}
return {
encode: x => {
if (x==0) return baseString[0]
var l = ""
while (x > 0) {
l += baseString[x % len])
x = Math.floor(x/len)
}
return l
},
decode: s => {
sum(d[ch] * len**i for (i,ch) in enumerate(s))
}
}
}
var {encode, decode} = makeEncoder("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
(This is for encoding numbers only, we would need to extend this to support an alphabet with a few more chars like . ; - etc.)
(Pseudo code, not fully translated from Python yet)
For a link, the sidebar with links to mapping services (OSM, Google Maps etc. see #1) should open automatically.
We could link to a point using an URL scheme of http://mapzr.com/#p123456
Additionally, we could encode the coords using this approach:
(This is for encoding numbers only, we would need to extend this to support an alphabet with a few more chars like . ; - etc.)
(Pseudo code, not fully translated from Python yet)
For a link, the sidebar with links to mapping services (OSM, Google Maps etc. see #1) should open automatically.