All Projects → amalChandran → Trail Android

amalChandran / Trail Android

Licence: mit
🚕 Simple, smooth animation for route / polylines on google maps using projections.

Programming Languages

java
68154 projects - #9 most used programming language
arc
50 projects

Projects that are alternatives of or similar to Trail Android

Dual-color-Polyline-Animation
This library will help to show the polyline in dual color similar as Uber.
Stars: ✭ 73 (-84.3%)
Mutual labels:  uber, google-maps
Konfetti
Celebrate more with this lightweight confetti particle system 🎊
Stars: ✭ 2,278 (+389.89%)
Mutual labels:  animations, canvas
Scrawl Canvas
Responsive, integrated and interactive HTML5 canvas elements. Scrawl-canvas is a JavaScript library designed to make using the HTML5 canvas element a bit easier, and a bit more fun!
Stars: ✭ 134 (-71.18%)
Mutual labels:  animations, canvas
Ubercaranimation
A demo app showing movement of car on map like in Uber.
Stars: ✭ 643 (+38.28%)
Mutual labels:  uber, animations
Airbnb Android Google Map View
This is a sample Android Application which has Google Map view similar to what AirBnb Android Application. Moving Markers like Uber/Ola. Custom Google Search for places. Recycler view with Animations added.
Stars: ✭ 175 (-62.37%)
Mutual labels:  uber, google-maps
Arcarmovement
This is navigation example on google map. Here Marker move as vehicles moves with turns as uber does in their app. Using old and new coordinates animating bearing value the markers are moving.
Stars: ✭ 137 (-70.54%)
Mutual labels:  uber, google-maps
Heatmap.js
🔥 JavaScript Library for HTML5 canvas based heatmaps
Stars: ✭ 5,685 (+1122.58%)
Mutual labels:  google-maps, canvas
SSComposeCookBook
A Collection of major Jetpack compose UI components which are commonly used.🎉🔝👌
Stars: ✭ 386 (-16.99%)
Mutual labels:  google-maps, animations
EasyWayLocation
This library contain all utils related to google location. like, getting lat or long, Address and Location Setting dialog, many more...
Stars: ✭ 142 (-69.46%)
Mutual labels:  uber, google-maps
Pixelcraft
A Pixel Art Editor
Stars: ✭ 413 (-11.18%)
Mutual labels:  canvas
Lena.js
👩 Library for image processing
Stars: ✭ 432 (-7.1%)
Mutual labels:  canvas
React Canvas Draw
React Component for drawing in canvas
Stars: ✭ 412 (-11.4%)
Mutual labels:  canvas
Ipycanvas
Interactive Canvas in Jupyter
Stars: ✭ 416 (-10.54%)
Mutual labels:  canvas
Zerker
Zerker is a lightweight and powerful flutter graphic animation library
Stars: ✭ 435 (-6.45%)
Mutual labels:  canvas
Sbnet
Sparse Blocks Networks
Stars: ✭ 414 (-10.97%)
Mutual labels:  uber
Videobeautify
With this APP, you can do all kinds of professional optimising and beautifying to your videos
Stars: ✭ 450 (-3.23%)
Mutual labels:  animations
Planck.js
2D JavaScript Physics Engine
Stars: ✭ 4,149 (+792.26%)
Mutual labels:  canvas
Tui.image Editor
🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
Stars: ✭ 4,761 (+923.87%)
Mutual labels:  canvas
Animatelo
Animatelo is a bunch of cool, fun, and cross-browser animations for you to use in your projects. This is a porting to Web Animation API of the fabulous animate.css project.
Stars: ✭ 453 (-2.58%)
Mutual labels:  animations
Hero
Elegant transition library for iOS & tvOS
Stars: ✭ 20,547 (+4318.71%)
Mutual labels:  animations

Smooth route animation over Google maps. Uses projection from Google maps to draw a route on an overlay layout. Can add multiple routes with different sytles while supporting pan and zoom of maps.

Build Status Android Arsenal License: MIT

(Gif running @ 10fps. Check the video on youtube.)


Overlay polyline

Marker and polyline

With zoom

Setup

  1. Add jitpack to the root build.gradle file of your project at the end of repositories.
allprojects {
    repositories {
      ...
      maven { url 'https://jitpack.io' }
    }
}
  1. Add the dependency
implementation 'com.github.amalChandran:trail-android:v1.51'

Usage

Place RouteOverlayView over your google map layout in xml. Make sure that the routeoverlayview covers the map completely. This is the view in which the routes will be drawn.

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent">
  <fragment
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:name="com.google.android.gms.maps.SupportMapFragment"/>
  <com.amalbit.trail.RouteOverlayView
    android:id="@+id/mapOverlayView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
</FrameLayout>

In your activity, create routes with three predefined styles as of now.

googleMap.setOnMapLoadedCallback(() -> {
    Route normalOverlayPolyline = new Route.Builder(mRouteOverlayView)
        .setRouteType(RouteType.PATH)
        .setCameraPosition(mMap.getCameraPosition())
        .setProjection(mMap.getProjection())
        .setLatLngs(mRoute)
        .setBottomLayerColor(Color.YELLOW)
        .setTopLayerColor(Color.RED)
        .create();

To make sure that the overlay moves along with the Google maps movement we need to add a hook from its cameramovelistener.

googleMap.setOnCameraMoveListener(() -> {
      mRouteOverlayView.onCameraMove(googleMap.getProjection(), googleMap.getCameraPosition());
    }
);

Library uses java 8 bytecode, so dont forget to enable java 8 in your application's build.gradle file.

android {
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

License

MIT © Amal Chandran

Logo

Jibin Joseph

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].