Git Product home page Git Product logo

android-smooth-move's Introduction

本工程为基于高德地图Android SDK进行封装,实现了点沿线平滑移动的效果。

前述

功能描述

基于3D地图SDK进行封装,实现了Marker点在线上进行平滑移动的例子。

效果图如下

Screenshot

扫一扫安装

Screenshot

使用方法

1:配置搭建AndroidSDK工程

2:实现方法

// 获取轨迹坐标点
List<LatLng> points = readLatLngs();
LatLngBounds bounds = new LatLngBounds(points.get(0), points.get(points.size() - 2));
mAMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 50));

SmoothMoveMarker smoothMarker = new SmoothMoveMarker(mAMap);
// 设置滑动的图标
smoothMarker.setDescriptor(BitmapDescriptorFactory.fromResource(R.drawable.icon_car));

LatLng drivePoint = points.get(0);
Pair<Integer, LatLng> pair = SpatialRelationUtil.calShortestDistancePoint(points, drivePoint);
points.set(pair.first, drivePoint);
List<LatLng> subList = points.subList(pair.first, points.size());

// 设置滑动的轨迹左边点
smoothMarker.setPoints(subList);
// 设置滑动的总时间
smoothMarker.setTotalDuration(40);
// 开始滑动
smoothMarker.startSmoothMove();

android-smooth-move's People

Contributors

mayan0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-smooth-move's Issues

buid.gradle问题

compile 'com.amap.api:map3d:latest.integration'
compile 'com.amap.api:map3d-native:latest.integration'

一直在编译,是不是没这个lib?

设置小车平移时间

怎么根据两点之间的距离远近,来设置小车平移的时间长短,好像没有开放的接口啊?

求救求救~遇到个困扰很多天的问题

想做类似微信 位置共享的功能

实时显示他人移动

我用 的是marker 上面显示头像 下面显示方向小蓝点

现在问题是 我想用InfoWindow显示其他人头像 但是InfoWindow只支持显示一个

然后我想把小蓝点和头像 都放在一个marker里面 但是这样的话 别人移动的话整个marker都会向前进方向倒 就无法保持头像在上面 下面小蓝点转了

纠结了很多天也没找到合适的方法 ..........

平滑移动的问题

  1. Marker不在视界内,并且没有设置 showInfoWindow() 的时候(此时 Marker 已经被移除了),Animation 就不会执行,这个问题最严重。。
  2. 无法停止 Marker 的 Animation,现在我只能再发起一个非常短的平移动画来干掉正在执行的动画,万不得已。。

setMoveListener 距离问题

明明轨迹已经播放完了 setMoveListener 中 剩余距离还是不为0 设置总时长 40秒 可能还没到40秒就播放完成了 请问这是怎么回事?难道是因为我坐标点的原因?

地图有点时候会出现白屏

操作步骤:模拟定时获取经纬度,然后根据获取到的经纬度画路线。
问题一:当获取出来的经纬度是重复的,地图就会现成白屏。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.