Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1003 → Rev 1004

/trunk/jrest/lib/CartoGroupage.php
34,16 → 34,14
* = centre de la fenetre
*/
public static function creerGroupesQuadtree(&$markers, $neLat, $neLng, $swLat, $swLng, $zoom = 3) {
 
if(count($markers) > self::$seuilClusterisation) {
 
if (count($markers) > self::$seuilClusterisation) {
self::calculerProfondeurMax($zoom);
self::calculerPasCorrectionCentre($zoom);
 
$noeudRacine = array('nbrePoints' => count($markers), 'points' => $markers);
self::attribuerAuCadran($noeudRacine, $neLat, $neLng, $swLat, $swLng);
} else {
 
} else {
foreach($markers as $marker) {
$points = array($marker);
$noeudSimple = array('points' => $points, 'nbrePoints' => 1);
142,9 → 140,13
}
 
private static function ajouterFils(&$noeud, $cadran, &$point) {
$fils = array('points' => array(), 'nbrePoints' => 1, 'latMoyenne' => 0, 'lngMoyenne' => 0);
$fils = array('points' => array(), 'nbrePoints' => 0, 'latMoyenne' => 0, 'lngMoyenne' => 0);
if (isset($noeud[$cadran])) {
$fils = $noeud[$cadran];
}
 
$fils['points'][] = $point;
$fils['nbrePoints'] = isset($noeud[$cadran]['nbrePoints']) ? $noeud[$cadran]['nbrePoints']++ : 1;
$fils['nbrePoints']++;
$fils['latMoyenne'] += $point['lat'];
$fils['lngMoyenne'] += $point['lng'];
$noeud[$cadran] = $fils;
/trunk/jrest/services/CelWidgetMap.php
236,7 → 236,7
if (is_numeric($commune['lat']) && is_numeric($commune['lng'])) {
extract($commune);
$id = self::MARQUEUR_COMMUNE.':'.$lat.'|'.$lng;
$this->definirLatLngMaxMin($marqueurs, $lat, $lng);
//$this->definirLatLngMaxMin($marqueurs, $lat, $lng);
$lata = round($lat, 5);
$lnga = round($lng, 5);
 
258,7 → 258,7
if (is_numeric($station['lat']) && is_numeric($station['lng'])) {
extract($station);
$id = self::MARQUEUR_STATION.':'.$lat.'|'.$lng;
$this->definirLatLngMaxMin($marqueurs, $lat, $lng);
//$this->definirLatLngMaxMin($marqueurs, $lat, $lng);
$lata = round($lat, 5);
$lnga = round($lng, 5);
$nom = $this->etreNull($nom) ? $lata.','.$lnga : $nom;
284,8 → 284,8
} else {
$marqueurs['points'] = $points;
}
$marqueurs['stats']['latDiff'] = abs($marqueurs['stats']['latMin'] - $marqueurs['stats']['latMax']);
$marqueurs['stats']['lngDiff'] = abs($marqueurs['stats']['lngMin'] - $marqueurs['stats']['lngMax']);
//$marqueurs['stats']['latDiff'] = abs($marqueurs['stats']['latMin'] - $marqueurs['stats']['latMax']);
//$marqueurs['stats']['lngDiff'] = abs($marqueurs['stats']['lngMin'] - $marqueurs['stats']['lngMax']);
 
return $marqueurs;
}