Compare commits

...

4 Commits

Author SHA1 Message Date
c45f002f82
tweak trains and trainlines displayed zoom (#412) 2024-11-11 19:51:31 +01:00
e1c9bdb8bd
Show layer selector only if more that one layer (#411)
Co-authored-by: Pierre-Yves Rollo <dev@pyrollo.com>
2024-11-11 19:50:45 +01:00
BuckarooBanzay
a7b5226fd1 add a / alpha component to json color mapping export 2024-08-11 13:44:11 +02:00
1F616EMO~nya
f266593f9a
Add address for POIs (#404)
* Add address for POIs

* Add missing semicolon
2024-08-10 09:19:24 +02:00
6 changed files with 16 additions and 4 deletions

View File

@ -17,6 +17,7 @@ func (this *PoiBlock) onMapObject(mbpos *types.MapBlockCoords, x, y, z int, bloc
o := mapobjectdb.NewMapObject(mbpos, x, y, z, "poi")
o.Attributes["name"] = md["name"]
o.Attributes["category"] = md["category"]
o.Attributes["addr"] = md["addr"]
o.Attributes["url"] = md["url"]
o.Attributes["image"] = md["image"]
o.Attributes["owner"] = md["owner"]

View File

@ -7,9 +7,11 @@ function onchange(e){
m.route.set("/map/:layerId/:zoom/:lon/:lat", params);
}
export default {
view: function(){
// Display layer selector only if there is choice
if (LayerManager.layers.length <= 1)
return null;
const layers = LayerManager.layers.map(layer => m(
"option",

View File

@ -35,7 +35,11 @@ export default AbstractIconOverlay.extend({
"\" crossorigin=\"anonymous\" referrerpolicy=\"origin-when-cross-origin\"></div>";
}
innerHTML += "<hr><b>Owner: </b> " + HtmlSanitizer.SanitizeHtml(poi.attributes.owner) + "<br>";
innerHTML += "<hr>";
if (poi.attributes.addr) {
innerHTML += "<b>Address: </b> " + HtmlSanitizer.SanitizeHtml(poi.attributes.addr) + "<br>";
}
innerHTML += "<b>Owner: </b> " + HtmlSanitizer.SanitizeHtml(poi.attributes.owner) + "<br>";
return innerHTML;
}

View File

@ -71,7 +71,7 @@ export default L.LayerGroup.extend({
getMaxDisplayedZoom: function(){
return 10;
return 7;
},
createMarker: function(train){

View File

@ -58,6 +58,10 @@ export default AbstractGeoJsonOverlay.extend({
}
});
},
getMaxDisplayedZoom: function(){
return 4;
},
createGeoJson: function(objects){
var self = this;

View File

@ -9,6 +9,7 @@ type Color struct {
R uint8 `json:"r"`
G uint8 `json:"g"`
B uint8 `json:"b"`
A uint8 `json:"a"`
}
func (api *Api) GetColorMapping(resp http.ResponseWriter, req *http.Request) {
@ -16,7 +17,7 @@ func (api *Api) GetColorMapping(resp http.ResponseWriter, req *http.Request) {
cm := make(map[string]Color)
for k, v := range api.Context.Colormapping.GetColors() {
cm[k] = Color{R: v.R, G: v.G, B: v.B}
cm[k] = Color{R: v.R, G: v.G, B: v.B, A: v.A}
}
resp.Header().Add("content-type", "application/json")