function JbCustomMapControl() {}

JbCustomMapControl.prototype = new GControl();

JbCustomMapControl.prototype.initialize = function(map) 
{
	var container = document.createElement("div");
	container.innerHTML = "&nbsp;";
	container.className = "jbCustomMapControl";

	map.getContainer().appendChild(container);
	return container;
}

function JbCustomMapControl2(locate) {this.locate = locate;}

JbCustomMapControl2.prototype = new GControl();

JbCustomMapControl2.prototype.initialize = function(map) 
{
	var container = document.createElement("div");
	container.style.width = "100%";
	container.style.padding = "1px";
	container.style.textAlign = "center";
	
	if (this.locate)
	{
		var btn0 = document.createElement("input");
		btn0.type = "button";
		btn0.value = "定位";
		btn0.style.marginRight = "20px";
		GEvent.addDomListener(btn0, "click", function() {jbMap.locate(document.getElementById('address').value);});
		container.appendChild(btn0);
	}

	var btn1 = document.createElement("input");
	btn1.type = "button";
	btn1.value = "放大";
	GEvent.addDomListener(btn1, "click", function() {jbMap.zoomIn();});
	container.appendChild(btn1);

	var btn2 = document.createElement("input");
	btn2.type = "button";
	btn2.value = "縮小";
	btn2.style.marginRight = "20px";
	GEvent.addDomListener(btn2, "click", function() {jbMap.zoomOut();});
	container.appendChild(btn2);
	
	var container2 = document.createElement("span");
	container2.style.color = "#FFFFFF";
	container2.style.fontWeight = "bold";
	container2.style.fontSize = "13px";
	container2.innerHTML = '<input type="radio" name="map_type" onclick="return jbMap.changeMapType(G_NORMAL_MAP)" checked>地圖' +
									'<input type="radio" name="map_type" onclick="return jbMap.changeMapType(G_SATELLITE_MAP)">衛星' +
									'<input type="radio" name="map_type" onclick="return jbMap.changeMapType(G_HYBRID_MAP)">混合地圖';
	container.appendChild(container2);									

	map.getContainer().appendChild(container);
	return container;
}

