4,7 → 4,7 |
var DEBUG = false; |
var communeImageUrl = 'http://www.tela-botanica.org/commun/icones/carto/commune.png'; |
var pointImageUrl = 'http://www.tela-botanica.org/commun/icones/carto/point2.png'; |
var groupeImageUrlTpl = 'http://localhost/service:cel:CelWidgetMap/icone-groupe?type={type}&nbre={nbre}' |
var groupeImageUrlTpl = 'http://www.tela-botanica.org/service:cel:CelWidgetMap/icone-groupe?type={type}&nbre={nbre}' |
var pointsOrigine = null; |
var boundsOrigine = null; |
var markerClusterer = null; |
72,15 → 72,18 |
|
function afficherTitreCarte() { |
if (stations != null && taxonsCarte.length > 0) { |
var obsNbre = stations.stats.observations.formaterNombre(); |
var plteNbre = taxonsCarte.length.formaterNombre(); |
var communeNbre = stations.stats.communes.formaterNombre(); |
var obsNbre = stations.stats.observations; |
var obsNbreFormate = stations.stats.observations.formaterNombre(); |
var plteNbre = taxonsCarte.length; |
var plteNbreFormate = taxonsCarte.length.formaterNombre(); |
var communeNbre = stations.stats.communes; |
var communeNbreFormate = stations.stats.communes.formaterNombre(); |
|
var titre = obsNbre+' observation'; |
var titre = obsNbreFormate+' observation'; |
titre += (obsNbre > 1) ? 's' : '' ; |
|
if (nt == '*') { |
titre += ' de '+plteNbre+' plante'; |
titre += ' de '+plteNbreFormate+' plante'; |
titre += (plteNbre > 1) ? 's' : '' ; |
} else { |
if (taxonsCarte[0]) { |
89,7 → 92,7 |
} |
} |
|
titre += ' sur '+communeNbre+' commune'; |
titre += ' sur '+communeNbreFormate+' commune'; |
titre += (communeNbre > 1) ? 's' : '' ; |
|
$('#carte-titre-infos').text(titre); |
135,11 → 138,12 |
if (urlsLimitesCommunales != null) { |
for (urlId in urlsLimitesCommunales) { |
var url = urlsLimitesCommunales[urlId]; |
ctaLayer = new google.maps.KmlLayer(url, {preserveViewport: true}); |
ctaLayer = new google.maps.KmlLayer(url, {preserveViewport: false}); |
ctaLayer.setMap(map); |
} |
} |
} |
|
var listener = null; |
var timer = null; |
function attribuerListenerCarte() { |
159,16 → 163,12 |
} |
timer = window.setTimeout(function() { |
var zoom = map.getZoom(); |
// ajout d'un facteur de correction pour charger légerement plus que nécessaire pour stabiliser les points |
// à voir si c'est efficace |
var facteurCorrection = 0.5; |
var NELatLng = (map.getBounds().getNorthEast().lat()+facteurCorrection)+'|'+(map.getBounds().getNorthEast().lng()+facteurCorrection); |
var SWLatLng = (map.getBounds().getSouthWest().lat()-facteurCorrection)+'|'+(map.getBounds().getSouthWest().lng()-facteurCorrection); |
var NELatLng = (map.getBounds().getNorthEast().lat())+'|'+(map.getBounds().getNorthEast().lng()); |
var SWLatLng = (map.getBounds().getSouthWest().lat())+'|'+(map.getBounds().getSouthWest().lng()); |
chargerMarqueurs(zoom, NELatLng, SWLatLng); |
}, 400); |
} |
|
var premierChargement = true; |
var marqueurs = new Array(); |
function chargerMarqueurs(zoom, NELatLng, SWLatLng) { |
var url = stationsUrl+ |
211,7 → 211,8 |
|
$.each(stations.points, function (index, station) { |
if(station != null) { |
marqueurs.push(creerMarqueur(station)); |
var nouveauMarqueur = creerMarqueur(station); |
marqueurs.push(nouveauMarqueur); |
} |
}); |
} |
240,6 → 241,12 |
return marqueur; |
} |
|
function rendrePointsVisibles(bounds) { |
map.setCenter(bounds.getCenter()); |
map.fitBounds(bounds); |
map.panToBounds(bounds); |
} |
|
function programmerRafraichissementCarteSauv() { |
|
var points = []; |
317,6 → 324,10 |
|
function surClickMarqueur(event) { |
|
if(infoBulleOuverte) { |
infoBulle.close(); |
} |
|
pointClique = this; |
infoBulle.open(map, this); |
actualiserPagineur(); |
467,9 → 478,7 |
surClicPagePagination(0, null); |
} |
|
if (pagineur.limite < total) { |
afficherPagination(); |
} |
actualiserPagineur(); |
} |
|