You are here

openlayers-map.html.twig in Openlayers 8.4

Theme implementation to display an Openlayers map.

This creates a placeholder for the map to be injected into.

Available variables:

  • map_id
  • height

Note: min-width is set so that a map will show when "Inline" is specified for the associated field label. This may of course be overridden. The default field label style is "Above" with a width of 100%.

File

templates/openlayers-map.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme implementation to display an Openlayers map.
  5. *
  6. * This creates a placeholder for the map to be injected into.
  7. *
  8. * Available variables:
  9. * - map_id
  10. * - height
  11. *
  12. * Note: min-width is set so that a map will show when "Inline" is specified
  13. * for the associated field label. This may of course be overridden. The default
  14. * field label style is "Above" with a width of 100%.
  15. *
  16. * @ingroup themeable
  17. *
  18. */
  19. #}
  20. <div id="{{ map_id }}" class="openlayers-map" style="min-width: 150px; {% if height is not empty %}height: {{ height }}{% endif %}"></div>