diff --git a/mapserver_mod/mapserver/border.lua b/mapserver_mod/mapserver/border.lua index d3b4bdb..e8ce3de 100644 --- a/mapserver_mod/mapserver/border.lua +++ b/mapserver_mod/mapserver/border.lua @@ -16,7 +16,7 @@ local update_formspec = function(meta) "button_exit[4,1;4,1;save;Save]" .. -- col 2 - "field[4,2.5;4,1;index;Index;" .. index .. "]" + "field[4,2.5;4,1;index;Index;" .. index .. "]" .. "") end @@ -25,11 +25,6 @@ end minetest.register_node("mapserver:border", { description = "Mapserver Border", tiles = { - "mapserver_border.png", - "mapserver_border.png", - "mapserver_border.png", - "mapserver_border.png", - "mapserver_border.png", "mapserver_border.png" }, groups = {cracky=3,oddly_breakable_by_hand=3}, diff --git a/mapserver_mod/mapserver/init.lua b/mapserver_mod/mapserver/init.lua index 79cda75..ee60d92 100644 --- a/mapserver_mod/mapserver/init.lua +++ b/mapserver_mod/mapserver/init.lua @@ -4,6 +4,8 @@ mapserver = {} local MP = minetest.get_modpath("mapserver") dofile(MP.."/poi.lua") dofile(MP.."/train.lua") +dofile(MP.."/label.lua") +dofile(MP.."/border.lua") -- optional mapserver-bridge stuff below @@ -26,7 +28,7 @@ if http then print("[Mapserver] starting mapserver-bridge with endpoint: " .. mapserver_url) dofile(MP .. "/bridge.lua") mapserver.bridge_init(http, mapserver_url, mapserver_key) - + else print("[Mapserver] bridge not active, additional infos will not be visible on the map") diff --git a/mapserver_mod/mapserver/label.lua b/mapserver_mod/mapserver/label.lua index a7b25d1..03ae95a 100644 --- a/mapserver_mod/mapserver/label.lua +++ b/mapserver_mod/mapserver/label.lua @@ -26,11 +26,6 @@ end minetest.register_node("mapserver:label", { description = "Mapserver Label", tiles = { - "mapserver_label.png", - "mapserver_label.png", - "mapserver_label.png", - "mapserver_label.png", - "mapserver_label.png", "mapserver_label.png" }, groups = {cracky=3,oddly_breakable_by_hand=3}, diff --git a/mapserver_mod/mapserver/poi.lua b/mapserver_mod/mapserver/poi.lua index 73ab095..28da29f 100644 --- a/mapserver_mod/mapserver/poi.lua +++ b/mapserver_mod/mapserver/poi.lua @@ -26,11 +26,6 @@ end minetest.register_node("mapserver:poi", { description = "Mapserver POI", tiles = { - "mapserver_poi.png", - "mapserver_poi.png", - "mapserver_poi.png", - "mapserver_poi.png", - "mapserver_poi.png", "mapserver_poi.png" }, groups = {cracky=3,oddly_breakable_by_hand=3}, diff --git a/mapserver_mod/mapserver/textures/mapserver_border.png b/mapserver_mod/mapserver/textures/mapserver_border.png index 84fb074..5bc3067 100644 Binary files a/mapserver_mod/mapserver/textures/mapserver_border.png and b/mapserver_mod/mapserver/textures/mapserver_border.png differ diff --git a/mapserver_mod/mapserver/textures/mapserver_label.png b/mapserver_mod/mapserver/textures/mapserver_label.png index 84fb074..ed03e34 100644 Binary files a/mapserver_mod/mapserver/textures/mapserver_label.png and b/mapserver_mod/mapserver/textures/mapserver_label.png differ diff --git a/mapserver_mod/mapserver/train.lua b/mapserver_mod/mapserver/train.lua index c26e68a..a906dbd 100644 --- a/mapserver_mod/mapserver/train.lua +++ b/mapserver_mod/mapserver/train.lua @@ -27,11 +27,6 @@ end minetest.register_node("mapserver:train", { description = "Mapserver Train", tiles = { - "mapserver_train.png", - "mapserver_train.png", - "mapserver_train.png", - "mapserver_train.png", - "mapserver_train.png", "mapserver_train.png" }, groups = {cracky=3,oddly_breakable_by_hand=3}, diff --git a/server/static/js/overlays/LabelOverlay.js b/server/static/js/overlays/LabelOverlay.js index dac7864..9f2fa45 100644 --- a/server/static/js/overlays/LabelOverlay.js +++ b/server/static/js/overlays/LabelOverlay.js @@ -1,15 +1,34 @@ 'use strict'; +var LabelIcon = L.Icon.extend({ + initialize: function(options) { + L.Icon.prototype.initialize.call(this, options); + }, + + createIcon: function (oldIcon) { + var div = document.createElement('div'), + options = this.options; + + div.innerHTML = options.html || ""; + + return div; + } +}); + var LabelOverlay = AbstractIconOverlay.extend({ initialize: function(wsChannel, layerMgr) { AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "label"); }, getIcon: function(lbl){ - return L.divIcon({html: lbl.attributes.text}); + return new LabelIcon({ + iconAnchor: [15, 50], + iconSize: [30, 100], + html: "" + }); }, createPopup: function(lbl){ - return "
" + lbl.attributes.text + ""; + return "
" + lbl.attributes.text + "
"; } });