Commit 79845d01 authored by Luis Aveiga's avatar Luis Aveiga Committed by Italo Mairo
Browse files

Issue #3154282 by BetoAveiga: Add title to map embed iframe

parent 6642265c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ function geofield_map_extras_theme($existing, $type, $theme, $path) {
        'q' => NULL,
        'apikey' => NULL,
        'options_string' => NULL,
        'title' => NULL,
      ],
    ],
  ];
+2 −0
Original line number Diff line number Diff line
@@ -208,6 +208,7 @@ class GeofieldGoogleEmbedMapFormatter extends FormatterBase implements Container
  public function viewElements(FieldItemListInterface $items, $langcode) {
    $elements = [];
    $settings = $this->getSettings();
    $bundle = $items->getParent()->getEntity()->bundle();

    foreach ($items as $delta => $item) {
      if ($item->isEmpty()) {
@@ -234,6 +235,7 @@ class GeofieldGoogleEmbedMapFormatter extends FormatterBase implements Container
        '#apikey' => (string) $this->getGmapApiKey(),
        '#q' => $q,
        '#options_string' => $options_string,
        '#title' => $this->t('Map of @bundle', ['@bundle' => $bundle]),
      ];
    }

+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
    width={{ width }}
    height={{ height }}
    frameborder="0" style="border:0"
    title="{{ title }}"
    src="https://www.google.com/maps/embed/v1/place?key={{ apikey }}&q={{ q }}{{ options_string }}" allowfullscreen>
  </iframe>
</div>