function drawPoints(){
var pointStyle1 = new MStyle();
pointStyle1.lineColor = 0xff0000;
pointStyle1.lineSize = 3;
pointStyle1.fillColor = 0xddaabb;
pointStyle1.fillOpacity = 50;
pointStyle1.labelColor = 0x00ff00;
pointStyle1.textContent = "<font color='#ff0000'>第一个点的文字描述</font><br>详细信息";
var point1 = new MPointOverlay(new MLatLng("KJONOWKMHLL,MRGYNMLHL"), "第一个点", pointStyle1, "2001");
var points = new Array();
points.push(point1);
mapObj.drawPoints(points, true);
}
这段代码运行上之后会提示我 MStyle为定义
var pointStyle1 = new MStyle();
pointStyle1.lineColor = 0xff0000;
pointStyle1.lineSize = 3;
pointStyle1.fillColor = 0xddaabb;
pointStyle1.fillOpacity = 50;
pointStyle1.labelColor = 0x00ff00;
pointStyle1.textContent = "<font color='#ff0000'>第一个点的文字描述</font><br>详细信息";
var point1 = new MPointOverlay(new MLatLng("KJONOWKMHLL,MRGYNMLHL"), "第一个点", pointStyle1, "2001");
var points = new Array();
points.push(point1);
mapObj.drawPoints(points, true);
}
这段代码运行上之后会提示我 MStyle为定义
经测试下面的代码是正常的
你可以对照你的看一下, 关键在于引用的js
<!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"/>
<script src="http://api.mapabc.com/fmp/v1.0/js/fmp.js?key=b0a7db0b3a30f944a21c3682064dc70ef5b738b062f6479a5eca39725798b1ee300bd8d5de3a4ae3" type="text/javascript"></script>
<script src="http://api.mapabc.com/api/v1.0/js/ajaxsis.js?key=b0a7db0b3a30f944a21c3682064dc70ef5b738b062f6479a5eca39725798b1ee300bd8d5de3a4ae3" type="text/javascript"></script>
<script type="text/javaScript" language="JavaScript" src="http://www.mapabc.com/html/js/ajax/prototype.js"></script>
</head>
<body>
<div id="mapObj" style="width: 400px; height: 300px"></div>
<script type="text/javascript">
var mapoption = new MMapOptions();
mapoption.zoom=13;//设置地图zoom级别
var mapObj = new MMap("mapObj", mapoption); //地图初始化
var pointStyle1 = new MStyle();
</script>
</body>
</html>