function MyApplication() {

var map = new GMap2(document.getElementById("map"));
// Création de la carte en utilisant les nouveaux outils
map.addMapType(G_PHYSICAL_MAP);
var mapControl = new GHierarchicalMapTypeControl();

// Configuration des relations Type Controle
mapControl.clearRelationships();
mapControl.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Plus de d"+String.fromCharCode(233)+"tails", false);
map.addControl(mapControl); // Affichage des contrôles

map.setCenter(new GLatLng(46.227638, 2.213749), 5);
var x = document.getElementById("souszone");
if(x){
lat = parseFloat(x.value.split(",")[0]);
lng = parseFloat(x.value.split(",")[1]);
scale = parseInt(x.value.split(",")[2]);
map.setCenter(new GLatLng(lat,lng),scale);
}else{
map.setCenter(new GLatLng(46.227638, 2.213749), 5);
}

map.addControl(new GLargeMapControl3D()); // autres curseurs GSmallControl GLargeControl
new GKeyboardHandler(map);
map.enableContinuousZoom();
map.enableDoubleClickZoom(); // Zoom avec double-clic
map.enableScrollWheelZoom(); // Zoom avec la molette de la souris

var point = new GLatLng(lat, lng);

var marker = new GMarker(point, {icon:G_DEFAULT_ICON, draggable: true}); 
map.addOverlay(marker);
marker.enableDragging();

GEvent.addListener(marker, "drag", function(){
document.getElementById("localisation").value=marker.getPoint().toUrlValue();
});


}

function initialize() {
if (GBrowserIsCompatible()) {
var application = new MyApplication();
}else{
alert("DÃ©solÃ©, Google Maps n'est pas compatible avec votre navigateur.");
}
}

