1) you really need to get firebug and learn how to use it. How was this:
Code:
</script>
<script>
google.maps.event.addDomListener(controlUI, 'click', function() {
map.setCenter(chicago)
</script>
ever going to do anything but be weird and fail miserably?
2) if you're unsure about what you're doing, you need to make sure that your code is fundamentally sound before trying to do other stuff to it. The code you have at the moment will never work because there is something wrong with the initialize function to begin with. I can't see it, but it there is some problem with the way the map initializes and every time you try to modify the map state it will come up as undefined.
so you can make your link a million ways but it will never work.
what I do in this case is take it back to basics, remove all the bells and whistles, get my new function working and THEN start putting the fancy stuff on top:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
font-family: Helvetica, Arial, sans-serif;
font-size:10px;
margin:0;
}
#content {
}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(39.346896,-76.624446);
var settings = {
zoom: 15,
center: latlng,
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
navigationControl: true,
navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
mapTypeId: google.maps.MapTypeId.ROADMAP};
map = new google.maps.Map(document.getElementById("map_canvas"), settings);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:500px; height:300px"></div>
<a href="javascript:map.panTo(new google.maps.LatLng(25.2,105.7))">China</a>
</body>
</html>
... and check it at very stage when I add something, and if something stops working, have a look at firebug...