1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-12 15:04:32 +00:00

Geomap: Add colour support for geolayers

This commit is contained in:
jeremy@jermolene.com 2023-01-06 10:37:30 +00:00
parent 6986acb848
commit 11bb058517

View File

@ -74,7 +74,13 @@ GeomapWidget.prototype.renderMap = function(domNode) {
$tw.utils.each(this.wiki.filterTiddlers(this.geomapLayerFilter,this),function(title) {
var tiddler = self.wiki.getTiddler(title);
if(tiddler) {
var layer = L.geoJSON($tw.utils.parseJSONSafe(tiddler.fields.text || "[]",[])).addTo(map);
var layer = L.geoJSON($tw.utils.parseJSONSafe(tiddler.fields.text || "[]",[]),{
style: function(geoJsonFeature) {
return {
color: tiddler.getFieldString("color") || "yellow"
}
}
}).addTo(map);
}
});
}