Browse Source

quelques typages sur les variables qu'on reçoit depuis l'appel du filtre

histoire d'être sûr de ce qu'on va passer à la classe staticMapGis
pull/34/head
b_b 7 months ago
parent
commit
1765f14aeb
  1. 6
      gis_fonctions.php

6
gis_fonctions.php

@ -558,12 +558,12 @@ function gis_static_map($id_gis = null, $width, $height, $maptype = false, $zoom
$lon = $gis['lon'] ?? $lon;
if (intval($id_gis) and !$markers) {
$markers_[] = ['lat' => $lat, 'lon' => $lon];
$markers_[] = ['lat' => (float) $lat, 'lon' => (float) $lon];
} else {
$markers = explode('|', $markers);
foreach ($markers as $marker) {
list($markerLat, $markerLon, $markerUrl) = explode(';', $marker);
$markers_[] = ['lat' => $markerLat, 'lon' => $markerLon, 'url' => $markerUrl];
$markers_[] = ['lat' => (float) $markerLat, 'lon' => (float) $markerLon, 'url' => $markerUrl];
}
}
@ -575,7 +575,7 @@ function gis_static_map($id_gis = null, $width, $height, $maptype = false, $zoom
}
include_spip('inc/staticmap');
$map = new staticMapGis($lat, $lon, $zoom, $width, $height, $maptype, $markers_);
$map = new staticMapGis((float) $lat, (float) $lon, (int) $zoom, $width, $height, $maptype, $markers_);
$balise_img = charger_filtre('balise_img');
return $balise_img($map->showMap());
}

Loading…
Cancel
Save