GithubHelp home page GithubHelp logo

npl22 / map-my-jog Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 4.2 MB

MapMyRun clone, built using Rails and React/Redux

Home Page: https://www.mapmyjog.com

Ruby 42.84% JavaScript 35.91% CSS 13.12% HTML 7.15% CoffeeScript 0.98%
running runner walking hiking

map-my-jog's Introduction

MapMyJog

Link to live site

MapMyJog is full-stack web application clone of MapMyRun, using Ruby on Rails with a PostgreSQL database on the backend and React.js/Redux on the frontend. Users are able to map out running/walking/hiking routes and keep track of the total distance of the planned routes.

Features and implementation

Path creation

The core feature of this application is utilizing Google Maps APIs to mark and render running routes.

Route Creation

This map utilizes 3 APIs, the core Google Maps JavaScript API, the Directions Service API, and the Google Places Web Service API. Users can add markers to the map by clicking on it, and on each click, the app will get walking directions for the current route.

Some notable customizations this app uses for a smooth user experience are,

  1. Autozoom turned off
  2. Markers snap to nearest walkable path
  3. Search by location or get current location
  4. Custom markers and labels on map
  5. Cumulative distance-display for all route legs
initializeMap(initialPosition, zoom) {
  const mapOptions = {
    center: initialPosition,
    zoom
  };
  this.map = new google.maps.Map(document.getElementById('map'), mapOptions);
  this.route = new Route(this.map, this.setState.bind(this));

  this.addClickListener();
}

addClickListener() {
  this.map.addListener('click', e => {
    const lat = e.latLng.lat();
    const lng = e.latLng.lng();
    const waypoints = this.state.waypoints;
    this.setState({ waypoints: [...waypoints, { location: { lat, lng } }]});

    this.directions = this.route.getDirections(this.state.waypoints);
    if (this.directions) { this.directions.setMap(null); }
  });
}

Future Updates

Saving Routes/My Routes Page

The next update will allow users to save routes and view them on a user profile page. This will display a thumbnail of the route and the title. Clicking on a route will show a route detail page with a blown up version of the route in addition to some other information.

Going on Runs

Besides mapping and saving routes, I want users to be able to record runs as well. Users would record the specific route they ran and the time it took them to complete the route.

Dashboard/Statistics

A great feature to have on the user profile page would be a dashboard that keeps track of a user's running statistics. I think that the dashboard on MapMyRun and other running sites can be greatly improved.

map-my-jog's People

Contributors

npl22 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.