Subversion Repositories Sites.obs-saisons.fr

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
31 aurelien 1
var map;
2
var marker;
3
 
4
function verifierEtLocaliserCoordonnees() {
5
 
6
	var lat = $('#station_lat').html();
7
	var lon = $('#station_lon').html();
8
 
9
	if(!isNaN(lat) && lat.length > 0 && !isNaN(lon) && lon.length > 0) {
10
 
11
	} else {
12
		//window.alert("coordonnées invalides");
13
	}
14
 
15
	var positionMarker = new google.maps.LatLng(lat, lon);
16
 
17
	marker.setPosition(positionMarker);
18
	map.setCenter(positionMarker);
19
}
20
 
21
function initialiserCarte() {
22
 
23
	var latlng = new google.maps.LatLng(47.0504, 2.2347);
24
	var myOptions = {
25
		zoom: 6,
26
		center: latlng,
27
		mapTypeId: google.maps.MapTypeId.HYBRID
28
	};
29
 
30
	map = new google.maps.Map(document.getElementById("map_canvas"),
31
    	myOptions);
32
 
33
	marker = new google.maps.Marker({
34
	      position: latlng,
35
	      title:""
36
	});
37
 
38
	marker.setDraggable(false);
39
	marker.setClickable(true);
40
 
41
	// To add the marker to the map, call setMap();
42
	marker.setMap(map);
43
}
44
 
45
$(document).ready(function() {
46
	initialiserCarte();
47
});
48
 
49
$('#conteneur_liens_lat_lon').ready(function() {
50
	verifierEtLocaliserCoordonnees();
51
});