Skip to content

Commit

Permalink
fix some style issues for the map attribution
Browse files Browse the repository at this point in the history
  • Loading branch information
goapunk authored and fuzzylogic2000 committed May 4, 2023
1 parent ec1bef3 commit c8c592f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions bplan/assets/js/app/components/map/mapControllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,11 @@ angular.module('app.map.controllers', [])
// if no attribution is set, try to get it from style source
if (!$scope.attribution) {
var maplibreMap = maps.maplibreMap.getMaplibreMap();
maplibreMap.on("style.load", function () {
var sources = maplibreMap.getStyle().sources;
var keys = Object.keys(sources);
maplibreMap.on('style.load', function () {
const sources = maplibreMap.getStyle().sources;
const keys = Object.keys(sources);
keys.every((key, index) => {
if ("attribution" in sources[key]) {
if ('attribution' in sources[key]) {
$scope.map.attributionControl.
addAttribution(sources[key].attribution);
return false;
Expand Down
3 changes: 2 additions & 1 deletion bplan/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['afs_behoer'] = self.request.GET.get('afs_behoer', '')
context['map_baseurl'] = settings.MAP_BASEURL
attribution = ''
if hasattr(settings, 'MAP_ATTRIBUTION'):
attribution = settings.MAP_ATTRIBUTION
context['map_attribution'] = attribution
Expand All @@ -41,7 +42,7 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['afs_behoer'] = self.request.GET.get('afs_behoer', '')
context['map_baseurl'] = settings.MAP_BASEURL
attribution = ""
attribution = ''
if hasattr(settings, 'MAP_ATTRIBUTION'):
attribution = settings.MAP_ATTRIBUTION
context['map_attribution'] = attribution
Expand Down

0 comments on commit c8c592f

Please sign in to comment.