Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2907 Rev 2916
Line 19... Line 19...
19
	this.indexRueSelectionnee = 0;
19
	this.indexRueSelectionnee = 0;
20
	this.requeteRechercheRue = null;
20
	this.requeteRechercheRue = null;
21
	this.aucuneRueSelectionnee = "Aucune rue sélectionnée";
21
	this.aucuneRueSelectionnee = "Aucune rue sélectionnée";
22
	this.nomDeRueInconnue = "Nom de rue inconnu";
22
	this.nomDeRueInconnue = "Nom de rue inconnu";
23
	this.zoneGeo = null;
23
	this.zoneGeo = null;
-
 
24
	this.groupeZonesGeo = null;
-
 
25
	this.serviceCoordSearchUrl = "";
24
}	
26
}
25
WidgetSaisieSauvages.prototype = new WidgetSaisie();
27
WidgetSaisieSauvages.prototype = new WidgetSaisie();
Line 26... Line 28...
26
 
28
 
27
// surcharge
29
// surcharge
28
WidgetSaisieSauvages.prototype.initCarto = function() {
30
WidgetSaisieSauvages.prototype.initCarto = function() {
Line 155... Line 157...
155
 
157
 
156
// surcharge
158
// surcharge
157
WidgetSaisieSauvages.prototype.initialiserGoogleMap = function() {
159
WidgetSaisieSauvages.prototype.initialiserGoogleMap = function() {
158
	var lthis = this;
160
	var lthis = this;
159
	this.latLngDeb = new google.maps.LatLng(48.8543, 2.3483);// Paris par défaut
161
	this.latLngDeb = new google.maps.LatLng(48.8543, 2.3483);// Paris par défaut
-
 
162
 
-
 
163
	// si param "groupes_zones_geo"
-
 
164
	if (this.groupeZonesGeo != "") {
-
 
165
		var url = this.serviceCoordSearchUrl + "?groupe_zones=" + this.groupeZonesGeo;
-
 
166
		$.getJSON(url, function(data) {
-
 
167
			console.log(data);
-
 
168
			lthis.latLngDeb = new google.maps.LatLng(data.groupe.centroide.lat, data.groupe.centroide.lng);
-
 
169
			lthis.suiteInitialiserGoogleMap();
-
 
170
		});
160
	
171
	}
161
	// si param "zone_geo"
172
	// si param "zone_geo"
162
	if (this.zoneGeo != "") {
173
	else if (this.zoneGeo != "") {
163
		var url = "http://api.tela-botanica.org/service:cel:coordSearch?zone=" + this.zoneGeo;
174
		var url = this.serviceCoordSearchUrl + "?zone=" + this.zoneGeo;
164
		$.getJSON(url, function(data) {
175
		$.getJSON(url, function(data) {
165
			lthis.latLngDeb = new google.maps.LatLng(data.lat, data.lng);
176
			lthis.latLngDeb = new google.maps.LatLng(data.lat, data.lng);
166
			lthis.suiteInitialiserGoogleMap();
177
			lthis.suiteInitialiserGoogleMap();
167
		});
-
 
168
		
178
		});
169
	}
-
 
170
	
179
	}
171
	// si param "ville"
180
	// si param "ville"
172
	else {
181
	else {
173
		if (this.ville == 'Marseille') {
182
		if (this.ville == 'Marseille') {
174
			this.latLngDeb = new google.maps.LatLng(43.29545, 5.37458);
183
			this.latLngDeb = new google.maps.LatLng(43.29545, 5.37458);
175
		} 
184
		} 
176
		if (this.ville == 'Montpellier') {
185
		if (this.ville == 'Montpellier') {
177
			this.latLngDeb = new google.maps.LatLng(43.61077, 3.87672);
186
			this.latLngDeb = new google.maps.LatLng(43.61077, 3.87672);
178
		}
187
		}
179
		this.suiteInitialiserGoogleMap();
188
		this.suiteInitialiserGoogleMap();
180
	}
-
 
181
	
-
 
182
	
189
	}
Line 183... Line -...
183
}
-
 
184
 
190
}
185
 
191
 
186
WidgetSaisieSauvages.prototype.suiteInitialiserGoogleMap = function() {
192
WidgetSaisieSauvages.prototype.suiteInitialiserGoogleMap = function() {
187
	var options = {
193
	var options = {
188
			zoom: 14, // avant : 16
194
			zoom: 14, // avant : 16