<!--<?php
print <<<EOT
-->
<!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>显示地图</title>
<link rel="stylesheet" type="text/css" href="images/pw_core.css" media="all" />
<script type="text/javascript" src="http://app.mapabc.com/apis?&t=flashmap&v=2.3.2&key={$_viewer->mapkey}"></script>   
<script type="text/javascript" src="mode/dianpu/js/maputility.js"></script>
<script type="text/javascript" src="mode/dianpu/js/map.js"></script>
<script type="text/javascript" src="mode/dianpu/js/keywordsearch.js"></script>
<script type="text/javascript" src="mode/dianpu/js/city_u.js"></script>
<script type="text/javascript" src="mode/dianpu/js/city.js"></script>
</head>
<script type="text/javascript">
function  showHouseMap(){
	var mapPointObj = new mapPoint();
	var point_x = '{$_viewer->dianpu->map_x}';
	var point_y = '{$_viewer->dianpu->map_y}';
	var toolbarMap = '{$_viewer->toolbarMap}';
	var scaleMap = '{$_viewer->scaleMap}';
	var overviewMap = '{$_viewer->overviewMap}';
	if(point_x != null && point_x != '' && point_y != null && point_y != ''){
		mapPointObj.mapZoom = '{$_viewer->dianpu->map_z}';
		mapPointObj.point_x = point_x;
		mapPointObj.point_y = point_y;
		mapPointObj.pointTip = getPointTipContents('{$_viewer->dianpu->title}','{$_viewer->dianpu->areanumber}-{$_viewer->dianpu->phone}','{$_viewer->dianpu->address}','{$_viewer->dianpu->dianpuid}');
		mapPointObj.pointTitle = htmlDecode('{$_viewer->dianpu->title}');
		mapPointObj.showLaber = true;
		mapPointObj.pointLaber = '{$_viewer->dianpu->title}';
		mapPointObj.showTip = false;
	}else{
		//如果没有坐标点信息地图定位到默认城市
		var cityName = Trim('{$_viewer->cityName}');
		if(cityName == null || cityName == 'undefined' || cityName == '') cityName = '杭州';
		var cityCode = city.ctn2c(cityName);
		var xy = new Array();
		xy = city.ctxy(cityCode);
		if (xy == null || xy == 'undefined') {
			alert('默认城市未设置');
			return;
		}
		mapPointObj.mapZoom = 11;
		mapPointObj.point_x = xy[0];
		mapPointObj.point_y = xy[1];
		mapPointObj.showTip = false;
		mapPointObj.showPointDelay = true;
	}
	if (toolbarMap) mapPointObj.toolbarMap = toolbarMap;
	if (scaleMap) mapPointObj.scaleMap = scaleMap;
	if (overviewMap) mapPointObj.overviewMap = overviewMap;
	mapInit(mapPointObj);
}

function showSearchResultList (data){
	var temp = "";
	var overarr = new Array();
	for (var i=0; i < data.length; i++) {
		var x = data[i]['map_x'];
		var y = data[i]['map_y'];
		if(x=='' || y==''){
			continue;
		}
		var sContent = getPointTipContent(data[i]['title'],data[i]['phone'],data[i]['address']);
		var pointId = data[i]['dianpuid'];
		mapPointObj = new mapPoint();
		mapPointObj.point_x = x;
		mapPointObj.point_y = y;
		mapPointObj.pointTitle = pointId +" "+ data[i]['name'];
		mapPointObj.pointTip = sContent;
		mapPointObj.pointId = pointId;
		mapPointObj.showTip = false;
		mapPointObj.showLaber = true;
		mapPointObj.pointLaber = (i+1) + ".  " +data[i]['title'];
		mapPointObj.showPointDelay = true;
		drawPointOnMap(mapPointObj);
		overarr.push(marker);
	}
	mapObj.addOverlays(overarr,true);
}

function getPointTipContent(title,tel,add){
	var content = '';
	content += "<table width='260' style='line-height:1.8;color:#333;font-size:12px;'>";
	content += "<tr><td colspan='2'>"+title+"</td></tr>";
	content += "<tr><td width='40'>电话: </td><td>"+tel+"</td></tr>";
	content += "<tr><td valign='top'>地址: </td><td>"+add+"</td></tr>";
	content += "</table>";
	return content;
}
</script>
<body onload="showHouseMap()">
<!--
EOT;
?>