Skip to content
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.

Commit

Permalink
added OS switch for the coords and restore backwards compatibility
Browse files Browse the repository at this point in the history
added OS switch for the coords …

(new) fix for plumpudding/meshviewer/ffnord#6

restore backwards compatibility

resolve builderror

fixed typo
  • Loading branch information
anoymouserver committed Dec 5, 2015
1 parent e079139 commit 82935b2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ There is no stable release cycle at the moment. Please use the master branch and

Copy `config.json.example` to `build/config.json` and change it to match your community.

## dataPaths (array)
## dataPath (array)

`dataPaths` must contain one ore more strings pointing to a directory containing
`dataPath` must contain one or more strings pointing to a directory containing
`nodes.json` and `graph.json` (both are generated by
[ffmap-backend](https://github.com/ffnord/ffmap-backend)). Don't forget the
trailing slash! Data may be served from a different domain with [CORS enabled].
Expand Down
2 changes: 1 addition & 1 deletion config.json.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dataPaths": [
"dataPath": [
"http://map.gl.wupper.ffrl.de/data/",
"http://map.ffdus.de/data/",
"http://map.fichtenfunk.freifunk.ruhr/json/"
Expand Down
11 changes: 9 additions & 2 deletions lib/infobox/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,17 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
var latitude = d.nodeinfo.location.latitude
var longitude = d.nodeinfo.location.longitude
var a = document.createElement("a")
a.textContent = showLatitude(latitude) + " " +
a.innerHTML = showLatitude(latitude) + " " +
showLongitude(longitude)

a.href = "geo:" + latitude + "," + longitude
if (/Android/i.test(navigator.userAgent))
a.setAttribute("href", "geo:" + latitude + "," + longitude)
else
{
a.setAttribute("href", "https://www.openstreetmap.org/#map=18/" + latitude + "/" + longitude)
a.setAttribute("target", "_blank")
}

el.appendChild(a)
}
}
Expand Down
10 changes: 7 additions & 3 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,13 @@ function (moment, Router, L, GUI, numeral) {
var router = new Router()

var urls = []
for (var i = 0; i < config.dataPaths.length; ++i) {
urls.push(config.dataPaths[i] + "nodes.json")
urls.push(config.dataPaths[i] + "graph.json")

if (typeof config.dataPath === "string" || config.dataPath instanceof String)
config.dataPath = [config.dataPath]

for (var i = 0; i < config.dataPath.length; ++i) {
urls.push(config.dataPath[i] + "nodes.json")
urls.push(config.dataPath[i] + "graph.json")
}

function update() {
Expand Down

0 comments on commit 82935b2

Please sign in to comment.