map responsive
This commit is contained in:
@@ -51,6 +51,7 @@ class SitesMap extends BlockBase {
|
||||
$geofield = $site->get('field_geofield')->get(0);
|
||||
$lon = $geofield->lon;
|
||||
$lat = $geofield->lat;
|
||||
$geofieldData = "$lon,$lat"; // Utiliser une chaîne pour stocker la position
|
||||
|
||||
$x = round(($lon - $lonLeft) / ($lonRight - $lonLeft) * $vp_w);
|
||||
$y = round(($latTop - $lat) / ($latTop - $latBottom) * $vp_h);
|
||||
@@ -61,6 +62,7 @@ class SitesMap extends BlockBase {
|
||||
$sites_paths .= <<<SVGSITEPATH
|
||||
<g
|
||||
id="site-$index"
|
||||
data-geofield="$geofieldData"
|
||||
transform="
|
||||
translate($x,$y)">
|
||||
<circle
|
||||
|
Reference in New Issue
Block a user