function MDControl() {};
MDControl.prototype = new GControl();
MDControl.prototype.initialize = function(map) {
    var container = document.createElement("div");
    var savepos= document.createElement("div");
    savepos.title= "Voir tout le réseau";
    savepos.className= "MDbuttons";
    container.appendChild(savepos);
    savepos.appendChild(document.createTextNode("Voir tout le réseau"));
    GEvent.addDomListener(savepos, "click", function() {
	    map.setCenter(map.getCenter(), 9);	 	   
	});
    map.getContainer().appendChild(container);
    return container;
}


MDControl.prototype.getDefaultPosition = function() {
    return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,30));
}

function LegendControl() {};
LegendControl.prototype = new GControl();
LegendControl.prototype.initialize = function(map) {
    var container = document.createElement("div");
    var legend_1 = document.createElement("div");
    legend_1.className= "map_legend";
    var legend_2 = document.createElement("div");
    legend_2.className= "map_legend";
    container.appendChild(legend_1);   
    container.appendChild(legend_2);   
    var src_1 = document.createAttribute("src");
    src_1.nodeValue = "http://www.google.com/uds/samples/places/temp_marker.png";
    var img_1 = document.createElement("img");
    img_1.setAttributeNode(src_1)
    legend_1.appendChild(img_1)
    legend_1.appendChild(document.createTextNode("Port principal"));
    var src_2 = document.createAttribute("src");
    src_2.nodeValue =  "http://maps.gstatic.com/intl/fr_ALL/mapfiles/marker.png";
    var img_2 = document.createElement("img");
    img_2.setAttributeNode(src_2);
    legend_2.appendChild(img_2);
    legend_2.appendChild(document.createTextNode("Port secondaire"));
    map.getContainer().appendChild(container);
    return container;
}


LegendControl.prototype.getDefaultPosition = function() {
    return new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(10,30));
}

$(document).ready(function(){
	map.addControl(new MDControl());
	map.addControl(new LegendControl());
		
    });
