-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.js
35 lines (25 loc) · 779 Bytes
/
map.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function initialisation(){
origin = new google.maps.LatLng(0,0);
var optionsCarte = {
zoom: 5,
center: origin,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
maCarte = new google.maps.Map(document.getElementById("map"), optionsCarte);
marker = new google.maps.Marker({
map:maCarte,
draggable:true,
position: origin
});
google.maps.event.addListener(marker,'dragend',afficherUneInfobulle);
}
function afficherUneInfobulle(){
var posX = marker.position.lat();
var posY = marker.position.lng();
var aAfficher = "Latitude : "+posX+'<br />Longtitude : '+posY+"<br />new google.maps.LatLng("+posX+","+posY+");";
var infowindow = new google.maps.InfoWindow({
content: aAfficher
});
infowindow.open(maCarte,marker);
}
window.onload = initialisation;