diff --git a/source/php/Module/Map/Map.php b/source/php/Module/Map/Map.php index ea52b67e7..e4107003e 100644 --- a/source/php/Module/Map/Map.php +++ b/source/php/Module/Map/Map.php @@ -24,7 +24,7 @@ public function data() : array $data = array(); //Shared template data - $data['height'] = !empty($fields['height']) ? $fields['height'] . 'px' : '400px'; + $data['height'] = !empty($fields['height']) ? $fields['height'] : '400'; $this->template = $fields['map_type']; if ($fields['map_type'] == 'openStreetMap') { @@ -71,14 +71,14 @@ private function defaultTemplateData($data, $fields) { //Create data array $data['map_url'] = $map_url; - $data['map_description'] = $fields['map_description']; + $data['map_description'] = !empty($fields['map_description']) ? $fields['map_description'] : ''; - $data['show_button'] = $fields['show_button']; - $data['button_label'] = $fields['button_label']; - $data['button_url'] = $fields['button_url']; - $data['more_info_button'] = $fields['more_info_button']; - $data['more_info'] = $fields['more_info']; - $data['more_info_title'] = $fields['more_info_title']; + $data['show_button'] = !empty($fields['show_button']) ? $fields['show_button'] : false; + $data['button_label'] = !empty($fields['button_label']) ? $fields['button_label'] : false; + $data['button_url'] = !empty($fields['button_url']) ? $fields['button_url'] : false; + $data['more_info_button'] = !empty($fields['more_info_button']) ? $fields['more_info_button'] : false; + $data['more_info'] = !empty($fields['more_info']) ? $fields['more_info'] : false; + $data['more_info_title'] = !empty($fields['more_info_title']) ? $fields['more_info_title'] : false; $data['cardMapCss'] = ($data['more_info_button']) ? 'o-grid-12@xs o-grid-8@md' : 'o-grid-12@md'; $data['cardMoreInfoCss'] = ($data['more_info_button']) ? 'o-grid-12@xs o-grid-4@md' : ''; diff --git a/source/php/Module/Map/views/default.blade.php b/source/php/Module/Map/views/default.blade.php index 7865cf9aa..df55075cb 100644 --- a/source/php/Module/Map/views/default.blade.php +++ b/source/php/Module/Map/views/default.blade.php @@ -1,4 +1,4 @@ - {{$cardMoreCardCss}} +
@card([ @@ -8,7 +8,7 @@ ], 'attributeList' => [ 'aria-labelledby' => 'mod-map-' . $id .'-label', - 'style' => 'min-height: ' . $height . ';' + 'style' => 'min-height: ' . $height . 'px;' ], 'context' => 'module.map' ]) diff --git a/source/php/Module/Map/views/openStreetMap.blade.php b/source/php/Module/Map/views/openStreetMap.blade.php index 29bb970ef..a377f318b 100644 --- a/source/php/Module/Map/views/openStreetMap.blade.php +++ b/source/php/Module/Map/views/openStreetMap.blade.php @@ -11,6 +11,6 @@ @openStreetMap([ 'startPosition' => $startPosition, 'pins' => $pins, - 'height' => $height + 'height' => $height . 'px' ]) @endopenStreetMap \ No newline at end of file