Skip to content

Commit

Permalink
Merge pull request #175 from unepwcmc/map-image-fix
Browse files Browse the repository at this point in the history
attempted fix for missing images for map
  • Loading branch information
nym1k authored Jun 8, 2021
2 parents 5f0216d + 68a93f5 commit e8e330a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/serializers/serializers/map_datasets_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
addUnderneath: true,
name: I18n.t('global.map.wdpa_title'),
disabled: false,
image: ActionController::Base.helpers.image_url('map/stripes-wdpa.png')
image: 'map/stripes-wdpa.png'
},
{
id: 'oecm',
Expand All @@ -131,7 +131,7 @@
addUnderneath: true,
name: I18n.t('global.map.oecm_title'),
disabled: false,
image: ActionController::Base.helpers.image_url('map/stripes-oecm.png')
image: 'map/stripes-oecm.png'
}
].freeze

Expand Down Expand Up @@ -163,11 +163,19 @@ def serialize()

dataset
end
habitat_datasets + WDPA_DATASETS
habitat_datasets + wdpa_datasets
end

private

def wdpa_datasets
WDPA_DATASETS.map do |ds|
dataset = ds.dup
dataset[:image] = ActionController::Base.helpers.image_url(dataset[:image])

dataset
end
end

def habitat_presence_status dataset
@habitat_presence_statuses[dataset[:id]]
Expand Down

0 comments on commit e8e330a

Please sign in to comment.