maps: extend marker_colour to also be used for surfaces (#57279)
gitea-wip/combo/pipeline/head There was a failure building this commit Details
gitea/combo/pipeline/head Build started... Details

This commit is contained in:
Frédéric Péters 2021-09-27 10:21:42 +02:00
parent 9fa168c306
commit a6d8e779a3
3 changed files with 5 additions and 2 deletions

View File

@ -75,6 +75,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='maplayer',
name='marker_colour',
field=models.CharField(default='#0000FF', max_length=7, verbose_name='Marker colour'),
field=models.CharField(default='#0000FF', max_length=7, verbose_name='Marker or surface colour'),
),
]

View File

@ -124,7 +124,7 @@ class MapLayer(models.Model):
tiles_default = models.BooleanField(_('Default tiles layer'), default=False)
geojson_url = models.CharField(_('Geojson URL'), max_length=1024)
marker_colour = models.CharField(_('Marker colour'), max_length=7, default='#0000FF')
marker_colour = models.CharField(_('Marker or surface colour'), max_length=7, default='#0000FF')
icon = models.CharField(_('Marker icon'), max_length=32, blank=True, null=True, choices=ICONS)
icon_colour = models.CharField(_('Icon colour'), max_length=7, default='#000000')
cache_duration = models.PositiveIntegerField(_('Cache duration'), default=60, help_text=_('In seconds.'))

View File

@ -87,6 +87,9 @@ $(function() {
geojson_layer.icon_colour +'"></i></span>'
});
return L.marker(latlng, {icon: marker});
},
style: function (feature) {
return {weight: 2, color: geojson_layer.marker_colour, fillColor: geojson_layer.marker_colour};
}
});