Subversion Repositories eFlore/Applications.moissonnage

Compare Revisions

No changes between revisions

Ignore whitespace Rev 42 → Rev 43

/trunk/services/modules/0.1/sources/FloradataFormateur.php
75,7 → 75,8
$requete =
"SELECT nom_sel AS taxon, ce_zone_geo, zone_geo, station, 'floradata' AS source, ".
"IF({$condition}, wgs84_latitude, latitude) AS latitude, IF({$condition}, wgs84_longitude, longitude) ".
"AS longitude, IF({$condition}, 'COMMUNE', 'STATION') AS type_site ".
"AS longitude, IF({$condition}, 'commune', 'station') AS type_site, ".
"CONCAT(prenom_utilisateur, ' ', nom_utilisateur) AS auteur ".
"FROM cel_obs LEFT JOIN cel_zones_geo cz ON ce_zone_geo=id_zone_geo ".
"WHERE transmission=1 ".
$this->construireWhereCoordonneesBbox().' '.
/trunk/services/modules/0.1/sources/MoissonnageFormateur.php
65,8 → 65,9
final protected function construireRequeteWfs() {
$requete =
"SELECT nom_scientifique_complet AS taxon, lieu_station_nom AS nom, lieu_station_latitude AS latitude, ".
"lieu_station_longitude AS longitude, 'STATION' AS type_site, lieu_commune_code_insee AS code_insee, ".
"'{$this->nomSource}' AS source FROM {$this->nomSource}_tapir WHERE 1 ".
"lieu_station_longitude AS longitude, 'station' AS type_site, lieu_commune_code_insee AS code_insee, ".
"'{$this->nomSource}' AS source, observateur_nom_complet AS auteur ".
"FROM {$this->nomSource}_tapir WHERE 1 ".
$this->construireWhereCoordonneesBbox().' '.
$this->construireWhereNomScientifique().' '.
"ORDER BY lieu_station_longitude, lieu_station_latitude";
/trunk/services/bibliotheque/squelettes/GetFeature.tpl.xml
24,6 → 24,7
<ms:codeInsee><?=$station['code_insee']?></ms:codeInsee>
<ms:departement><?=$station['departement']?></ms:departement>
<ms:taxons><?=$station['taxons']?></ms:taxons>
<ms:auteurs><?=$station['auteurs']?></ms:auteurs>
</ms:<?=$station['source']?>>
</gml:featureMember>
<?php } ?>
/trunk/services/bibliotheque/squelettes/DescribeFeatureType.tpl.xml
20,6 → 20,7
<element name="codeInsee" type="string" />
<element name="departement" type="string" />
<element name="taxons" type="string" />
<element name="auteurs" type="string" />
</sequence>
</extension>
</complexContent>
/trunk/services/bibliotheque/FormateurWfs.php
45,14 → 45,16
}
foreach ($stationBdd as $cle => $valeur) {
if ($cle != 'taxon') {
if ($cle != 'taxon' && $cle != 'auteur') {
$station[$cle] = $valeur;
}
}
$station['taxons'] = array(trim($stationBdd['taxon']));
$station['auteurs'] = array(trim($stationBdd['auteur']));
$this->mettreAJourBbox($station);
} else {
$station['taxons'][] = trim($stationBdd['taxon']);
$station['auteurs'][] = trim($stationBdd['auteur']);
}
}
return $stationsRetour;
93,7 → 95,8
unset($station['station']);
unset($station['zone_geo']);
unset($station['ce_zone_geo']);
$station['taxons'] = str_replace("&", "&amp;", implode(',', $station['taxons']));
$station['taxons'] = str_replace("&", "&amp;", implode(', ', $station['taxons']));
$station['auteurs'] = str_replace("&", "&amp;", implode(', ', array_unique($station['auteurs'])));
}
private function mettreEnPageStationMoissonnage(& $station) {
106,7 → 109,8
}
}
unset($station['nom']);
$station['taxons'] = str_replace("&", "&amp;", implode(',', $station['taxons']));
$station['taxons'] = str_replace("&", "&amp;", implode(', ', $station['taxons']));
$station['auteurs'] = str_replace("&", "&amp;", implode(', ', array_unique($station['auteurs'])));
}
public function formaterException(Exception $erreur) {
/trunk/services
Property changes:
Added: svn:ignore
+.htaccess
/trunk/widget/modules/carto/squelettes/scripts/carto.js
700,16 → 700,20
// Gestion des points
 
function ajouterPoint(feature) {
var iconePoint = new L.Icon({ iconUrl : pointImageUrl, iconSize : [16, 16] }),
iconeCommune = new L.Icon({ iconUrl : communeImageUrl, iconSize : [24, 32] }),
icone = (feature.properties.typeSite == 'STATION') ? iconePoint : iconeCommune,
point = new L.LatLng(feature.geometry.coordinates[0], feature.geometry.coordinates[1]);
var marker = new L.Cluster(point, {
var point = new L.LatLng(feature.geometry.coordinates[0], feature.geometry.coordinates[1]);
feature.properties.typeSite = feature.properties.typeSite.toLowerCase();
coucheSites.ajouterPoint(point, feature.properties);
}
 
function creerMarqueur(point, properties) {
var iconePoint = new L.Icon({ iconUrl : pointImageUrl, iconSize : [16, 16] });
var iconeCommune = new L.Icon({ iconUrl : communeImageUrl, iconSize : [24, 32] });
var icone = (properties.typeSite == 'station') ? iconePoint : iconeCommune;
var marker = new L.Cluster(point, properties, {
icon : icone,
titre : feature.properties.nom
titre : properties.nom
});
marker.typeSite = feature.properties.typeSite.toLowerCase();
marker.source = feature.properties.source;
console.log(marker);
marker.on('click', surClicMarqueur);
marker.on('mouseover', function() {
afficherTooltip(marker.options.titre, map.latLngToContainerPoint(marker.getLatLng()));
717,7 → 721,7
marker.on('mouseout', function() {
$("#tooltip").css('display', 'none');
});
coucheSites.ajouterPoint(marker);
return marker;
}
 
function construireContenuHtmlLegendePoints() {
743,7 → 747,7
 
 
function surClicMarqueur(event) {
var nombreMarkers = event.target.recupererMarkers().length;
var nombreMarkers = event.target.obtenirNombrePoints();
if (nombreMarkers == 1 || map.getZoom() == map.getMaxZoom()) {
recupererObservations(event.target);
} else {
772,7 → 776,7
}
 
function recupererSourcesCluster(cluster) {
var markers = cluster.recupererMarkers();
var markers = cluster.recupererPoints();
var sourcesCluster = [];
for (var index = 0; index < markers.length; index ++) {
if (sourcesCluster.indexOf(markers[index].source) == -1) {
/trunk/widget/modules/carto/squelettes/scripts/cluster.js
2,28 → 2,29
 
L.Cluster = L.Marker.extend({
initialize: function(marker, options) {
initialize: function(marker, proprietes, options) {
L.Marker.prototype.initialize.call(this, marker, options);
this._markers = [this];
this._proprietes = [proprietes];
},
ajouterMarker: function(marker) {
this._markers.push(marker);
ajouterPoint: function(proprietes) {
this._proprietes.push(proprietes);
this.setIcon(new L.Icon({ iconUrl : clusterImageUrl, iconSize : [20, 20] }));
},
recupererMarkers: function() {
return this._markers;
recupererPoints: function() {
return this._proprietes;
},
obtenirNombreMarkers: function() {
return this._markers.length;
obtenirNombrePoints: function() {
return this._proprietes.length;
},
supprimerSource: function(sourceSupression) {
var index = 0;
while (index < this._markers.length) {
if (this._markers[index].source == sourceSupression) {
this._markers.splice(index, 1);
if (this._proprietes[index].source == sourceSupression) {
this._proprietes.splice(index, 1);
} else {
index ++;
}
30,7 → 31,7
}
if (this._markers.length == 0) {
if (this._map != null) {
this._map.getPanes().markerPane.removeChild(this._icon);
this._map.removeLayer(this);
}
delete this;
}
37,11 → 38,11
},
supprimer: function() {
while (this._markers.length > 0) {
this._markers.splice(0, 1);
while (this._proprietes.length > 0) {
this._proprietes.splice(0, 1);
}
if (this._map != null) {
this._map.getPanes().markerPane.removeChild(this._icon);
this._map.removeLayer(this);
}
delete this;
}
59,37 → 60,36
this._nombreClusters = 0;
},
 
ajouterPoint: function(layer) {
ajouterPoint: function(point, proprietes) {
if (this._resolution == 0) {
this._resolution = (2 * Math.PI * 6378137) / (256 * Math.pow(2, this._map.getZoom()));
}
var seuilCluster = this._distance * this._resolution;
if (typeof(layer._latlng) != 'undefined') {
var indexClusterPlusProche = this._chercherVoisinPlusProche(layer);
var ajoute = false;
if (indexClusterPlusProche != null) {
var distance = this._layers[indexClusterPlusProche].getLatLng().distanceTo(layer.getLatLng());
if (distance < seuilCluster) {
this._layers[indexClusterPlusProche].ajouterMarker(layer);
ajoute = true;
}
var indexClusterPlusProche = this._chercherVoisinPlusProche(point);
var ajoute = false;
if (indexClusterPlusProche != null) {
var distance = this._layers[indexClusterPlusProche].getLatLng().distanceTo(point);
if (distance < seuilCluster) {
this._layers[indexClusterPlusProche].ajouterPoint(point, proprietes);
ajoute = true;
}
if (!ajoute) {
this._layers[this._nombreClusters] = layer;
this._nombreClusters ++;
}
}
if (!ajoute) {
var cluster = creerMarqueur(point, proprietes);
this._layers[this._nombreClusters] = cluster;
this._nombreClusters ++;
}
},
_chercherVoisinPlusProche: function(layer) {
_chercherVoisinPlusProche: function(point) {
var distance = -1;
var plusProche = null;
for (var numeroLayer in this._layers) {
if (typeof(this._layers[numeroLayer]) != 'undefined') {
var centre = this._layers[numeroLayer].getLatLng();
if (distance == -1 || centre.distanceTo(layer.getLatLng()) < distance) {
var pointCluster = this._layers[numeroLayer].getLatLng();
if (distance == -1 || pointCluster.distanceTo(point) < distance) {
plusProche = numeroLayer;
distance = centre.distanceTo(layer.getLatLng());
distance = pointCluster.distanceTo(point);
}
}
}
100,7 → 100,7
for (var numeroLayer in this._layers) {
if (typeof(this._layers[numeroLayer]) != 'undefined') {
var layer = this._layers[numeroLayer];
if (layer.obtenirNombreMarkers() > 1) {
if (layer.obtenirNombrePoints() > 1) {
layer.setIcon(new L.Icon({ iconUrl : clusterImageUrl, iconSize : [20, 20] }))
}
layer.addTo(map);
109,7 → 109,7
},
supprimerPoint: function(layer) {
layer.supprimer();
this.removeLayer(layer);
}
});
/trunk/.
Property changes:
Modified: svn:ignore
.project
+
+france_02.svg