Subversion Repositories Applications.papyrus

Rev

Rev 1629 | Blame | Last modification | View Log | RSS feed

// Variables globales
var map = null;
var lat = document.getElementById("latitude");
var lon = document.getElementById("longitude");
// Pour gerer la taille  
var winW = 630, winH = 560;
var deltaH = 50;
var deltaW = 30;
    function setWinHW() {
if (window.innerHeight) {
    winW = window.innerWidth  - deltaW;
    winH = window.innerHeight - deltaH;
    } else {
    winW = document.documentElement.offsetWidth  - 20 - deltaW;
    winH = document.documentElement.offsetHeight - 20 - deltaH ; 
    }
    
var me = document.getElementById("map");
if (me != null) {
    me.style.width= '' + winW + 'px';
me.style.height= '' + winH + 'px';
    }
}

window.onresize = function () {
setWinHW();
if (map)  map.checkResize();
}       

function createMarker(point, chaine, icon) {
    var marker = new GMarker(point, icon);
        GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(chaine);
        });
        return marker;
}
function load() {
        if (GBrowserIsCompatible()) {
          setWinHW();
          map = new GMap2(document.getElementById("map"));
          var geoXml = new GGeoXml("<?='http://.kml';?>");
          
          map.addControl(new GSmallMapControl());
          map.addControl(new GMapTypeControl());
          map.addControl(new GScaleControl());
          map.enableContinuousZoom();
          map.enableScrollWheelZoom();
        
          // On centre la carte
          center = new GLatLng(<?=INS_GOOGLE_CENTRE_LAT;?>, <?=INS_GOOGLE_CENTRE_LON;?>);
          map.setCenter(center, <?=INS_GOOGLE_ALTITUDE;?>);
           map.setMapType(<?=INS_GOOGLE_TYPE_DE_VUE;?>);
          <?=$script_marker;?>
          map.addOverlay(geoXml);
        }
}