【问题标题】:How can I rotate marker with smooth animation in ionic 3?如何在 ionic 3 中使用平滑动画旋转标记?
【发布时间】:2018-06-11 07:09:27
【问题描述】:

如何在 Google 地图中旋转带有动画的标记?以下是我的代码 sn-p。我正在使用ionic native google map 插件。

moveMarker() {
let prevLat = new LatLng(this.prevPosition[0], this.prevPosition[1]);
this.prevPosition[0] += this.deltaLat;
this.prevPosition[1] += this.deltaLng;
let latlng = new LatLng(this.prevPosition[0], this.prevPosition[1]);
let heading = Spherical.computeHeading(prevLat, latlng);
this.marker.setRotation(heading);
this.marker.setPosition(latlng);

if (this.i != this.numDeltas) {
  this.i++;
  setTimeout(this.moveMarker(), this.delay);
 }
}

【问题讨论】:

    标签: javascript angular google-maps ionic3


    【解决方案1】:

    我认为This 可能会对你有所帮助。

    通过将距离分成块来平滑移动标记

    【讨论】:

      猜你喜欢
      • 2013-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-21
      • 2013-08-02
      • 2019-03-11
      • 2015-12-26
      • 1970-01-01
      相关资源
      最近更新 更多