Subversion Repositories eFlore/Applications.cel

Rev

Rev 1430 | Rev 1435 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1430 Rev 1434
Line 113... Line 113...
113
		  	stationNbreFormate = stations.stats.stations.formaterNombre();
113
		  	stationNbreFormate = stations.stats.stations.formaterNombre();
114
		}
114
		}
Line 115... Line 115...
115
	
115
	
116
		var titre = obsNbreFormate+' observation';
116
		var titre = obsNbreFormate+' observation';
-
 
117
		titre += (obsNbre > 1) ? 's' : '' ;
-
 
118
 
-
 
119
		if(photos_seulement == 1) {
-
 
120
			titre += ' avec photos ';
Line 117... Line 121...
117
		titre += (obsNbre > 1) ? 's' : '' ;
121
		}
118
		
122
		
Line 119... Line 123...
119
		titre += ' sur '+(stationNbre+ communeNbre)+' station';
123
		titre += ' sur '+(stationNbre+ communeNbre)+' station';
Line 203... Line 207...
203
		requeteChargementPoints.abort();
207
		requeteChargementPoints.abort();
204
	}
208
	}
205
	timer = window.setTimeout(function() {
209
	timer = window.setTimeout(function() {
206
		if(map.getBounds() != undefined) {
210
		if(map.getBounds() != undefined) {
207
			var zoom = map.getZoom();
211
			var zoom = map.getZoom();
-
 
212
			var lngNE = map.getBounds().getNorthEast().lng();
-
 
213
			var lngSW = map.getBounds().getSouthWest().lng()
208
			var NELatLng = (map.getBounds().getNorthEast().lat())+'|'+(map.getBounds().getNorthEast().lng());
214
			if(map.getBounds().getNorthEast().lng() < map.getBounds().getSouthWest().lng()) {
-
 
215
				lngNE = 176;
-
 
216
				lngSW = -156;
-
 
217
			}
-
 
218
			var NELatLng = (map.getBounds().getNorthEast().lat())+'|'+(lngNE);
209
			var SWLatLng = (map.getBounds().getSouthWest().lat())+'|'+(map.getBounds().getSouthWest().lng());
219
			var SWLatLng = (map.getBounds().getSouthWest().lat())+'|'+(lngSW);
210
			chargerMarqueurs(zoom, NELatLng, SWLatLng);
220
			chargerMarqueurs(zoom, NELatLng, SWLatLng);
211
		} else {
221
		} else {
212
			programmerRafraichissementCarte();
222
			programmerRafraichissementCarte();
213
		}
223
		}
214
    }, 400);		
224
    }, 400);		
Line 284... Line 294...
284
	} else {
294
	} else {
285
		if(station.nom) {
295
		if(station.nom) {
286
			titre = station.nom;
296
			titre = station.nom;
287
		}
297
		}
288
	}
298
	}
289
	//var titre = station['nbreMarqueur'];
-
 
-
 
299
	
290
	var icone = attribuerImageMarqueur(station['id'], station['nbreMarqueur']);
300
	var icone = attribuerImageMarqueur(station['id'], station['nbreMarqueur']);
291
	var latLng = new google.maps.LatLng(station['lat'], station['lng']);
301
	var latLng = new google.maps.LatLng(station['lat'], station['lng']);
292
	var marqueur = new google.maps.Marker({
302
	var marqueur = new google.maps.Marker({
293
		position: latLng,
303
		position: latLng,
294
		icon: icone,
304
		icon: icone,
Line 302... Line 312...
302
}
312
}
Line 303... Line 313...
303
 
313
 
304
function rendrePointsVisibles(bounds) {
314
function rendrePointsVisibles(bounds) {
305
	map.setCenter(bounds.getCenter());
315
	map.setCenter(bounds.getCenter());
306
	map.fitBounds(bounds);
-
 
307
	map.panToBounds(bounds);
316
	map.fitBounds(bounds);
Line 308... Line 317...
308
}
317
}
309
 
318
 
310
function attribuerImageMarqueur(id, nbreMarqueur) {
319
function attribuerImageMarqueur(id, nbreMarqueur) {
Line 410... Line 419...
410
 
419
 
411
function deplacerCarteSurPointClique() {
420
function deplacerCarteSurPointClique() {
412
	map.panTo(pointClique.position);
421
	map.panTo(pointClique.position);
Line 413... Line -...
413
}
-
 
414
 
-
 
415
function executerMarkerClusterer(points, bounds) {
-
 
416
	if (markerClusterer) {
-
 
417
		markerClusterer.clearMarkers();
-
 
418
	}
-
 
419
	markerClusterer = new MarkerClusterer(map, points, {gridSize: 50, maxZoom: 18});
-
 
420
	map.fitBounds(bounds);
-
 
421
}
422
}
422
 
423
 
423
/*+--------------------------------------------------------------------------------------------------------+*/
424
/*+--------------------------------------------------------------------------------------------------------+*/
424
// INFO BULLE
425
// INFO BULLE
425
var infoBulleOuverte = false;
426
var infoBulleOuverte = false;
Line 552... Line 553...
552
}
553
}
Line 553... Line 554...
553
 
554
 
554
function actualiserPagineur() {
555
function actualiserPagineur() {
555
	pagineur.stationId = pointClique.stationInfos.id;
556
	pagineur.stationId = pointClique.stationInfos.id;
556
	pagineur.total = pointClique.stationInfos.obsNbre;
557
	pagineur.total = pointClique.stationInfos.obsNbre;
557
	if (pagineur.total > 4) {
558
	if (pagineur.total > 4 && photos_seulement != 1) {
558
		pagineur.format = 'tableau';
559
		pagineur.format = 'tableau';
559
	} else {
560
	} else {
560
		pagineur.format = 'liste';
561
		pagineur.format = 'liste';
561
	}
562
	}