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