forked from MTSR/mapserver
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]" ..
|
"button_exit[4,1;4,1;save;Save]" ..
|
||||||
|
|
||||||
-- col 2
|
-- col 2
|
||||||
"field[4,2.5;4,1;index;Index;" .. index .. "]"
|
"field[4,2.5;4,1;index;Index;" .. index .. "]" ..
|
||||||
"")
|
"")
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -25,11 +25,6 @@ end
|
|||||||
minetest.register_node("mapserver:border", {
|
minetest.register_node("mapserver:border", {
|
||||||
description = "Mapserver Border",
|
description = "Mapserver Border",
|
||||||
tiles = {
|
tiles = {
|
||||||
"mapserver_border.png",
|
|
||||||
"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},
|
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||||
|
@ -4,6 +4,8 @@ mapserver = {}
|
|||||||
local MP = minetest.get_modpath("mapserver")
|
local MP = minetest.get_modpath("mapserver")
|
||||||
dofile(MP.."/poi.lua")
|
dofile(MP.."/poi.lua")
|
||||||
dofile(MP.."/train.lua")
|
dofile(MP.."/train.lua")
|
||||||
|
dofile(MP.."/label.lua")
|
||||||
|
dofile(MP.."/border.lua")
|
||||||
|
|
||||||
|
|
||||||
-- optional mapserver-bridge stuff below
|
-- optional mapserver-bridge stuff below
|
||||||
@ -26,7 +28,7 @@ if http then
|
|||||||
print("[Mapserver] starting mapserver-bridge with endpoint: " .. mapserver_url)
|
print("[Mapserver] starting mapserver-bridge with endpoint: " .. mapserver_url)
|
||||||
dofile(MP .. "/bridge.lua")
|
dofile(MP .. "/bridge.lua")
|
||||||
mapserver.bridge_init(http, mapserver_url, mapserver_key)
|
mapserver.bridge_init(http, mapserver_url, mapserver_key)
|
||||||
|
|
||||||
else
|
else
|
||||||
print("[Mapserver] bridge not active, additional infos will not be visible on the map")
|
print("[Mapserver] bridge not active, additional infos will not be visible on the map")
|
||||||
|
|
||||||
|
@ -26,11 +26,6 @@ end
|
|||||||
minetest.register_node("mapserver:label", {
|
minetest.register_node("mapserver:label", {
|
||||||
description = "Mapserver Label",
|
description = "Mapserver Label",
|
||||||
tiles = {
|
tiles = {
|
||||||
"mapserver_label.png",
|
|
||||||
"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},
|
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||||
|
@ -26,11 +26,6 @@ end
|
|||||||
minetest.register_node("mapserver:poi", {
|
minetest.register_node("mapserver:poi", {
|
||||||
description = "Mapserver POI",
|
description = "Mapserver POI",
|
||||||
tiles = {
|
tiles = {
|
||||||
"mapserver_poi.png",
|
|
||||||
"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},
|
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", {
|
minetest.register_node("mapserver:train", {
|
||||||
description = "Mapserver Train",
|
description = "Mapserver Train",
|
||||||
tiles = {
|
tiles = {
|
||||||
"mapserver_train.png",
|
|
||||||
"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},
|
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||||
|
@ -1,15 +1,34 @@
|
|||||||
'use strict';
|
'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({
|
var LabelOverlay = AbstractIconOverlay.extend({
|
||||||
initialize: function(wsChannel, layerMgr) {
|
initialize: function(wsChannel, layerMgr) {
|
||||||
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "label");
|
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "label");
|
||||||
},
|
},
|
||||||
|
|
||||||
getIcon: function(lbl){
|
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){
|
createPopup: function(lbl){
|
||||||
return "<pre>" + lbl.attributes.text + "</pre>";
|
return "<p>" + lbl.attributes.text + "</p>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user