Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1036 Rev 1037
Line 157... Line 157...
157
	if(requeteChargementPoints != null) {
157
	if(requeteChargementPoints != null) {
158
		requeteChargementPoints.abort();
158
		requeteChargementPoints.abort();
159
	}
159
	}
160
	timer = window.setTimeout(function() {
160
	timer = window.setTimeout(function() {
161
		var zoom = map.getZoom();
161
		var zoom = map.getZoom();
-
 
162
		// ajout d'un facteur de correction pour charger légerement plus que nécessaire pour stabiliser les points
-
 
163
		// à voir si c'est efficace
-
 
164
		var facteurCorrection = 0.5;
162
		var NELatLng = map.getBounds().getNorthEast().lat()+'|'+map.getBounds().getNorthEast().lng();
165
		var NELatLng = (map.getBounds().getNorthEast().lat()+facteurCorrection)+'|'+(map.getBounds().getNorthEast().lng()+facteurCorrection);
163
		var SWLatLng = map.getBounds().getSouthWest().lat()+'|'+map.getBounds().getSouthWest().lng();
166
		var SWLatLng = (map.getBounds().getSouthWest().lat()-facteurCorrection)+'|'+(map.getBounds().getSouthWest().lng()-facteurCorrection);
164
		chargerMarqueurs(zoom, NELatLng, SWLatLng);
167
		chargerMarqueurs(zoom, NELatLng, SWLatLng);
165
    }, 400);		
168
    }, 400);		
166
}
169
}
Line 167... Line 170...
167
 
170
 
Line 177... Line 180...
177
		return;
180
		return;
178
	}
181
	}
Line 179... Line 182...
179
	
182
	
180
	if(requeteChargementPoints != null) {
183
	if(requeteChargementPoints != null) {
-
 
184
		requeteChargementPoints.abort();
181
		requeteChargementPoints.abort();
185
		cacherMessageChargementPoints();
Line 182... Line 186...
182
	}
186
	}
183
	
187
	
184
	afficherMessageChargementPoints();
188
	afficherMessageChargementPoints();
Line 211... Line 215...
211
		}
215
		}
212
	});
216
	});
213
}
217
}
Line 214... Line 218...
214
 
218
 
-
 
219
function creerMarqueur(station) {
-
 
220
	var titre = '';
-
 
221
	if(station.nbreMarqueur) {
-
 
222
		titre = station.nbreMarqueur+' points renseignés';
-
 
223
	} else {
-
 
224
		if(station.nom) {
-
 
225
			titre = station.nom;
-
 
226
		}
215
function creerMarqueur(station) {
227
	}
216
	var titre = station['nbreMarqueur'];
228
	//var titre = station['nbreMarqueur'];
217
	var icone = attribuerImageMarqueur(station['id'], station['nbreMarqueur']);
229
	var icone = attribuerImageMarqueur(station['id'], station['nbreMarqueur']);
218
	var latLng = new google.maps.LatLng(station['lat'], station['lng']);
230
	var latLng = new google.maps.LatLng(station['lat'], station['lng']);
219
	var marqueur = new google.maps.Marker({
231
	var marqueur = new google.maps.Marker({
220
		position: latLng,
232
		position: latLng,
Line 848... Line 860...
848
};
860
};
Line 849... Line 861...
849
 
861
 
850
function filtrerParTaxon() {
862
function filtrerParTaxon() {
851
	var ntAFiltrer = $('.nt', this).text();
863
	var ntAFiltrer = $('.nt', this).text();
-
 
864
	infoBulle.close();
-
 
865
	var zoom = map.getZoom();
-
 
866
	var NELatLng = map.getBounds().getNorthEast().lat()+'|'+map.getBounds().getNorthEast().lng();
-
 
867
	var SWLatLng = map.getBounds().getSouthWest().lat()+'|'+map.getBounds().getSouthWest().lng();
852
	infoBulle.close();
868
	
853
	$('#taxon-'+nt).removeClass('taxon-actif');
869
	$('#taxon-'+nt).removeClass('taxon-actif');
854
	if (nt == ntAFiltrer) {
870
	if (nt == ntAFiltrer) {
-
 
871
		nt = '*';
855
		nt = '*';
872
		stationsUrl = stationsUrl.replace(/num_taxon=[*0-9]+/, 'num_taxon='+nt);
856
		//executerMarkerClusterer(pointsOrigine, boundsOrigine);
873
		chargerMarqueurs(zoom, NELatLng, SWLatLng);
857
	} else {
874
	} else {
858
		stationsUrl = stationsUrl.replace(/num_taxon=[*0-9]+/, 'num_taxon='+ntAFiltrer);
875
		stationsUrl = stationsUrl.replace(/num_taxon=[*0-9]+/, 'num_taxon='+ntAFiltrer);
859
		url = stationsUrl;
-
 
860
		var zoom = map.getZoom();
-
 
861
		var NELatLng = map.getBounds().getNorthEast().lat()+'|'+map.getBounds().getNorthEast().lng();
-
 
862
		var SWLatLng = map.getBounds().getSouthWest().lat()+'|'+map.getBounds().getSouthWest().lng();
876
		url = stationsUrl;
863
		url += '&zoom='+zoom+
877
		url += '&zoom='+zoom+
864
			'&ne='+NELatLng+
878
			'&ne='+NELatLng+
865
			'&sw='+SWLatLng;
879
			'&sw='+SWLatLng;
866
		requeteChargementPoints = $.getJSON(url, function (stationsFiltrees) {
880
		requeteChargementPoints = $.getJSON(url, function (stationsFiltrees) {