Coder Social home page Coder Social logo

transit-vehicle-overlay-1448's Introduction

WHAT:

Presentational React Components used to build an interactive vehicle map (leaflet) overlay. This component uses functional components and hooks (no more class components).

NOTE: eventually want this component (and OTP-UI in general) to support both leaflet and mapbox gl libraries.

HOW:

There is a type format for RT vehicle data in OTP-UI: https://github.com/opentripplanner/otp-ui/blob/master/packages/core-utils/src/types.js#L54

This format was derived in this project to accord with a companion web service that delivers realtime vehicle information information, based on GTFS-Realtime data (https://github.com/OpenTransitTools/gtfsdb_realtime/blob/master/ott/gtfsdb_realtime/model/response/vehicle_list.py).

Other realtime vehicle data may be used with this layer. For example, there is demo code within the component that shows converting another service response format (https://developer.trimet.org/ws_docs/vehicle_locations_ws.shtml) to work with this layer.

NOTES:

  • The use of hooks was a good thing, but there's a bit of resulting redirection (HL functions, etc...) in the component lib (and interface) which obfuscates things a bit ... apologies in advance.
  • 2 very useful utilities for converting .svg to React svg .js files:

TODO:

  1. more / better unit tests
  2. mapbox gl

transit-vehicle-overlay-1448's People

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.