Map center and spawn point

Jul 30, 2011 at 11:15 PM

Would it be possible for the tool to read the location of one spawnpoint and then set that as the Latlng location in the map?

Jul 31, 2011 at 9:11 PM

And what about using LatlngBounds to make it impossible to go ouside the map area?

Aug 4, 2011 at 12:24 PM
Edited Aug 4, 2011 at 12:57 PM

I've made a button to take you back to your "home" location

function HomeControl(controlDiv, map) {    
	// Set CSS styles for the DIV containing the control   
	// Setting padding to 5 px will offset the control   
	// from the edge of the map   controlDiv.style.padding = '5px';    
	// Set CSS for the control border   
	var controlUI = document.createElement('DIV');   
	controlUI.style.backgroundColor = 'white';   
	controlUI.style.borderStyle = 'solid';   
	controlUI.style.borderWidth = '2px';   
	controlUI.style.cursor = 'pointer';
	controlUI.style.marginTop = '10px',
	controlUI.style.textAlign = 'center';   
	controlUI.title = 'Click to set the map to Home';   
	controlDiv.appendChild(controlUI);    
	// Set CSS for the control interior   
	var controlText = document.createElement('DIV');   
	controlText.style.fontFamily = 'Arial,sans-serif';   
	controlText.style.fontSize = '12px';   
	controlText.style.paddingLeft = '4px';
	controlText.style.paddingRight = '4px';
	controlText.innerHTML = 'Home';   
	controlUI.appendChild(controlText);    
	// Setup the click event listeners: simply set the map to Chicago   
	google.maps.event.addDomListener(controlUI, 'click', function() {     
	map.setCenter(spawn)   
	});
}

//Inside initialize()
	// Create the DIV to hold the control and call the HomeControl() constructor   
	// passing in this DIV.   
	var homeControlDiv = document.createElement('DIV');   
	var homeControl = new HomeControl(homeControlDiv, map);    
				homeControlDiv.index = 1;   
	map.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv); 
This can be viewed here: http://terraria.sewers.dk
I'm also trying to work out how to make a marker for every chest, heart and so on, so you can click the link and see the location of the chest/heart.
Still trying to figure out how to set bounds on the map.
Aug 4, 2011 at 7:28 PM

Maybe we can get some pointers on how to make this right, from this game map?

http://www.darkmatters.org/Map/S2IBmap.html