<?php
$outStr = '<div align="center">
搜索<INPUT TYPE="text" id="searchWord" value=""> <INPUT TYPE="button" onClick="search.search(document.getElementById(\'searchWord\').value);" value="搜索">
<div id="maps" style="position:relative; width:400px; height:200px; border:black solid 1px;">
<div align="center" style="margin:12px;"><a href="http://api.51ditu.com/docs/mapsapi/help.html" target="_blank" style="color:#D01E14;font-weight:bolder;font-size:12px;">看不到地图请点这里</a></div>
</div> <br>       
<script language="javascript" src="http://api.51ditu.com/js/search.js"></script>
<script language="javascript" src="http://api.51ditu.com/js/maps.js"></script>
<script language="javascript">
var map,search;
function showPoint(searchResult)
{
if(searchResult.count>0)//如果存在搜索结果
	{
		map.clearOverLays();
		var poi=searchResult.searchPoints[0];//取出第一个搜索结果点
		var point=new LTPoint(poi.point[0],poi.point[1]);//得到该点的坐标的LTPoint
		map.centerAndZoom(point,0);
		var marker=new LTMarker(point);//向地图上添加一个标记
		map.addOverLay(marker);
		var mapText=new LTMapText(marker);
		mapText.setLabel("<a href=\'"+poi.url+"\' target=_blank>"+poi.name+"</a>");
		map.addOverLay(mapText);
		var name=poi.name;//标记点击的时候弹出信息
	}

else

	{
		alert(\'无结果\');
	}
}
map=new LTMaps("maps");
map.addControl(new LTSmallMapControl());
search=new LTLocalSearch(showPoint);
search.setCity(\'福州\');
search.search(\'五一广场\');
</script>
</div>
';

?>

