Java - Amap smooth movement problem
世界只因有你
世界只因有你 2017-05-16 13:24:24
0
1
545
    public void startMove() {
    LatLngBounds.Builder b = LatLngBounds.builder();
    for (int i = 0; i < latLngs.size(); i++) {
        b.include(latLngs.get(i));
    }
    LatLngBounds bounds = b.build();
    mAMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));

    // 取轨迹点的第一个点 作为 平滑移动的启动
    LatLng drivePoint = latLngs.get(0);
    Pair<Integer, LatLng> pair = SpatialRelationUtil.calShortestDistancePoint(latLngs, drivePoint);
    latLngs.set(pair.first, drivePoint);
    final List<LatLng> subList = latLngs.subList(pair.first, latLngs.size());

    // 设置轨迹点
    smoothMarker.setPoints(subList);
    // 设置平滑移动的总时间  单位  秒
    smoothMarker.setTotalDuration(100);
    // 开始移动
    smoothMarker.startSmoothMove();
    // 设置移动的监听事件  返回 距终点的距离  单位 米
    smoothMarker.setMoveListener(new SmoothMoveMarker.MoveListener() {
        @Override
        public void move(final double distance) {
            
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                
                }
            });

        }
    });
}

//
I need to implement the historical trajectory and display the running route. The line has been drawn. This is the method to start running.

这边需要同时显示速度,速度拿到全部点的速度的集合了,但是无法对应起来。
有没有什么解决方法可以到某个点的时候实时显示当前的速度的回调或者方法。
另求助实时获取经纬度后如何实时地图显示的方法。 高德地图
世界只因有你
世界只因有你

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!