您的位置:首页 > 其它

简单、快速的开发运用(电子地图)GIS引擎

2014-07-29 09:52 323 查看
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script type="text/javascript" src="http://211.136.131.242:8087/api/map.js?key=您的密钥"></script>

<title>图片标注</title>

<style type="text/css">

body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;}

</style>

</head>

<body>

<div id="div_map" style="width:100%;height:100%;"></div>

<script type="text/javascript">

var map=null;

map=new STMapObj("div_map");

map.locateMap(new STMapPoint(121.476324,31.22717),3);

LocationPoint();

function LocationPoint(){

var poly = new STMapMarker();

poly.id="testline6"; //【必选】对象 id

poly.point=new STMapPoint(121.47727877909848,31.227720161691113); //【必选】经纬度坐标 STMapPoint 类型

poly.img="../img/carAPI.png"; //【必选】对象的图片地址 url

poly.label=""; //【可选】鼠标提示

poly.size="" //【可选】图片长宽 参数为 STMapSize 类型,默认为图片本身尺寸

poly.anchor="TR" // 【可选】定位锚点,BC (下边中心点)BL (左下角)BR (右下角)TL (左上角)TC (上边中心点)TR (右上角)ML (左边中心点)MR (右边中心点)CENTER (图片中心点)

poly.infowin=true; //【可选】是否点击显示信息窗口,默认为 true。

poly.title=""; //属性信息库标题,支持 html 代码

poly.content="我是的添加的图片"; //属性信息框内容,支持 html 代码

poly.moveable = false; //是否可以拖动

map.addOverlay(poly);

}

</script>

<div style="display: none">

<script type="text/javascript">

var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cspan id='cnzz_stat_icon_1000501913'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s11.cnzz.com/z_stat.php%3Fid%3D1000501913' type='text/javascript'%3E%3C/script%3E"));

</script>

</div>

</body>

</html>

查看运行效果
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: