Skip to content

OpenTransitTools-BonePile/transit-components

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vehicle Apps & Services:

Backport to React 15:

  1. cd transit-components
  2. git checkout master
  3. git pull
  4. scripts/co_rr_mod.sh -- for integration steps below - DO THIS BEFORE creating otp-rr branches, etc...
  5. scripts/make_new_dev_branch.sh
  6. grab package.json with the React 15.0 dependencies from another branch on github
  7. rm -rf node_modules yarn.lock build/*
  8. yarn install
  9. rewrite RotatedMarker.js (see earlier commits to R 15 branches)
  10. edit SelectVehicles.getLeafletContext() -- return this.conext
  11. edit SelectVehicles -- comment out import 'promise-polyfill/src/polyfill';
  12. edit SelectVehicles -- add leaflet={this.getLeafletContext()} to
  13. edit VehicleMarker.js --import nearestPointOnLine from 'turf-point-on-line'; import {point, lineString} from 'turf-helpers';
  14. edit MyWithLeaflet.js -- return clz;
  15. edit TransitMap.js -- remove locate control from map
  16. edit TransitMap.js -- remove layer switcher code from map
  17. yarn start -- is the map working?
  18. yarn build
  19. git commit -a -m "Backport to React 15"

Integrate Vehicles into MOD

I. initial otp-rr setup

  1. (make sure you ran run scripts/co_rr_mod.sh from above ... else you wont have latest code )
  2. cd ../otp-react-redux/
  3. rm -rf build dist node_modules yarn.lock
  4. yarn install
  5. (see line below) have a valid config.yml in the directory
  6. cp ../transit-components/lib/common/config.yml .
  7. yarn start -- is the map working?

II. add vehicles

  1. edit package.json -- add dependency to OpenTransitTools/transit-components#

    "transit-components": "github:OpenTransitTools/transit-components#vehicles-08_08_2019",

  2. yarn install -- should now see ls ./node_modules/transit-components

  3. edit lib/components/map/default-map.js (line ~45)

    import {SelectVehicles} from 'transit-components';

    case 'vehicles': return <SelectVehicles visible={false} key={k} {...overlayConfig} />; add to switch statement on line ~45.

  4. edit lib/components/map/map.css (and example.css) to add vehicle.css content

  5. cp ../trimet-mod-otp/lib/config.yml .

  6. yarn start -- is the otp-rr map working w/vehicles now?

III. ready trimet-mod-otp

  1. still within otp-rr project repo...

  2. edit package.json add "version": "0.1.0",

  3. rm -rf build dist

  4. yarn prepublish

  5. yarn build

  6. git status

  7. git add -f build/* dist/*

  8. git commit -a -m "add build (.js) & dist (.css) dirs + vehicles to OTP-RR"

  9. git push

  10. cd ../trimet-mod-otp/

  11. rm -rf node_modules yarn.lock dist

  12. edit package.json -- add OTP-RR dependency to TriMetPDX github version "otp-react-redux": "github:TriMetPDX/otp-react-redux#vehicles-08_07_2019",

  13. yarn install

  14. (see line below) add config.yml to ./lib/

  15. cp ../transit-components/lib/common/config.yml ./lib/

  16. yarn start -- is the app showing rt vehicles now?

  17. yarn build

  18. scp lib/config.yml dist/* mod@server:~/public/map/

TODO Items:

  1. refactor -- Component Library best practices / etc...
  2. show layer via url param on load
  3. click on line, open popup (what to show? open tracked vehicle stop popup?)
  4. see PaulLeCam/react-leaflet#317 for popus
  5. interpolated vehicle position -- Streetcar / estimated position vs. RT
  6. add overlays (routes / patterns / stops)
  7. add search
  8. add route list - select routes to show vehicles
  9. localize
  10. make a pan control
  11. clean up the control stuff below: more dynamic (layer names & number button from .yml), option to put it in layer switcher or as buttons, etc...
  12. cleanup

FYI:

git update-index --assume-unchanged yarn.lock

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published