diff options
Diffstat (limited to 'app/helpers/map_helper.rb')
-rw-r--r-- | app/helpers/map_helper.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/helpers/map_helper.rb b/app/helpers/map_helper.rb new file mode 100644 index 0000000..3403801 --- /dev/null +++ b/app/helpers/map_helper.rb @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2020 IN COMMON Collective <collective@incommon.cc> +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +module MapHelper + def map_container(map = Map.first) + raw tag.div( + tag.div(id: 'map', + data: { + target: 'map.container' + }), + data: { + controller: 'map', + 'map-latitude': map.latitude, + 'map-longitude': map.longitude, + 'map-zoom': map.zoom + }) + end +end |