From b81ecde7998dd1ac8bb2549117e8e55080667ffe Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Tue, 26 Feb 2019 21:19:01 +0100 Subject: [PATCH] label fixes --- mapserver_mod/mapserver/border.lua | 7 +----- mapserver_mod/mapserver/init.lua | 4 ++- mapserver_mod/mapserver/label.lua | 5 ---- mapserver_mod/mapserver/poi.lua | 5 ---- .../mapserver/textures/mapserver_border.png | Bin 291 -> 1716 bytes .../mapserver/textures/mapserver_label.png | Bin 291 -> 1721 bytes mapserver_mod/mapserver/train.lua | 5 ---- server/static/js/overlays/LabelOverlay.js | 23 ++++++++++++++++-- 8 files changed, 25 insertions(+), 24 deletions(-) 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 84fb0740adfbf4e61db3f653caf9c7509e9fe012..5bc3067ee9af7aaa32bae2e4616bd2d41df384cb 100644 GIT binary patch delta 1591 zcmV-72FUrN0<;Z~BYy>pdQ@0+Qek%>aB^>EX>4U6ba`-PAZ2)IW&i+q+O=3)mcytH z{MRaG34j2>a(JFIJGjfA0+YmfJ4xU8v@uVWRFW(=wg3Iw=^y+|^oFdH;G_2nKO1c{ z2@gSSzpd5E&inkCHHH4wIGra9h8QhxUEkLFgmHJ-Aa;%C>wj^Qvd#(XpfzzikcZ?U zZLJIIAU4~$UVVydU$Q%O)?aCxCVCxu+qVK^REI$}WEx`}cR!>s5OCzg<2m8an{70) zWrw@t@Yr^Ae!MZ>`RT@XDy?z8HU%la7Wf+*t#R!h+iqHDk4Rr6Urm67r1rm^?Ru}F z_qJ)5tcRsMEq|p>s>~-W%rGU-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3dnCfaYh`LqPMxEN18R_}{`b@Aw@1zac`Ks$+{! z2;*D9hv?-yr_XQD)AM+5jUZ2*cO5#o?rn#DK4Eoe_NEWaDU{ze(tpDVJKrrfee#hZ zFb?Aa8WSx#;U>9b00020kzYi5V8JGsJ$W(;e`;~z=-}Y+ z-@(BF!vWY7Qv$G=iBb>^6u=q+15y;@O9Rx3g3%BdEr>?bz-R~zo!St&@*q?Tk}5Ye p(!gkwY-BoM#CFYCVA)}y005V@YRf%2-D&^;002ovPDHLkV1h)90sQ~~ delta 159 zcmV;Q0AT;L4Wj~(Ba^xXE)L=e84ds~_!t{900026llBEfe;9SZ&~QNO^m;f(7ssX! zmpnxwP@UPxP@UO`)6mxG^#s*WB?_=v0J9uf&B#rJ*wPAJ9Y9L(ljQ*P_{NnkNNN!g zYcW0_B0GYVP+)X$aQN@w;4tt_veBY=)B&Ro7L>d49 diff --git a/mapserver_mod/mapserver/textures/mapserver_label.png b/mapserver_mod/mapserver/textures/mapserver_label.png index 84fb0740adfbf4e61db3f653caf9c7509e9fe012..ed03e34e827e366b1160305eb8bb8544486faf07 100644 GIT binary patch delta 1661 zcmV-@27>vc0=W&4BYy>pdQ@0+Qek%>aB^>EX>4U6ba`-PAZ2)IW&i+q+O=0{dh93+ z{Ld-o2nZ0%am1qUn;XpWr-a?^CCQt-ydFDg7R#bk1p>SE&)@3)!WFn=m$=m2a`w1V zODza0)gRYUl27}0U*UX&_EW#R9t3nnl<{chb=nL1`TjylXMcZx?ssLJe(LGyd~kCZ zZDbqmw5zA17><5A+peAONqPw9{2%Lxgifcg?NmURE{?2pe>IG<00{KC=MPy9J|o1sTUbRYTYfwpTBeBe%X zR@HSxCnda@nJ!kSGN4*Scet?79=GlB233qa36_E2jPS;X z+kMvgllyX{YEzfU*NZFQ3N`@&!<4gMSV0idlT+UO?tj}o%p3n8Y=nZmX|4!Rd_P=t zru*EATjvNn_R0BUX;7J`15kvq8DJ z*ugG88mTuuI<(x_P4&|IlcPjT$w@*}?vUilY1+rCWocgFp zY%rEGW9ZZNq*#N5-lzO#-N{d09=fV%@(&I7)cStI!a!&iMMozPSvX-rIT%Wwb3g%T zV}C6qO4&94jnaMB@GQGc7L3?tg;e8&16U3fWabBq{I(o2m-OANtm8gqn!3kliP~*6S663G9flO2xNox|L zmzA3;Hb-5mmLBj<&x^G$Exoleve_bGF@Nk?Q_)eiYje ziY0%fA>hznin5nxVE|~gtOcNMr80GnmCQtROf4)kd#&E=&FWUh%H|HKZ{t*;N~>C2 zs5t^SnK)*owMPxvesLsOL&vx?gt9Iws;z9hywvbUp@Sy-gg9v0qU0A(Q7 zhXf6A#e|U^PPg#6qv|`Vgs8AxYkxRGx`kF`4jeR%2E?@{=1i*Q^d!)o3?Av;zP4V< zD=FIsV(Tm2*Vx@mgZoT@?+EZ9bl@i09Wta-2Hi4rlOb{)Cc~oyR&sw?x|D2=yGI`A z0}DY)ijOJan&95=DSl0Gchl)uG4%DyuUPoMP}E(LZua+xKt2&MjuzXng@0{MUUS0| zmuEF^QMiv`9El-Rd(6jrZ-9t-VRd}*Oeu}7jCQV6_md_1S?Tyc48B{sHvzK5_7*@d zj(!dZWWNW{v!g!%gina~0D5xtCxE(qHIW9{{quy1!pP(Fzt~c zFn{9$8WSuba#%sm00025NklI@C{k^pwE0RL8!K(fwZMbzId>VrujMHRZUe}* zHya?f;v+5C+o&luM6?o7{RasjL=3Y{FyUn9CSZ?e;+^T z%4P!~xN+;25f6(+!2CWqi|ZTonW6-aG-s9hWa$d-;{+YJe)&hDe6ZGLdIb1pBt!xWpAJ>)`ca z@>7N{KaNe+^T-ku%r>->SF&!J5|99L%KHZo3_kd7y11wUYJSJtSsM>@9cg4@m|E(^ UD7>`|=ynDMPgg&ebxsLQ0CcuuF#rGn 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: "" + lbl.attributes.text + "" + }); }, createPopup: function(lbl){ - return "
" + lbl.attributes.text + "
"; + return "

" + lbl.attributes.text + "

"; } });