label fixes
This commit is contained in:
parent
afef0e1aa5
commit
b81ecde799
@ -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},
|
||||
|
@ -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")
|
||||
|
||||
|
@ -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},
|
||||
|
@ -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},
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 1.7 KiB |
@ -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},
|
||||
|
@ -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: "<svg height='30' width='100'><text x='0' y='15'>" + lbl.attributes.text + "</text></svg>"
|
||||
});
|
||||
},
|
||||
|
||||
createPopup: function(lbl){
|
||||
return "<pre>" + lbl.attributes.text + "</pre>";
|
||||
return "<p>" + lbl.attributes.text + "</p>";
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user