有些公司或者工地,不满足在地图上画圆,希望自己框个范围,来判定打卡。
生成geojson工具:geojson.io | powered by Mapbox
将画不规则图形生成geojson后,展示地图上,并判断当前gps定位坐标是否在图形内。
//获得geojson加上gps的坐标点
GeojsonObj.features.push({
"type": "Feature",
"properties": {
opacity: 1,
r: 6,
fill: "rgba(0, 89, 238, 1)",
color: "rgba(0, 89, 238, 0.6)",
"stroke-width": 1,
// "marker-url":"/img/yuan.svg",
// name:"LD"
},
"geometr