Bladeren bron

增加 高德地图拖拽圆形或者marker

feat
JinxChen 2 jaren geleden
bovenliggende
commit
b0843a120d
1 gewijzigde bestanden met toevoegingen van 11 en 2 verwijderingen
  1. +11
    -2
      src/views/gaode-demo/PointInRing.vue

+ 11
- 2
src/views/gaode-demo/PointInRing.vue Bestand weergeven

@@ -203,8 +203,11 @@ export default {
// 创建圆形
createCircle() {
console.log("this.map.center", this.map.center);
if(this.currentCircle) {
this.map.instance.remove(this.currentCircle)
}
this.currentCircle = new AMap.Circle({
center: this.circlePolygon.center,
center: this.map.center.toString().split(','),
radius: this.circlePolygon.radius,
borderWeight: 3,
strokeColor: "red",
@@ -223,7 +226,12 @@ export default {
// 推拽圆
computeCircle() {
let point = this.currentCircle.getCenter();
this.circlePolygon.center = point;
//this.map.center = point;
if(this.map.marker) {
this.map.instance.remove(this.map.marker)
}
this.map.center = point.toString().split(',')
this.createMarker();
/* console.log("circleCenter", circleCenter); */
let polygonCircleListMap = this.polygonList.map(item => {
return {
@@ -251,6 +259,7 @@ export default {
computeMarker() {
let point = this.map.marker.getPosition();
this.map.center = point.toString().split(',');
this.createCircle();
/* console.log("circleCenter", circleCenter); */
let polygonCircleListMap = this.polygonList.map(item => {
return {


Laden…
Annuleren
Opslaan