diff --git a/js/geolocation-formatter-googlemap.js b/js/geolocation-formatter-googlemap.js index cef463d..1841dbc 100644 --- a/js/geolocation-formatter-googlemap.js +++ b/js/geolocation-formatter-googlemap.js @@ -103,7 +103,7 @@ infoWindowContent: location.html(), infoWindowSolitary: true, }; - + if (typeof location.data('icon') !== 'undefined') { markerConfig.icon = location.data('icon'); } diff --git a/settings-to-set-path-marker-icon.patch b/settings-to-set-path-marker-icon.patch deleted file mode 100644 index e69de29..0000000 diff --git a/src/Plugin/Field/FieldFormatter/GeolocationGoogleMapFormatter.php b/src/Plugin/Field/FieldFormatter/GeolocationGoogleMapFormatter.php index 65c8c85..69852cf 100644 --- a/src/Plugin/Field/FieldFormatter/GeolocationGoogleMapFormatter.php +++ b/src/Plugin/Field/FieldFormatter/GeolocationGoogleMapFormatter.php @@ -71,7 +71,6 @@ class GeolocationGoogleMapFormatter extends FormatterBase { '#default_value' => $settings['set_marker'], ]; - $cardinality = $this->fieldDefinition->getFieldStorageDefinition()->getCardinality(); if ( $cardinality == FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED @@ -221,8 +220,8 @@ class GeolocationGoogleMapFormatter extends FormatterBase { $title = $item->lat . ', ' . $item->lng; } $content = \Drupal::token()->replace($settings['info_text'], $token_context, ['callback' => [$this, 'geolocationItemTokens']]); - if (empty($title)) { - $title = $item->lat . ', ' . $item->lng; + if (empty($content)) { + $content = $this->t('Latitude: %latitude, Longitude: %longitude', ['%latitude' => $item->lat, '%longitude' => $item->lng]); } $location = [ @@ -265,4 +264,4 @@ class GeolocationGoogleMapFormatter extends FormatterBase { return $elements; } -} \ No newline at end of file +} diff --git a/src/Plugin/views/style/CommonMap.php b/src/Plugin/views/style/CommonMap.php index c15ead9..4ebe984 100644 --- a/src/Plugin/views/style/CommonMap.php +++ b/src/Plugin/views/style/CommonMap.php @@ -100,10 +100,7 @@ class CommonMap extends StylePluginBase { $title_field = $this->options['title_field']; } - - if ( - !empty($this->options['global_icon_path']) - ) { + if (!empty($this->options['global_icon_path'])) { $global_icon_path = $this->options['global_icon_path']; }