<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head id=
"Head1"
runat=
"server"
>
<title></title>
<style type=
"text/css"
>
html {height: auto;}
body {height: auto;margin: 0;padding: 0;}
#map_canvas {width:1000px;height: 500px;position: absolute;}
@media
print
{#map_canvas {height: 950px;}}
</style>
<script src=
"http://xiazai.jb51.net/201409/other/api_v2.5.1.js"
type=
"text/javascript"
></script>
<script>
var
map;
window.onload =
function
() {
var
myOptions = { zoom: 10, center:
new
sogou.maps.Point(12956000, 4824875) };
map =
new
sogou.maps.Map(document.getElementById(
"map_canvas"
), myOptions);
}
function
setMapTypeId(num) {
switch
(num) {
case
1: map.setMapTypeId(sogou.maps.MapTypeId.ROADMAP);
break
;
case
2: map.setMapTypeId(sogou.maps.MapTypeId.SATELLITE);
break
;
case
3: map.setMapTypeId(sogou.maps.MapTypeId.HYBRID);
break
;
}
}
function
panBy(a, b) {
map.panBy(a, b)
}
function
setOptions() {
map.setOptions({ center:
new
sogou.maps.Point(13522000, 3641093), zoom: 12, mapTypeId: sogou.maps.MapTypeId.ROADMAP })
}
function
setCenter(a, b, c) {
map.setCenter(
new
sogou.maps.Point(a, b), c)
}
function
fitBounds() {
var
bounds =
new
sogou.maps.Bounds(12955101, 4824738, 12958355, 4827449);
map.fitBounds(bounds)
}
</script>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<input value=
"普通地图"
onclick=
"setMapTypeId(1)"
type=
"button"
/>
<input value=
"卫星地图"
onclick=
"setMapTypeId(2)"
type=
"button"
/>
<input value=
"卫星和路网混合地图"
onclick=
"setMapTypeId(3)"
type=
"button"
/>
<input value=
"向左移动"
onclick=
"panBy(200,0)"
type=
"button"
/>
<input value=
"向右移动"
onclick=
"panBy(-200,0)"
type=
"button"
/>
<input value=
"向上移动"
onclick=
"panBy(0,200)"
type=
"button"
/>
<input value=
"向下移动"
onclick=
"panBy(0,-200)"
type=
"button"
/>
<input value=
"向左上移动"
onclick=
"panBy(200,200)"
type=
"button"
/>
<input value=
"上海"
onclick=
"setOptions()"
type=
"button"
/>
<input value=
"天津"
onclick=
"setCenter(13046000,4714250,10)"
type=
"button"
/>
<input value=
"故宫"
onclick=
"fitBounds()"
type=
"button"
/>
<div id=
"map_canvas"
></div>
</form>
</body>
</html>