From 4b55bb2a24a410273ba57032abad1824451c8e24 Mon Sep 17 00:00:00 2001 From: Xaver Maierhofer Date: Thu, 26 May 2016 00:27:46 +0200 Subject: [PATCH] [TASK] Remove jsHashes --- app.js | 3 +-- bower.json | 3 +-- lib/map/clientlayer.js | 8 +++----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index 53b3a4b..8720290 100644 --- a/app.js +++ b/app.js @@ -12,8 +12,7 @@ require.config({ "d3": "../bower_components/d3/d3.min", "virtual-dom": "../bower_components/virtual-dom/dist/virtual-dom", "rbush": "../bower_components/rbush/rbush", - "helper": "../helper", - "jshashes": "../bower_components/jshashes/hashes" + "helper": "../helper" }, shim: { "leaflet.label": ["leaflet"], diff --git a/bower.json b/bower.json index a582b93..717ee9b 100644 --- a/bower.json +++ b/bower.json @@ -21,8 +21,7 @@ "roboto-fontface": "~0.3.0", "virtual-dom": "~2.1.1", "leaflet-providers": "~1.1.10", - "rbush": "https://github.com/mourner/rbush.git#~1.4.3", - "jshashes": "~1.0.5" + "rbush": "https://github.com/mourner/rbush.git#~1.4.3" }, "authors": [ "Milan Pässler ", diff --git a/lib/map/clientlayer.js b/lib/map/clientlayer.js index d6ee4fc..7579f4e 100644 --- a/lib/map/clientlayer.js +++ b/lib/map/clientlayer.js @@ -1,6 +1,5 @@ -define(["leaflet", "jshashes"], - function (L, jsHashes) { - var MD5 = new jsHashes.MD5(); +define(["leaflet"], + function (L) { return L.TileLayer.Canvas.extend({ setData: function (d) { @@ -8,8 +7,7 @@ define(["leaflet", "jshashes"], //pre-calculate start angles this.data.all().forEach(function (d) { - var hash = MD5.hex(d.node.nodeinfo.node_id); - d.startAngle = (parseInt(hash.substr(0, 2), 16) / 255) * 2 * Math.PI; + d.startAngle = (parseInt(d.node.nodeinfo.node_id.substr(10, 2), 16) / 255) * 2 * Math.PI; }); this.redraw(); },