Problem/Motivation

Markers "alt" attribute are set to an empty string because marker.title is not set on leaflet.drupal.js.

The following code should set the title, but marker.title is "undefined" and there is no option to set this value from the frontend.

  Drupal.Leaflet.prototype.create_point = function(marker) {
    let latLng = new L.LatLng(marker.lat, marker.lon);
    let lMarker;
    let marker_title = marker.title ? marker.title.replace(/<[^>]*>/g, '').trim() : '';
    let options = {
      title: marker_title,
      className: marker.className || '',
      alt: marker_title,
    };

Comments

FiNeX created an issue. See original summary.

  • itamair committed 0520ef8d on 10.2.x
    Issue #3417154: marker.title is not set on leaflet.drupal.js
    

  • itamair committed f562704e on 10.2.x
    Issue #3417154 by FiNeX, itamair: marker.title is not set on leaflet....
itamair’s picture

Status: Active » Fixed

Thanks @FiNeX
very nice catch.
The Marker title was left away from the new Leaflet Tooltip implementation in Version 10.x.

The new 10.2.11 release properly fix this and re-enable the Marker Title both in case of simple title and of Leaflet Tooltip.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.