New Leaflet 10.0.x is out, with full support to Drupal 10 (and 9) and a lot of cool enhancements and refinements.

Created on 23 November 2022, almost 2 years ago
Updated 20 December 2023, 11 months ago

Just to announce that Leaflet 10.0.0 new brand release have been deployed, with full support for Drupal 10 and backward compatibility for Leaflet module 2.2.x.
All Drupal 9 and 10 users are strongly invited to move/update into it.

Leaflet 10.0.x module provides more solid (and extendable/customisable) code foundation and new enhanced functionalities and Leaflet Plugin integrations, such the following:

10.0.0 release implemented functionalities:

  • implementation of Leaflet Views Grouping, reflecting into Leaflet Control Overlays, with:
    • options to initially disable specific Groups and/or not include them in the Leaflet Overlays Control;
    • Markerclustering support;
    • specific/additional hook_leaflet_views_features_group_alter to alter Leaflet View Group definitions;
  • featured implementation to dynamically exclude specific Leaflet Features from being Markercluster-ed (“Markercluster excluded” element/flag);
  • full Implementation / support of Leaflet Tooltips (https://leafletjs.com/reference.html#tooltip), with custom Json options, tokens & replacements patterns;
  • extended support for Leaflet Popups (https://leafletjs.com/reference.html#popup), with custom Json options, tokens & replacements patterns;
  • full Implementation / support of User Location Control via Leaflet.Locate plugin (https://github.com/domoritz/leaflet-locatecontrol), with custom Json options, tokens & replacements patterns;
  • full implementation / support for Reset Map View Control via Leaflet.ResetView plugin (https://github.com/drustack/Leaflet.ResetView), with custom Json options, tokens & replacements patterns;
  • implementation of Leaflet Feature Additional Properties (with custom Json options, tokens & replacements patterns) for advanced and dynamic customisation of Leaflet Map and Features rendering logics;

Code Refactoring & clean up:

  • cleanup / removal of deprecated and un-usable Leaflet Views plugins.
  • extended refactoring of Leaflet module js code, to allow easier extension/customisation of Drupal.leaflet.prototype and Drupal.leaflet_widget.prototype methods, with extended objects, functions and methods documentation;
  • embedding all Leaflet Js libraries dependencies into the the module, for better Ajax and advanced Fields Widgets compatibilities (Inline Entity Form, Paragraphs Widgets supports, etc.)
  • general Drupal/PHP & JS better refactoring, complying with correct Coding Standards;

Screenshot attached with Enhanced and Refined UX features ...

📌 Task
Status

Needs review

Version

10.0

Component

Documentation

Created by

🇮🇹Italy itamair

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy Niubbo75

    Hi, I have update to Leaflet 10.0 via composer, after update I got error and my map doesn't work, here qhat I got:

    ArgumentCountError: Too few arguments to function Drupal\leaflet\LeafletService::__construct(), 6 passed in /***/***/****/********/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 7 expected in Drupal\leaflet\LeafletService->__construct() (line 189 of /***/***/****/********/web/modules/contrib/leaflet/src/LeafletService.php)
    #0 /***/***/****/********/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\leaflet\LeafletService->__construct()
    #1 /***/***/****/********/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #2 /***/***/****/********/web/modules/contrib/leaflet/src/Plugin/Field/FieldFormatter/LeafletDefaultFormatter.php(154): Drupal\Component\DependencyInjection\Container->get()
    #3 /***/***/****/********/web/core/lib/Drupal/Core/Field/FormatterPluginManager.php(64): Drupal\leaflet\Plugin\Field\FieldFormatter\LeafletDefaultFormatter::create()
    #4 /***/***/****/********/web/core/lib/Drupal/Core/Field/FormatterPluginManager.php(126): Drupal\Core\Field\FormatterPluginManager->createInstance()
    #5 /***/***/****/********/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(207): Drupal\Core\Field\FormatterPluginManager->getInstance()
    #6 /***/***/****/********/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(238): Drupal\Core\Entity\Entity\EntityViewDisplay->getRenderer()
    #7 /***/***/****/********/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php(266): Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple()
    #8 /***/***/****/********/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(340): Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple()
    #9 /***/***/****/********/web/core/modules/node/src/NodeViewBuilder.php(24): Drupal\Core\Entity\EntityViewBuilder->buildComponents()
    #10 /***/***/****/********/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(282): Drupal\node\NodeViewBuilder->buildComponents()
    #11 /***/***/****/********/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(239): Drupal\Core\Entity\EntityViewBuilder->buildMultiple()
    #12 [internal function]: Drupal\Core\Entity\EntityViewBuilder->build()
    #13 /***/***/****/********/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
    #14 /***/***/****/********/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback()
    #15 /***/***/****/********/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback()
    #16 /***/***/****/********/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
    #17 /***/***/****/********/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(242): Drupal\Core\Render\Renderer->render()
    #18 /***/***/****/********/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
    #19 /***/***/****/********/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(243): Drupal\Core\Render\Renderer->executeInRenderContext()
    #20 /***/***/****/********/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
    #21 /***/***/****/********/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
    #22 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
    #23 /***/***/****/********/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
    #24 /***/***/****/********/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
    #25 /***/***/****/********/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #26 /***/***/****/********/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
    #27 /***/***/****/********/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #28 /***/***/****/********/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #29 /***/***/****/********/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
    #30 /***/***/****/********/web/modules/contrib/services/src/StackMiddleware/FormatSetter.php(44): Drupal\page_cache\StackMiddleware\PageCache->handle()
    #31 /***/***/****/********/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\services\StackMiddleware\FormatSetter->handle()
    #32 /***/***/****/********/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #33 /***/***/****/********/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #34 /***/***/****/********/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
    #35 /***/***/****/********/web/index.php(19): Drupal\Core\DrupalKernel->handle()
    #36 {main}

    if I rollback to 2.2.12 all works as expected, any hint?
    Thanks in advance,
    Alessandro

  • 🇮🇹Italy itamair

    It looks you didn’t clear/refresh the Drupal cache after the update … (drupal basics)

  • 🇮🇹Italy Niubbo75

    You are right! Thanks for your support.
    Alessandro

  • 🇩🇰Denmark ressa Copenhagen

    Thanks @itamair, it is a joy to use Leaflet 10.x. It works very well, and is highly customizable.

    With your help I managed to define setMaxBounds with Leaflet API ( 💬 Document how to set values such as setMaxBounds with Leaflet API Fixed ) and documented it in Leaflet > Leaflet API , in the new docs system.

    But many more of the great features could get documented, so I created a child issue for this.

  • 🇩🇰Denmark ressa Copenhagen

    @itamair: To give the new Drupal 10 documentation more exposure and get more features documented, perhaps at some point you have time to add a link to it on the project page, as described in the item of tasks in 📌 Document Leaflet 10.x features Active ?

  • 🇮🇹Italy itamair

    @ressa I accomplished your suggestion, and now you will find a couple of "Drupal Community documentation (WIP)" links in the Drupal.org project page, so as it also included in the Readme.md file, with this lates commit: https://git.drupalcode.org/project/leaflet/-/commit/3996852181abcd89c0fe...

  • 🇩🇰Denmark ressa Copenhagen

    Thanks @itamair, and great idea to include a link in the README, to tie it all together.

Production build 0.71.5 2024