<div id="itemsmap" style="width:251px;height:250px;"></div>
<script type="text/javascript" language="javascript" src=" http://api.51ditu.com/js/maps.js"></script>
<script type="text/javascript" language="javascript">
var maps = new LTMaps( 'itemsmap' ); 
// 标注点 - 城市中心
var point = new LTPoint( $_default_mappoints[$city] );
// 控制器
var control = new LTStandMapControl( 2 );
maps.addControl( control );
// 定位中心点缩放登记
maps.centerAndZoom( point, 4 );
var marks = new Array();
<!--{eval $i=0}-->{LF}
<!--{loop $shops $val}-->
<!--{if !empty($val[mappoint][0])}-->
marks[$i] = new Array($val[mappoint][0],$val[mappoint][1],'$val[sid]');
<!--{eval $i++}-->{LF}
<!--{/if}-->
<!--{/loop}-->{LF}
var next=0;
var infoWin=null;
function nextMapMark() {
    if(next>=marks.length) next=0;
    var sid = marks[next][2];
    var title = $('#item_name_'+sid).text();
    var label = createLabel(sid);
    var point = new LTPoint( marks[next][0],marks[next][1] );
    maps.moveToCenter( point, $_panel_config[$pcd][catemap_level] );
    if(infoWin!=null) infoWin.closeInfoWindow();
    infoWin = new LTInfoWindow( point );
    infoWin.setTitle( title ); 
    infoWin.setLabel( label ); 
    maps.addOverLay( infoWin ); 
    infoWin.moveToShow();
    next++;
}
function createLabel(sid) {
    var label = '';
    label += '<table border="0" cellspacing="0" cellpadding="0">';
    label += '<tr><td valign="top" style="padding-right:5px;">';
    label += $('#item_pic_'+sid).html();
    label += '</td><td valign="top">';
    label += $('#item_address_'+sid).html();
    label += '<br />';
    label += !$('#item_tel_'+sid)[0]?'':$('#item_tel_'+sid).html();
    label += '<br />';
    label += '<a href="shop.php?shopid='+sid+'"><span class="font_2">查看详细信息</span></a>';
    label += '</td></tr>';
    label += '</table>';
    return label;
}


window.onload = function() {
    if(marks.length>0) {
        nextMapMark();
        window.setInterval(nextMapMark, $_panel_config[$pcd][catemap_time]);
    }
}
</script>