Skip to content

Instantly share code, notes, and snippets.

@goruha
Created January 21, 2017 14:14
Show Gist options
  • Save goruha/537b0ca91a8c504187c5ef9c4836877a to your computer and use it in GitHub Desktop.
Save goruha/537b0ca91a8c504187c5ef9c4836877a to your computer and use it in GitHub Desktop.
diff --git i/modules/geofield_map/includes/geofield_map_plugin_style_map.inc w/modules/geofield_map/includes/geofield_map_plugin_style_map.inc
index 054eda1..6e4faa0 100755
--- i/modules/geofield_map/includes/geofield_map_plugin_style_map.inc
+++ w/modules/geofield_map/includes/geofield_map_plugin_style_map.inc
@@ -167,14 +167,18 @@ class geofield_map_plugin_style_map extends views_plugin_style {
// defaults
$width = '100%';
- $height = '300px';
+ $padding = '';
+
if ($style_options['geofield_map_width']) {
$width = $style_options['geofield_map_width'];
}
if ($style_options['geofield_map_height']) {
$height = $style_options['geofield_map_height'];
+ } else {
+ $height = '0px';
+ $padding = "padding-bottom: $width;";
}
- return '<div style="width: ' . $width . '; height: ' . $height . '" id="' . $container_id . '" class="geofieldMap">' . $style_options['alt_text'] . '</div>';
+ return '<div style="width: ' . $width . ';' . $padding .' height: ' . $height . '" id="' . $container_id . '" class="geofieldMap">' . $style_options['alt_text'] . '</div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment