forked from MTSR/mapserver
atm overlay
This commit is contained in:
parent
27b210d557
commit
5d7ba84d2c
@ -11,31 +11,31 @@
|
|||||||
* sam.png
|
* sam.png
|
||||||
* heart.png
|
* heart.png
|
||||||
* default_tool_mesepick.png
|
* default_tool_mesepick.png
|
||||||
** License: CC BY-SA 3.0
|
* License: CC BY-SA 3.0
|
||||||
** Source: [minetest_game](https://github.com/minetest/minetest_game)
|
* Source: [minetest_game](https://github.com/minetest/minetest_game)
|
||||||
|
|
||||||
* travelnet_inv.png
|
* travelnet_inv.png
|
||||||
** License: CC BY-SA 3.0
|
* License: CC BY-SA 3.0
|
||||||
** Source: [travelnet](https://github.com/Sokomine/travelnet)
|
* Source: [travelnet](https://github.com/Sokomine/travelnet)
|
||||||
|
|
||||||
* technic_admin_anchor.png
|
* technic_admin_anchor.png
|
||||||
* technic_hv_nuclear_reactor_core.png
|
* technic_hv_nuclear_reactor_core.png
|
||||||
* technic_water_mill_top_active.png
|
* technic_water_mill_top_active.png
|
||||||
** LGPL, V2
|
* LGPL, V2
|
||||||
** Source: [technic](https://github.com/minetest-mods/technic)
|
* Source: [technic](https://github.com/minetest-mods/technic)
|
||||||
|
|
||||||
* lcd_lcd.png
|
* lcd_lcd.png
|
||||||
** WTFPL
|
* WTFPL
|
||||||
** Source: [digilines](https://github.com/minetest-mods/digilines)
|
* Source: [digilines](https://github.com/minetest-mods/digilines)
|
||||||
|
|
||||||
* jeija_luacontroller_top.png
|
* jeija_luacontroller_top.png
|
||||||
* jeija_luacontroller_burnt_top.png
|
* jeija_luacontroller_burnt_top.png
|
||||||
** CC-BY-SA-3.0
|
* CC-BY-SA-3.0
|
||||||
** Source [mesecons](https://github.com/minetest-mods/mesecons)
|
* Source [mesecons](https://github.com/minetest-mods/mesecons)
|
||||||
|
|
||||||
* digiterms_beige_front.png
|
* digiterms_beige_front.png
|
||||||
** License: CC BY-SA 3.0
|
* License: CC BY-SA 3.0
|
||||||
** Source [digiterms](https://github.com/Pyrollo/digiterms)
|
* Source [digiterms](https://github.com/Pyrollo/digiterms)
|
||||||
|
|
||||||
|
|
||||||
* advtrains_detailed_engine_steam_inv.png
|
* advtrains_detailed_engine_steam_inv.png
|
||||||
@ -48,13 +48,20 @@
|
|||||||
* advtrains_wagon_japan_inv.png
|
* advtrains_wagon_japan_inv.png
|
||||||
* advtrains_wagon_tank_inv.png
|
* advtrains_wagon_tank_inv.png
|
||||||
* advtrains_wagon_wood_inv.png
|
* advtrains_wagon_wood_inv.png
|
||||||
** License: CC BY-SA 3.0
|
* License: CC BY-SA 3.0
|
||||||
** Source [advtrains](http://advtrains.bleipb.de/)
|
* Source [advtrains](http://advtrains.bleipb.de/)
|
||||||
|
|
||||||
* minecart_logo.png
|
* minecart_logo.png
|
||||||
** License: CC0
|
* License: CC0
|
||||||
** Source [minecart](https://github.com/joe7575/minecart)
|
* Source [minecart](https://github.com/joe7575/minecart)
|
||||||
|
|
||||||
* mapserver_gold_block.png
|
* mapserver_gold_block.png
|
||||||
** License: CC BY-SA 3.0
|
* License: CC BY-SA 3.0
|
||||||
** Source [minetest_game](https://github.com/minetest/minetest_game)
|
* Source [minetest_game](https://github.com/minetest/minetest_game)
|
||||||
|
|
||||||
|
* atm_front_wt.png
|
||||||
|
* atm_front.png
|
||||||
|
* atm2_front.png
|
||||||
|
* atm3_front.png
|
||||||
|
* WTFPL
|
||||||
|
* Source: http://git.gpcf.eu/?p=atm.git;a=summary
|
||||||
|
@ -8,5 +8,23 @@ import (
|
|||||||
type ATM struct{}
|
type ATM struct{}
|
||||||
|
|
||||||
func (this *ATM) onMapObject(x, y, z int, block *mapblockparser.MapBlock) *mapobjectdb.MapObject {
|
func (this *ATM) onMapObject(x, y, z int, block *mapblockparser.MapBlock) *mapobjectdb.MapObject {
|
||||||
return mapobjectdb.NewMapObject(block.Pos, x, y, z, "atm")
|
nodename := block.GetNodeName(x, y, z)
|
||||||
|
|
||||||
|
o := mapobjectdb.NewMapObject(block.Pos, x, y, z, "atm")
|
||||||
|
|
||||||
|
if nodename == "atm:wtt" {
|
||||||
|
o.Attributes["type"] = "wiretransfer"
|
||||||
|
|
||||||
|
} else if nodename == "atm:atm2" {
|
||||||
|
o.Attributes["type"] = "atm2"
|
||||||
|
|
||||||
|
} else if nodename == "atm:atm3" {
|
||||||
|
o.Attributes["type"] = "atm3"
|
||||||
|
|
||||||
|
} else {
|
||||||
|
o.Attributes["type"] = "atm"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return o
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,11 @@ func Setup(ctx *app.App) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ctx.Config.MapObjects.ATM {
|
if ctx.Config.MapObjects.ATM {
|
||||||
l.AddMapObject("atm:atm", &ATM{})
|
atm := &ATM{}
|
||||||
|
l.AddMapObject("atm:atm", atm)
|
||||||
|
l.AddMapObject("atm:atm2", atm)
|
||||||
|
l.AddMapObject("atm:atm3", atm)
|
||||||
|
l.AddMapObject("atm:wtt", atm)
|
||||||
}
|
}
|
||||||
|
|
||||||
//locator
|
//locator
|
||||||
|
@ -142,4 +142,11 @@ function Overlaysetup(cfg, map, overlays, wsChannel, layerMgr){
|
|||||||
map.addLayer(overlays.Minecart);
|
map.addLayer(overlays.Minecart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cfg.mapobjects.atm) {
|
||||||
|
overlays.ATM = new ATMOverlay(wsChannel, layerMgr);
|
||||||
|
if (cfg.defaultoverlays.indexOf("atm") >= 0) {
|
||||||
|
map.addLayer(overlays.ATM);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
40
server/static/js/overlays/ATMOverlay.js
Normal file
40
server/static/js/overlays/ATMOverlay.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/* exported ATMOverlay */
|
||||||
|
/* globals AbstractIconOverlay: true */
|
||||||
|
|
||||||
|
|
||||||
|
var ATMOverlay = AbstractIconOverlay.extend({
|
||||||
|
initialize: function(wsChannel, layerMgr) {
|
||||||
|
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "atm");
|
||||||
|
},
|
||||||
|
|
||||||
|
getMaxDisplayedZoom: function(){
|
||||||
|
return 10;
|
||||||
|
},
|
||||||
|
|
||||||
|
getIcon: function(obj){
|
||||||
|
var img = "pics/atm_front.png"
|
||||||
|
|
||||||
|
if (obj.attributes.type == "wiretransfer")
|
||||||
|
img = "pics/atm_front.png";
|
||||||
|
else if (obj.attributes.type == "atm2")
|
||||||
|
img = "pics/atm2_front.png";
|
||||||
|
else if (obj.attributes.type == "atm3")
|
||||||
|
img = "pics/atm3_front.png";
|
||||||
|
|
||||||
|
L.icon({
|
||||||
|
iconUrl: img,
|
||||||
|
iconSize: [16, 16],
|
||||||
|
iconAnchor: [8, 8],
|
||||||
|
popupAnchor: [0, -8]
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
createPopup: function(obj){
|
||||||
|
var title = "ATM";
|
||||||
|
|
||||||
|
if (obj.attributes.type == "wiretransfer")
|
||||||
|
title = "Wiretransfer";
|
||||||
|
|
||||||
|
return "<h4>" + title + "</h4>";
|
||||||
|
}
|
||||||
|
});
|
@ -20,6 +20,7 @@
|
|||||||
"/js/search/SearchInput.js",
|
"/js/search/SearchInput.js",
|
||||||
"/js/overlays/AbstractIconOverlay.js",
|
"/js/overlays/AbstractIconOverlay.js",
|
||||||
"/js/overlays/AbstractGeoJsonOverlay.js",
|
"/js/overlays/AbstractGeoJsonOverlay.js",
|
||||||
|
"/js/overlays/ATMOverlay.js",
|
||||||
"/js/overlays/TravelnetOverlay.js",
|
"/js/overlays/TravelnetOverlay.js",
|
||||||
"/js/overlays/ShopOverlay.js",
|
"/js/overlays/ShopOverlay.js",
|
||||||
"/js/overlays/PoiOverlay.js",
|
"/js/overlays/PoiOverlay.js",
|
||||||
|
BIN
server/static/pics/atm2_front.png
Normal file
BIN
server/static/pics/atm2_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 235 B |
BIN
server/static/pics/atm3_front.png
Normal file
BIN
server/static/pics/atm3_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 222 B |
BIN
server/static/pics/atm_front.png
Normal file
BIN
server/static/pics/atm_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 272 B |
BIN
server/static/pics/atm_front_wt.png
Normal file
BIN
server/static/pics/atm_front_wt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 356 B |
Loading…
Reference in New Issue
Block a user