colored poi's
12
doc/internal/textures.md
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
# convert
|
||||
|
||||
```sh
|
||||
sudo apt install imagemagick
|
||||
convert markers-soft.png -crop 36x46+0+0 -resize 28% mapserver_poi_red.png
|
||||
convert markers-soft.png -crop 36x46+36+0 -resize 28% mapserver_poi_orange.png
|
||||
convert markers-soft.png -crop 36x46+72+0 -resize 28% mapserver_poi_green.png
|
||||
convert markers-soft.png -crop 36x46+108+0 -resize 28% mapserver_poi_blue.png
|
||||
convert markers-soft.png -crop 36x46+144+0 -resize 28% mapserver_poi_violet.png
|
||||
convert markers-soft.png -crop 36x46+180+0 -resize 28% mapserver_poi_brown.png
|
||||
```
|
@ -54,3 +54,7 @@
|
||||
* minecart_logo.png
|
||||
** License: CC0
|
||||
** Source [minecart](https://github.com/joe7575/minecart)
|
||||
|
||||
* mapserver_gold_block.png
|
||||
** License: CC BY-SA 3.0
|
||||
** Source [minetest_game](https://github.com/minetest/minetest_game)
|
||||
|
@ -1,3 +1,4 @@
|
||||
default
|
||||
dye
|
||||
advtrains?
|
||||
minecart?
|
||||
|
@ -20,11 +20,11 @@ local update_formspec = function(meta)
|
||||
|
||||
end
|
||||
|
||||
|
||||
minetest.register_node("mapserver:poi", {
|
||||
description = "Mapserver POI",
|
||||
local register_poi = function(color)
|
||||
minetest.register_node("mapserver:poi:" .. color, {
|
||||
description = "Mapserver POI (" .. color .. ")",
|
||||
tiles = {
|
||||
"mapserver_poi.png"
|
||||
"[combine:16x16:0,0=mapserver_gold_block.png:3,2=mapserver_poi_" .. color .. ".png"
|
||||
},
|
||||
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
@ -62,11 +62,21 @@ minetest.register_node("mapserver:poi", {
|
||||
|
||||
if mapserver.enable_crafting then
|
||||
minetest.register_craft({
|
||||
output = 'mapserver:poi',
|
||||
output = 'mapserver:poi_' .. color,
|
||||
recipe = {
|
||||
{"", "dye:blue", ""},
|
||||
{"", "dye:" .. color, ""},
|
||||
{"default:paper", "default:goldblock", "default:paper"},
|
||||
{"", "default:glass", ""}
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
register_poi("blue")
|
||||
register_poi("green")
|
||||
register_poi("orange")
|
||||
register_poi("red")
|
||||
register_poi("purple")
|
||||
|
||||
-- default poi was always blue
|
||||
minetest.register_alias("mapserver:poi", "mapserver:poi_blue")
|
||||
|
BIN
mapserver_mod/mapserver/textures/mapserver_gold_block.png
Normal file
After Width: | Height: | Size: 483 B |
Before Width: | Height: | Size: 313 B |
BIN
mapserver_mod/mapserver/textures/mapserver_poi_blue.png
Normal file
After Width: | Height: | Size: 900 B |
BIN
mapserver_mod/mapserver/textures/mapserver_poi_green.png
Normal file
After Width: | Height: | Size: 900 B |
BIN
mapserver_mod/mapserver/textures/mapserver_poi_orange.png
Normal file
After Width: | Height: | Size: 900 B |
BIN
mapserver_mod/mapserver/textures/mapserver_poi_red.png
Normal file
After Width: | Height: | Size: 900 B |
BIN
mapserver_mod/mapserver/textures/mapserver_poi_violet.png
Normal file
After Width: | Height: | Size: 891 B |
@ -5,7 +5,9 @@ import (
|
||||
"mapserver/mapobjectdb"
|
||||
)
|
||||
|
||||
type PoiBlock struct{}
|
||||
type PoiBlock struct {
|
||||
Color string
|
||||
}
|
||||
|
||||
func (this *PoiBlock) onMapObject(x, y, z int, block *mapblockparser.MapBlock) *mapobjectdb.MapObject {
|
||||
md := block.Metadata.GetMetadata(x, y, z)
|
||||
@ -15,6 +17,8 @@ func (this *PoiBlock) onMapObject(x, y, z int, block *mapblockparser.MapBlock) *
|
||||
o.Attributes["category"] = md["category"]
|
||||
o.Attributes["url"] = md["url"]
|
||||
o.Attributes["owner"] = md["owner"]
|
||||
o.Attributes["icon"] = md["icon"]
|
||||
o.Attributes["color"] = this.Color
|
||||
|
||||
return o
|
||||
}
|
||||
|
@ -13,7 +13,12 @@ func Setup(ctx *app.App) {
|
||||
|
||||
//mapserver stuff
|
||||
if ctx.Config.MapObjects.MapserverPOI {
|
||||
l.AddMapObject("mapserver:poi", &PoiBlock{})
|
||||
l.AddMapObject("mapserver:poi", &PoiBlock{Color: "blue"})
|
||||
l.AddMapObject("mapserver:poi_blue", &PoiBlock{Color: "blue"})
|
||||
l.AddMapObject("mapserver:poi_green", &PoiBlock{Color: "green"})
|
||||
l.AddMapObject("mapserver:poi_orange", &PoiBlock{Color: "orange"})
|
||||
l.AddMapObject("mapserver:poi_red", &PoiBlock{Color: "red"})
|
||||
l.AddMapObject("mapserver:poi_purple", &PoiBlock{Color: "purple"})
|
||||
}
|
||||
|
||||
if ctx.Config.MapObjects.MapserverTrainline {
|
||||
|
@ -1,22 +1,19 @@
|
||||
/* exported PoiOverlay */
|
||||
/* globals AbstractIconOverlay: true */
|
||||
|
||||
var PoiIcon = L.icon({
|
||||
iconUrl: 'css/images/marker-icon.png',
|
||||
shadowUrl: 'css/images/marker-shadow.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
tooltipAnchor: [16, -28],
|
||||
shadowSize: [41, 41]
|
||||
});
|
||||
|
||||
|
||||
var PoiOverlay = AbstractIconOverlay.extend({
|
||||
initialize: function(wsChannel, layerMgr) {
|
||||
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "poi", PoiIcon);
|
||||
},
|
||||
|
||||
getIcon: function(obj){
|
||||
return L.AwesomeMarkers.icon({
|
||||
icon: obj.attributes.icon || "home",
|
||||
prefix: "fa",
|
||||
markerColor: obj.attributes.color || "blue"
|
||||
});
|
||||
},
|
||||
|
||||
getMaxDisplayedZoom: function(){
|
||||
return 5;
|
||||
},
|
||||
|