php et js point carte cliquable

This commit is contained in:
2024-11-07 21:43:28 +01:00
parent 7f5db774d6
commit ea811fccb5
2 changed files with 15 additions and 2 deletions

View File

@@ -42,7 +42,8 @@ class SitesMap extends BlockBase {
$title = $site->get('title')->getString();
$subtitle = $site->get('field_sous_titre')->getString();
$link_options = ['absolute' => FALSE, 'attributes' => ['class' => 'site-link']];
$link_options = ['absolute' => TRUE, 'attributes' => ['class' => 'site-link']]; // Passer 'absolute' à TRUE
$site_url = $site->toUrl('canonical', $link_options)->toString(); // URL absolue pour le data-url
$site_link_object = Link::createFromRoute("voir le site", 'entity.node.canonical', ['node' => $site->id()], $link_options);
$link = $site_link_object->toString()->getGeneratedLink();
@@ -70,7 +71,8 @@ class SitesMap extends BlockBase {
<circle
class="site-link"
data-content="$datacontent"
data-content="$datacontent"
data-url="$site_url"
cx="0" cy="0" r="$r"
style="fill-opacity:1;fill-rule:nonzero;" />
<path