<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="GetMap_LLZ.aspx.cs" Inherits="MYAPP.google.GetMap_LLZ" %>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Get Google XYZ</title>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script language='JavaScript' type='text/javascript' src='/js/common.js'></script>

    <script type='text/javascript' src='/ajax/libs/prototype/prototype.js'></script>
    <script type="text/javascript">
var oWindow=window.opener;
var map;
var marker;
var mgr;
var GMarkersScene =[];
    function initialize()
	 {
		 var myOptions = {
          zoom: <%=Request.QueryString["zoom"]%>,
          center: new google.maps.LatLng(<%=Request.QueryString["lat"]%>,<%=Request.QueryString["lng"]%>),
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
      
        map = new google.maps.Map(document.getElementById('map_canvas'),myOptions);
		

		<%if (Request.QueryString["Tour_ID"]!=null){%>
		//runScript('marker_js.aspx?Tour_ID=<%=Request.QueryString["Tour_ID"]%>');
		<%}%>

		marker = new google.maps.Marker({
        position: new google.maps.LatLng(<%=Request.QueryString["lat"]%>,<%=Request.QueryString["lng"]%>), 
        map: map,
        title:"拖动标签移动到相应的位置",
		draggable:true,
      	animation: google.maps.Animation.DROP
    	});   

		google.maps.event.addListener(marker, 'click', toggleBounce);
     }


	  function toggleBounce() {
	
		if (marker.getAnimation() != null) {
		  marker.setAnimation(null);
		} else {
		  marker.setAnimation(google.maps.Animation.BOUNCE);
		}
	  }
  	
	function setupSceneMarkers() 
	{
		  mgr.addMarkers(GMarkersScene,13);
		  mgr.refresh();
	}
	function getIcon(url,width,height,x,y)
	{
		var icon = null;
		icon =  new GIcon(G_DEFAULT_ICON,url);
		icon.iconSize  = new GSize(width, height); 
		icon.iconAnchor  = new GPoint(x, y); 
		icon.infoWindowAnchor = new GPoint(x, y); 
		icon.shadow = "";
		icon.shadowSize = new GSize(0, 0); 
		return icon;
	}
	function SetLLZ()
	{
       oWindow.SetLLZ(marker.getPosition().lat(),marker.getPosition().lng(),map.getZoom());
	   window.close();
	}
	
	function MoveToLLZ()
	{
		map.setCenter(marker.getPosition(), map.getZoom());
	}
    </script>
    </head>
    <body onLoad="initialize()" onUnload="GUnload()" style="margin:0">
<input name="" type="button"  onclick="SetLLZ()" value="提交保存"  style="position:absolute;top:50px;right:10px; z-index:100; width:80px; cursor:pointer;"/>
<input type="button"  onclick="MoveToLLZ()" value="标注位置"  style="position:absolute;top:76px;right:10px; z-index:100; width:80px; cursor:pointer;"/>
<input type="button"  onclick="MoveToLLZ()" value="标注中心"  style="position:absolute;top:76px;right:10px; z-index:100; width:80px; cursor:pointer;"/>
<div id="map_canvas" style="width: 100%; height: 100%"></div>
<script type="text/javascript"> 
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script> 
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-6668974-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>
