/**
 * @author toby
 */
var myMap;
var userContentControl;
var limit = 0;
function initMap(){
	myMap = new Map();
	myMap.setLatitude(0.27268853598095);
	myMap.setLongitude(10.546875);
	myMap.setZoomLevel(1);
	myMap.setWidth(750);
	myMap.setHeight(390);
	myMap.setMapDiv("map");
	myMap.setMapType(G_HYBRID_MAP);

	myMap.loadMap();
		
	userContentControl = new CustomControl(myMap);
	userContentControl.setText("I want to add my beach project to the map");
	userContentControl.setTextOff("I want to return to browsing the map");
	userContentControl.setState("view");
	userContentControl.setAnchor(G_ANCHOR_TOP_RIGHT);
	userContentControl.setOffsetx(10);
	userContentControl.setWidth(280);
	userContentControl.setType("addusercontent");
	userContentControl.setClassname("add-button");
	
	var zoomInControl = new CustomControl(myMap);
	zoomInControl.setText("Zoom In");
	zoomInControl.setType("zoomin");
	zoomInControl.setWidth(110);
	
	var zoomOutControl = new CustomControl(myMap);
	zoomOutControl.setText("Zoom Out");
	zoomOutControl.setOffsety(30);
	zoomOutControl.setType("zoomout");
	zoomOutControl.setWidth(110);

	var jumpInControl = new CustomControl(myMap);
	jumpInControl.setText("Jump In");
	jumpInControl.setOffsety(55);
	jumpInControl.setType("jumpin");
	jumpInControl.setWidth(110);

	var resetMap = new CustomControl(myMap);
	resetMap.setText("Jump Out");
	resetMap.setAnchor(G_ANCHOR_TOP_LEFT);
	resetMap.setOffsety(80);
	resetMap.setWidth(110);
	resetMap.setType("reset");
	
	var showPlacenamesControl = new CustomControl(myMap);
	showPlacenamesControl.setText("Hide place names");
	showPlacenamesControl.setTextOff("Show place names");
	showPlacenamesControl.setState("hide");
	showPlacenamesControl.setAnchor(G_ANCHOR_TOP_LEFT);
	showPlacenamesControl.setOffsety(105);
	showPlacenamesControl.setWidth(110);
	showPlacenamesControl.setType("showplacenames");
							
	myMap.map.addControl(zoomInControl);
	myMap.map.addControl(zoomOutControl);
	myMap.map.addControl(jumpInControl);
	myMap.map.addControl(showPlacenamesControl);
	myMap.map.addControl(resetMap);
	myMap.map.addControl(userContentControl);
	myMap.map.addControl(new GSmallMapControl(),new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10, 10)));
	
	var datasource = "/apps/map_uploads/includes/allmarkers_1632_beach.php";
	var querystring = "?f=" + configfolder + "&l=" + limit;
	myMap.loadPoints(datasource + querystring);
	
}
