<!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 runat="server">
<title>地图标注</title>
<script src="http://app.mapabc.com/apis?&t=flashmap&v=2.2&key=98fadf9ac86088c6e7966e8949b1f5a3a6efe15d5c01eeb0e080fc298f8728c542a2b6f8d09d7e40"
type="text/javascript"> </script>
<script type="text/javascript">
var mapObj = null;
window.onload = function() {
//设置地图初始化参数对象
var mapOptions = new MMapOptions();
mapOptions.zoom = 10;
//设置中心点为郑州
mapOptions.center = new MLngLat("fjqennngoNKOI","hmlnnismtJGGM",0);
mapOptions.zoom = 13;
mapOptions.toolbar = DEFAULT;
mapOptions.toolbarPos = new MPoint(0, 0);
mapOptions.overviewMap = DEFAULT;
//创建地图对象
mapObj = new MMap("mapObj", mapOptions);
registMouseAddMarker();
}
function onClick(e) {
var ll = new MLngLat(e.eventX,e.eventY);
var marker = new MMarker(ll);
marker.id = "marker";
mapObj.addOverlay(marker);
var xy = marker.lnglat.lngX + "," + marker.lnglat.latY;
document.getElementById("hdMapFlag").value = xy;
}
function registMouseAddMarker() {
mapObj.addEventListener(mapObj,MOUSE_CLICK,onClick);
/*
var point = parent.document.getElementById("hdMap").value;
if (point != null && point != "") {
var position = point.split(",");
var ll = new MLngLat(position[0],position[1]);
var marker = new MMarker(ll);
marker.id = "marker";
mapObj.addOverlay(marker);
}
document.getElementById("hdMapFlag").value = point;
*/
}
function unregistMouseAddMarker() {
// mapObj.removeEventListener(mapObj,MOUSE_CLICK,onClick);
//parent.document.getElementById("hdMap").value = document.getElementById("hdMapFlag").value;
//window.parent.$.fadeD(0);
}
</script>
</head>
<body>
<h2>修改标注</h2>
<div id="mapObj" class="view" style="width:620px;height:420px"></div>
<input type='button' name='a' οnclick='javascript:registMouseAddMarker();' value='标点'/>
<!---<input type='button' name='b' οnclick='javascript:unregistMouseAddMarker();' value='确定标点'/>--->
<input type="text" id="hdMapFlag" name="hdMapFlag" />
</body>
</html>
<!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>
<script src="http://app.mapabc.com/apis?&t=flashmap&v=2.2&key=98fadf9ac86088c6e7966e8949b1f5a3a6efe15d5c01eeb0e080fc298f8728c542a2b6f8d09d7e40" type="text/javascript">
</script>
<script type="text/javascript">
var mapObj=null;
function mapInit() {
var mapoption = new MMapOptions();
mapoption.zoom=13;//设置地图zoom级别
mapoption.center=new MLngLat(116.397428,39.90923);
mapoption.toolbar=DEFAULT; //设置工具条
mapoption.toolbarPos=new MPoint(0,0);
mapoption.overviewMap =DEFAULT; //设置鹰眼
mapObj = new MMap("map", mapoption); //地图初始化
}
function DoCenterZoom(){
var lng = 114.7573471069336;
var lat = 36.89719446989036;
var markerOption=new MMarkerOptions();
var tipOption = new MTipOptions();
tipOption.title="点";
tipOption.content="<br> 这是点!<br>";//tip内容
var labelOption=new MLabelOptions();
labelOption.content="点";
markerOption.labelOption=labelOption; //标注
markerOption.tipOption = tipOption;
markerOption.canShowTip= false;
Mmarker = new MMarker(new MLngLat(lng,lat),markerOption);
Mmarker.id="mark";
mapObj.addOverlay(Mmarker,true) ;
}
</script>
</head>
<body οnlοad="mapInit();DoCenterZoom();">
<div id="map" style="width: 500px; height: 300px"></div>
<div>
<input type="button" onClick="javascript:addMarker();" value="添加标注点"/>
</div>
</body>
</html>
//114.7573471069336,36.89719446989036
ASP.NET中调用存储过程带(输入/输出)参数和返回值的一些常用的例子
最新推荐文章于 2021-05-27 11:32:03 发布