-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
清理了日志
- Loading branch information
Showing
9 changed files
with
76 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.DS_Store | ||
Thumbs.db | ||
db.json | ||
*.log | ||
node_modules/ | ||
public/ | ||
.deploy*/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | ||
<style type="text/css"> | ||
body, html {width: 100%;height: 100%;margin:0;font-family:"微软雅黑";} | ||
#allmap{width:100%;height:500px;} | ||
</style> | ||
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=bbEWoApoNn5nU41WAdqBEwoNygbB4y6t"></script> | ||
<title>从多个点删除指定点</title> | ||
</head> | ||
<body> | ||
<div id="allmap"></div> | ||
<input type="button" onclick="deletePoint()" value="删除id=1"/> | ||
</body> | ||
</html> | ||
<script type="text/javascript"> | ||
// 百度地图API功能 | ||
var map = new BMap.Map("allmap"); | ||
var point = new BMap.Point(116.404, 39.915); | ||
map.centerAndZoom(point, 15); | ||
map.disableDoubleClickZoom(true); | ||
|
||
// 编写自定义函数,创建标注 | ||
function addMarker(point,label){ | ||
var marker = new BMap.Marker(point); | ||
map.addOverlay(marker); | ||
marker.setLabel(label); | ||
} | ||
// 随机向地图添加25个标注 | ||
var bounds = map.getBounds(); | ||
var sw = bounds.getSouthWest(); | ||
var ne = bounds.getNorthEast(); | ||
var lngSpan = Math.abs(sw.lng - ne.lng); | ||
var latSpan = Math.abs(ne.lat - sw.lat); | ||
for (var i = 0; i < 10; i++) { | ||
var point = new BMap.Point(sw.lng + lngSpan * (Math.random() * 0.7), ne.lat - latSpan * (Math.random() * 0.7)); | ||
var label = new BMap.Label("我是id="+i,{offset:new BMap.Size(20,-10)}); | ||
addMarker(point,label); | ||
} | ||
function deletePoint(){ | ||
var allOverlay = map.getOverlays(); | ||
for (var i = 0; i < allOverlay.length -1; i++){ | ||
if(allOverlay[i].getLabel().content == "我是id=1"){ | ||
map.removeOverlay(allOverlay[i]); | ||
return false; | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters