Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2892 Rev 2905
Line 18... Line 18...
18
	this.listeRues = {};
18
	this.listeRues = {};
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
}	
24
}	
24
WidgetSaisieSauvages.prototype = new WidgetSaisie();
25
WidgetSaisieSauvages.prototype = new WidgetSaisie();
Line 25... Line 26...
25
 
26
 
26
// surcharge
27
// surcharge
Line 153... Line 154...
153
};
154
};
Line 154... Line 155...
154
 
155
 
155
// surcharge
156
// surcharge
156
WidgetSaisieSauvages.prototype.initialiserGoogleMap = function() {
157
WidgetSaisieSauvages.prototype.initialiserGoogleMap = function() {
157
	var lthis = this;
158
	var lthis = this;
-
 
159
	this.latLngDeb = new google.maps.LatLng(48.8543, 2.3483);// Paris par défaut
-
 
160
	
-
 
161
	// si param "zone_geo"
-
 
162
	if (this.zoneGeo != "") {
-
 
163
		var url = "http://api.tela-botanica.org/service:cel:coordSearch?zone=" + this.zoneGeo;
-
 
164
		$.getJSON(url, function(data) {
-
 
165
			lthis.latLngDeb = new google.maps.LatLng(data.lat, data.lng);
-
 
166
			lthis.suiteInitialiserGoogleMap();
-
 
167
		});
-
 
168
		
-
 
169
	}
-
 
170
	
158
	this.latLngDeb = new google.maps.LatLng(48.8543, 2.3483);// Paris
171
	// si param "ville"
159
	if (this.ville == 'Marseille') {
172
	else if (this.ville == 'Marseille') {
-
 
173
		this.latLngDeb = new google.maps.LatLng(43.29545, 5.37458);
-
 
174
		this.suiteInitialiserGoogleMap();
160
		this.latLngDeb = new google.maps.LatLng(43.29545, 5.37458);
175
	} 
161
	} else if (this.ville == 'Montpellier') {
176
	else if (this.ville == 'Montpellier') {
-
 
177
		this.latLngDeb = new google.maps.LatLng(43.61077, 3.87672);
162
		this.latLngDeb = new google.maps.LatLng(43.61077, 3.87672);
178
		this.suiteInitialiserGoogleMap();
-
 
179
	}
-
 
180
	
-
 
181
}
-
 
182
 
-
 
183
 
163
	}
184
WidgetSaisieSauvages.prototype.suiteInitialiserGoogleMap = function() {
164
	var options = {
185
	var options = {
165
			zoom: 16,
186
			zoom: 14, // avant : 16
166
			center: this.latLngDeb,
187
			center: this.latLngDeb,
167
			mapTypeId: google.maps.MapTypeId.HYBRID,
188
			mapTypeId: google.maps.MapTypeId.HYBRID,
168
			mapTypeControlOptions: {
189
			mapTypeControlOptions: {
169
				mapTypeIds: ['OSM',
190
				mapTypeIds: ['OSM',
Line 191... Line 212...
191
 
212
 
192
	// Ajout de l'évènment sur click dans Carte
213
	// Ajout de l'évènment sur click dans Carte
Line 193... Line 214...
193
	google.maps.event.addListener(this.map, 'click', this.surClickDansCarte.bind(this));
214
	google.maps.event.addListener(this.map, 'click', this.surClickDansCarte.bind(this));
-
 
215
 
-
 
216
	// Lorsque la carte est chargée, on vérifie si on peut précharger des données
194
 
217
	/*
195
	// Lorsque la carte est chargée, on vérifie si on peut précharger des données
218
	if (this.ville != Paris) {
196
	google.maps.event.addListenerOnce(this.map, 'idle', function(){
219
		google.maps.event.addListenerOnce(this.map, 'idle', function(){
197
		// Initialisation du marker de début de rue
220
			// Initialisation du marker de début de rue
198
		if (!lthis.obsId) {
221
			if (!lthis.obsId) {
199
			// Tentative de geocalisation si aucune obs à précharger
222
				// Tentative de geolocalisation si aucune obs à précharger
200
			lthis.initialiserMarkerDeb();
223
				lthis.initialiserMarkerDeb();
201
			lthis.tenterGeolocalisation();
224
				lthis.tenterGeolocalisation();
-
 
225
			}
-
 
226
		});
Line 202... Line 227...
202
		}
227
	}
203
	});
228
	*/
204
 
229