nycsubway

package module
v0.0.0-...-17a6593 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

README

NOTE: This codelab is deprecated. For similar functionality, use the Full stack store loccator codelab instead.

NYC Subway Station Locator

These are the resource files needed for the NYC Subway Station Locator code lab from Google.

Introduction for the NYC Subway Station Locator codelab

Store locators are an often required component of any commercial website that wants to encourage users to visit bricks and mortar stores. In this codelab you’ll build a website that serves location data, and scales automatically, thanks to the power of Google App Engine. We show you how to expose an easily navigable visualization of the NYC subway using Google Maps JavaScript API.

What you'll build

In this codelab, you'll build a visualization for the NYC Subway Station dataset that is:

  • Scalable - you’ll use Google App Engine to automatically scale your serving capability to match request load.
  • Maintainable - you’ll use the Go programming language to make the back end code simple, reliable, and efficient.
  • Customizable - you’ll style the map using the styling capability of the Google Maps JavaScript API, with the help of Google Maps Style Wizard.

What you’ll learn

What you’ll need

  • Basic knowledge of HTML, CSS, JavaScript, Golang, and Chrome DevTools
  • An ES6 capable web browser, such as Chrome, Firefox, Safari, or Edge.

Documentation

Index

Constants

View Source
const EarthRadius = 6378.137

EarthRadius is a rough estimate of earth's radius in km at latitude 0 if earth was a perfect sphere.

Variables

View Source
var GeoJSON = make(map[string][]byte)

GeoJSON is a cache of the NYC Subway Station and Line data.

View Source
var Stations = rtree.NewTree(2, 25, 50)

Stations is an RTree housing the stations

Functions

This section is empty.

Types

type Station

type Station struct {
	// contains filtered or unexported fields
}

Station is a wrapper for `*geojson.Feature` so that we can implement `rtree.Spatial` interface type.

func (*Station) Bounds

func (s *Station) Bounds() *rtree.Rect

Bounds implements `rtree.Spatial` so we can load stations into an `rtree.Rtree`.

func (*Station) Point

func (s *Station) Point() cluster.Point

Point enables clustering over `Station`s.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL