Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1629 alexandre_ 1
// Variables globales
2
var map = null;
3
var lat = document.getElementById("latitude");
4
var lon = document.getElementById("longitude");
5
// Pour gerer la taille
6
var winW = 630, winH = 560;
7
var deltaH = 50;
8
var deltaW = 30;
9
    function setWinHW() {
10
if (window.innerHeight) {
11
    winW = window.innerWidth  - deltaW;
12
    winH = window.innerHeight - deltaH;
13
    } else {
14
    winW = document.documentElement.offsetWidth  - 20 - deltaW;
15
    winH = document.documentElement.offsetHeight - 20 - deltaH ;
16
    }
17
 
18
var me = document.getElementById("map");
19
if (me != null) {
20
    me.style.width= '' + winW + 'px';
21
me.style.height= '' + winH + 'px';
22
    }
23
}
24
 
25
window.onresize = function () {
26
setWinHW();
27
if (map)  map.checkResize();
28
}
29
 
30
function createMarker(point, chaine, icon) {
31
    var marker = new GMarker(point, icon);
32
  	GEvent.addListener(marker, "click", function() {
33
    	marker.openInfoWindowHtml(chaine);
34
  	});
35
  	return marker;
36
}
37
function load() {
1720 alexandre_ 38
    if (GBrowserIsCompatible()) {
39
        setWinHW();
40
        map = new GMap2(document.getElementById("map"));
41
        var geoXml = new GGeoXml("<?='http://.kml';?>");
42
 
43
        map.addControl(new GSmallMapControl());
44
        map.addControl(new GMapTypeControl());
45
        map.addControl(new GScaleControl());
46
        map.enableContinuousZoom();
47
        map.enableScrollWheelZoom();
48
 
49
        // On centre la carte
50
        center = new GLatLng(<?=INS_GOOGLE_CENTRE_LAT;?>, <?=INS_GOOGLE_CENTRE_LON;?>);
51
        map.setCenter(center, <?=INS_GOOGLE_ALTITUDE;?>);
52
        map.setMapType(<?=INS_GOOGLE_TYPE_DE_VUE;?>);
53
        <?=$script_marker;?>
54
        map.addOverlay(geoXml);
1629 alexandre_ 55
	}
56
}