之前做了一个小项目用到了类似测距的功能
效果图:
[img]http://dl.iteye.com/upload/attachment/0074/0274/f6051600-d794-3cd5-9e8e-a336f39f666c.jpg[/img]
这里分享出来希望可以帮助大家首先引入svg.js jQuery.js
MAP:
--index.html
|
--stone.gif
|
--js
--jquery.js
|
--svg.js
css:
js:
效果图:
[img]http://dl.iteye.com/upload/attachment/0074/0274/f6051600-d794-3cd5-9e8e-a336f39f666c.jpg[/img]
这里分享出来希望可以帮助大家首先引入svg.js jQuery.js
MAP:
--index.html
|
--stone.gif
|
--js
--jquery.js
|
--svg.js
css:
<style type="text/css">
#maps{
width:500px;
height:300px;
background:#f9f9f9;
border:1px solid #c6c6c6;
margin:10px auto;
position:relative;
}
div.point{
position:absolute;
width:12px;
height:12px;
background:url(stone.gif) no-repeat;
}
div.svgCotainer{
position:absolute;
}
#mapPloy{
position:absolute;
}
#info{
position:absolute;
top:10px;
right:10px;
width:100px;
height:25px;
background:#ecf6fc;
border:1px solid #8ad0fd;
font-size:14px;
font-family:Arial, Helvetica, sans-serif;
color:#51a961;
text-align:center;
line-height:25px;
}
</style>
js: