Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Boston's finest coffee, brought to you by Foursquare and Google Maps

License

Notifications You must be signed in to change notification settings

br3ndonland/udacity-fsnd-p5-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Udacity logo svg

Udacity Full Stack Web Developer Nanodegree program

Project 5. JavaScript Map

Brendon Smith

br3ndonland

license

JavaScript Style Guide

Table of Contents

Description

Boston's finest coffee, brought to you by Foursquare and Google Maps.

Screenshot of completed application

  • This is a single-page web application that displays "Boston's best beans," a list of specialty coffee shops in the Boston area. A GitHub Pages site is provided to run the application online. To run the application locally, simply clone or download the repository and open index.html in a web browser.
  • The Google Maps Platform is used to generate a map in index.html. A style selector allows the user to change the map style to suit their preferences.
  • The location list is retrieved from the Foursquare API using JavaScript with Fetch and async/await in index.js. Errors are handled with a try/catch block.
  • Clicking the hamburger icon ☰ in the header opens a side navigation menu with the list description and locations. Each location is linked with its corresponding map marker.
  • Clicking on a location, either in the side navigation menu or on the map marker, causes the marker to bounce, and opens an info window displaying data on the location from Foursquare.
  • Selecting a city from the dropdown menu filters the markers and location list by the selection. The markers are filtered by the Google Maps 'change' event listener, and the location list is filtered by toggling the CSS display: none class with viewModel.toggleList().
  • Babel provides browser back-compatibility.

Contents

Code

  • JavaScript:
    • JavaScript Standard Style
    • Two-space indentations, no semicolons.
    • Semicolons are syntactic clutter. Much like multivitamins, semicolons provide peace of mind while being of minimal utility. Omitting semicolons, and using ES6 features like template literals (similar to Python 3 string formatting), also allows me to easily switch between JavaScript and Python.
    • There is a StandardJS vscode extension available for linting and autoformatting.
  • HTML and CSS: Two-space indentations.
  • Markdown:
    • Markdown code style follows the suggestions for standardized Markdown formatting provided by markdownlint and Markdown Style Guide.
    • The vscode extension Markdown All in One is used to insert a Table of Contents after the corresponding h2.
    • Further syntactic standards:
      • Two space indentations.
      • Dashes for unordered lists.
      • The h1 first-level header is reserved for the title of the file and included on the first line, like # Title.
  • Code editor

(Back to top)