<?php
define('IN_MUDDER', TRUE);
require_once(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR."./config.inc.php");
require_once(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'./data/cachefiles/cache_config.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>">
<title>地图标注</title>
<link rel="stylesheet" type="text/css" href="<?=$_config['siteurl']?>images/admin/dialog.css">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
</head>
<body>
<div id="mapmark" style="width:100%;height:300px;">
    <div style="line-height:450px;">Loading map...</div>
</div>
<form method="post" action="" name="dlgfrom">
    <div class="btndiv">
        <input type="button" class="btn2" value="我要标注" onclick="mkctrl.btnClick();" />
    </div>
</form>
<script type="text/javascript" language="javascript" src=" http://api.51ditu.com/js/maps.js "></script>
<script type="text/javascript" language="javascript">
var lng = 0;
var lat = 0;
var map_id = 'mapmark';

var maps = new LTMaps( map_id ); 
var smctrl=new LTStandMapControl();
maps.addControl( smctrl );
maps.cityNameAndZoom( "beijing" , 12 );

var mkctrl = new LTMarkControl();
mkctrl.setVisible( false );
maps.addControl( mkctrl );

function getPoi() {
    var poi = mkctrl.getMarkControlPoint();
    lng = poi.getLongitude();
    lat = poi.getLatitude();
    window.parent.document.getElementById('default_mappoint').value = lng+','+lat;
    window.parent.document.getElementById('remark_iframe').style.display = "none";
}
LTEvent.addListener( mkctrl , "mouseup" , getPoi );
</script>
</body>
</html>