113.314882,23.163055 113.355845,23.167042 113.370289,23.149564 113.356779,23.129758 113.338238,23.13913 113.330979,23.124706 113.313588,23.140858 113.323865,23.158204 113.314882,23.163055
<!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 {height:100%; width: 100%;}
#control{width:100%;}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=您的密钥"></script>
<title>设置线、面可编辑</title>
</head>
<body>
<div id="allmap"></div>
<div id="control">
<button onclick = "polyline.enableEditing();polygon.enableEditing();">开启线、面编辑功能</button>
<button onclick = "polyline.disableEditing();polygon.disableEditing();">关闭线、面编辑功能</button>
</div>
</body>
</html>
<script type="text/javascript">
// 百度地图API功能
var map = new BMap.Map("allmap");
map.centerAndZoom(new BMap.Point(113.330764,23.155878), 15);
map.enableScrollWheelZoom();
var polygon = new BMap.Polygon([
new BMap.Point(113.314882,23.163055),
new BMap.Point(113.355845,23.167042),
new BMap.Point(113.370289,23.149564),
new BMap.Point(113.356779,23.129758),
new BMap.Point(113.338238,23.13913),
new BMap.Point(113.330979,23.124706),
new BMap.Point(113.313588,23.140858),
new BMap.Point(113.323865,23.158204)
], {strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); //创建多边形
map.addOverlay(polygon); //增加多边形
</script>
use testdb;
db.createUser(
{
"user":"root",
"pwd":"123456",
"roles":[{"role" : "readWrite", "db":"testdb"}]
}
);
db.auth(
{
"user":"root",
"pwd":"123456"
}
);
db.geo.ensureIndex(
{
polygons: "2dsphere"
}
);
db.geo.insert(
{
polygons:
{
type:"Polygon",
coordinates:[[
[113.314882,23.163055],
[113.355845,23.167042],
[113.370289,23.149564],
[113.356779,23.129758],
[113.338238,23.13913],
[113.330979,23.124706],
[113.313588,23.140858],
[113.323865,23.158204],
[113.314882,23.163055],
]]
}
}
);
db.geo.find(
{
polygons:
{
$geoIntersects:
{
$geometry:{
"type" : "Point",
"coordinates" : [113.330908,23.155678] }
}
}
}
);
{ "_id" : ObjectId("57c2b1895fb7fd4790f9f099"), "polygons" : { "type" : "Polygon", "coordinates" : [ [ [ 113.314882, 23.163055 ], [ 113.355845, 23.167042 ], [ 113.370289, 23.149564 ], [ 113.356779, 23.129758 ], [ 113.338238, 23.13913 ], [ 113.330979, 23.124706 ], [ 113.313588, 23.140858 ], [ 113.323865, 23.158204 ], [ 113.314882, 23.163055 ] ] ] } }
db.geo.find(
{
polygons:
{
$geoIntersects:
{
$geometry:{
"type" : "Point",
"coordinates" : [113.33831,23.137335] }
}
}
}
);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有