diff --git a/server/static/index.html b/server/static/index.html index 2616f63..a2b1458 100644 --- a/server/static/index.html +++ b/server/static/index.html @@ -11,15 +11,25 @@
+ + + + + + + + + + diff --git a/server/static/js/main.js b/server/static/js/main.js index 1704b4b..699c3a2 100644 --- a/server/static/js/main.js +++ b/server/static/js/main.js @@ -18,7 +18,7 @@ api.getConfig().then(function(cfg){ crs: SimpleCRS }); - map.attributionControl.addAttribution('Mapserver'); + map.attributionControl.addAttribution('Minetest Mapserver'); var layers = {}; var overlays = {} diff --git a/server/static/js/overlays/TravelnetOverlay.js b/server/static/js/overlays/TravelnetOverlay.js index d1335b6..0e8235b 100644 --- a/server/static/js/overlays/TravelnetOverlay.js +++ b/server/static/js/overlays/TravelnetOverlay.js @@ -10,11 +10,13 @@ var TravelnetIcon = L.icon({ var TravelnetOverlay = L.LayerGroup.extend({ initialize: function(wsChannel, layerMgr) { + L.LayerGroup.prototype.initialize.call(this); + this.layerMgr = layerMgr; this.wsChannel = wsChannel; this.onLayerChange = this.onLayerChange.bind(this); - this.onMapMove = this.onMapMove.bind(this); + this.onMapMove = debounce(this.onMapMove.bind(this), 50); }, onLayerChange: function(layer){ @@ -36,21 +38,20 @@ var TravelnetOverlay = L.LayerGroup.extend({ .then(function(travelnets){ //TODO: remove non-existing markers, add new ones if (!full) - this.clearLayers(); - - console.log(travelnets); - - //TODO: attributes, coords - var marker = L.marker([travelnet.z, travelnet.x], {icon: TravelnetIcon}); + self.clearLayers(); travelnets.forEach(function(travelnet){ - var popup = "