|
@@ -284,6 +284,13 @@
|
|
|
geolocation.getCurrentPosition(function(r){
|
|
|
// console.log(r);
|
|
|
_this.center = {lng: r.longitude, lat: r.latitude}; // 设置center属性值
|
|
|
+ console.log('_this.center',_this.origin);
|
|
|
+ if(_this.origin.latitude&&_this.origin.longitude){
|
|
|
+ _this.center = {lng: _this.origin.longitude, lat: _this.origin.latitude};
|
|
|
+ };
|
|
|
+ let Icon_0 = new BMap.Icon("static/zuobiao.gif", new BMap.Size(64, 64), {anchor: new BMap.Size(18, 32),imageSize: new BMap.Size(36, 36)});
|
|
|
+ let myMarker = new BMap.Marker(new BMap.Point(_this.origin.longitude, _this.origin.latitude),{icon: Icon_0});
|
|
|
+ map.addOverlay(myMarker);
|
|
|
_this.autoLocationPoint = {lng: r.longitude, lat: r.latitude}; // 自定义覆盖物
|
|
|
_this.initLocation = true;
|
|
|
},{enableHighAccuracy: true})
|