<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="map.aspx.cs" Inherits="HeyuanHouse.Web.member.map" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>河房网 - 专业的房产信息交易平台 - www.0762h.com</title>
<link href="/images/style.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="../editor/jquery/theme/redmond/jquery-ui-custom.css" rel="stylesheet" />	
<script type="text/javascript" src="../editor/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../editor/jquery/jquery-ui-custom.min.js"></script>
<script type="text/javascript" src="http://app.mapabc.com/apis?&t=flashmap&v=2.3.3&key=f6c97a7f64063cfee7c2dc2157847204d4dbf0931760856cd1a1ee65047663735ac13191322c5169"></script> 
<script type="text/javascript">
var mapObj=null;
var flag = false ;
function  mapInit() {
  var mapoption = new MMapOptions();
  mapoption.zoom=14;//设置地图zoom级别
  mapoption.center= new MLngLat("ggijrqppotNKNI","hicsqhlplNGNI", COORD_TYPE_ENCODE); //new MLngLat(116.397428,39.90923); 114.69949722290039,23.747011406229973
  mapoption.toolbar=DEFAULT; //设置工具条
  mapoption.toolbarPos=new MPoint(0,0); //设置工具条位置
  //mapoption.overviewMap =SHOW; //设置鹰眼
  mapObj = new MMap("map", mapoption); //地图初始化

  mapObj.addEventListener(mapObj,MOUSE_CLICK,MclickMouse); 
}

var lng , lat;
function MclickMouse(param)
{   
  lng = param.eventX ;
  lat = param.eventY ;
  if (flag)
  {
     mapObj.removeOverlayById("mark");
     madeMarker(lng,lat) ;
  }
}

function madeMarker(lng,lat)
{
  var markerOption = new MMarkerOptions();
  var tipOption = new MTipOptions();
  tipOption.title = "房源地图" ;
  tipOption.content = "您的房源的具体地图位置";
  
  var labelOption = new MLabelOptions();
  labelOption.content = "房源位置" ;
  markerOption.labelOption = labelOption ; 
  markerOption.isDraggable=false;//是否可以拖动          
  markerOption.imageAlign=BOTTOM_CENTER;//设置图片锚点相对于图片的位置         
  markerOption.tipOption = tipOption;         
  markerOption.canShowTip= true;              
  Mmarker = new MMarker(new MLngLat(lng,lat),markerOption);         
  Mmarker.id="mark";         
  mapObj.addOverlay(Mmarker,true) ; 
}

function startMark()
{
   flag = true ;
}

function endMark()
{
   flag = false ;
}

function okMark()
{
   if (lng != undefined && lat != undefined)
   {
       window.parent.document.getElementById("txtmaplnglat").value = lng + "," + lat ;
   }
   window.parent.document.getElementById("btnCloseMapFrame").click();
}

</script>
</head>
<body onload="mapInit();" style="margin:0px ; padding:0px">
<div id="map" style="width: 600px; height: 330px; margin:0px ; padding:0px"></div>
<input type="button" value="开始标注" onclick="startMark();" />
<input type="button" value="退出标注" onclick="endMark();" style="display:none" />
<input type="button" value="确定标注" onclick="okMark();" />
</body>
</html>