Git Product home page Git Product logo

neighborhood_map's Introduction

Neighborhood Map - Supernatural

Part of the Udacity Front-End Web Development Nanodegree

Introduction

This is the Udacity Neighborhood Map Project. It's intended as a challenge to put together a SPA using Google Maps Javascript API along with third-party APIs.

This map displays some of the locations in Vancouver, BC where TV Series - Supernatural was shot.

Getting Started

  • Download or Clone this repo, replace demo key with your own Google Api key in config.js, and open index.html
  • Checkout Live version here

Preperation

  • Download Udacity provided Repo
  • Setup Google account and project to obtain API
  • Setup local server. (I used browser_sync. Help)
  • Learned and practiced KockoutJS framework on Pup Clicker
  • Reviewed project requirements
  • Collected data required for project
  • Implemented requirements as per project specifications

Project specifications completed

Interface

  • Responsive (complete)
  • Usability (complete)

Functionality

  • Map fullScreen Enabled
  • Toggle between Custom Map and Hybrid mapTypes
  • Filter locations using input field and error free
  • List view displays all locations and filtered subset locations
  • Map displays all locations by default and filtered subset locations
  • Markers animation and InfoWindow display when clicked on pin or list item
  • List functionality is responsive and error free

App Structure

  • Google Maps API loads asynchronously
  • Asychronous request from third-party API (Wikipedia)
  • Error handling (complete)
  • Application runs without an error

Location Details Functionality

  • Displays complete address of the location
  • Episode and Season information
  • Displays Panorama Image for device widths > 768px
  • Displays Static Street View image for width < 768px
  • Displays additional Wikipedia links for the location

Additional

  • Code minification (complete)
  • Comments to explain functionality
  • Code quality as per Udacity JS style guide (complete)

Deployment

  • Knockout handled list, filter, click event on list
  • Seprarate model function for Map marker, marker click events

Issues during deployment:

  • Error: Uncaught ReferenceError: google is not defined

    Solution: Script or Google Javascript API callback function, or any google.maps.* function is being called before Google Api. Any google function will not be defined until api request is made.

  • Issue: Multiple InfoWindows will open but content was displayed in the very InfoWindow that was open in the map

    Solution: Keep the variable global (var windowInfo), and put defination in ViewModel or callback function

  • Issue: After closing InfoWindow, it won't open again when clicked on list item or pin

    Solution: When used InfoWindow.close(), it removes the InfoWindow from the DOM, i.e. It set the value of global variable var windowInfo = null. We need to re-assign new google.maps.InfoWindow(); after calling close()

  • Deferred update: When I entered search term in the input bar, it would update map and list only when I enter second letter or second key press. This caused delay and asynchronous update rendering.

    Solution: I noticed that when following is used for computed observablearray - value: computedObservableArray, valueUpdate: 'afterkeydown' or 'keydown'. textInput is better approach to get update with computed observablearray. Source: Browser event quirks handling

  • Issue: With DOCTYPE HTML, Google Maps would disappear.

    Solution: Google Maps inherits height of the parent div. Doctype html set the height of body, html to 0. Setting body, html or the parent div of the Google Maps div to fied height resolved the issue. height: 100%;

Resources:

neighborhood_map's People

Contributors

nidhigaday avatar

Watchers

 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.