Industry case study: Data Eric Brumer 2/19/2014. Agenda Belltower Books Belltower Books Trucking: backend & frontend Google maps & javascript.

Slides:



Advertisements
Similar presentations
Google Fusion Tables API Inneke Ponet. Google Fusion Tables: Store, share, query and visualize data. API to run SQL-like queries applications that use.
Advertisements

Google Maps API. Today’s Objectives Get Google Maps working: desktop + mobile Get clustering data complete, data onto a map.
HTML 5 – GeoLocation and Maps. Geolocation API What is a ”geolocation”…? A geographical location, defined in terms of – Latitude (north/south) – Longitude.
HTML5 Demo ISYS 350. HTML 5 validation/#.UdytIOLn_zc validation/#.UdytIOLn_zc.
Google Maps API L. Grewe. Google Maps Largest Mapping API One of the most popular web services Used in many web “mashup” applications Used on many platforms.
Lines and Polygons Peterson. Simple Line function initialize() { var myLatLng = new google.maps.LatLng(5, -170); var myOptions = { zoom: 2, center: myLatLng,
Point Mashups Peterson. Icons Info Marker Random Points.
School location collector
CHAPTER 26 CREATING LOCATION-AWARE WEBPAGES USING GEOLOCATION.
11 Using the Google Maps API. 2 Objectives You will be able to Use the Google Maps API to display a map of any location on an HTML page. Programatically.
Camera Switch. Objective Able to operate briefly the timeline – Zoom in /out – Display different tracks – Display effects at various tracks Able to switch.
Session ID Presented by: Tom Jamate, University of Massachusetts, Amherst April 8, 2013 Session ID 2521 Going Beyond the Address Push-Pin Extending.
SJSU CS157B Dr. Lee1  2004 Jenny Mitchell Two Useful Tools You Can’t Live Without by Jenny Mitchell SJSU CS157B Section PHP and MySQL.
Writing All Your Code In OpenEdge Architect Peter van Dam.
BY LINDA MOHAISEN MIKE ZIELINSKI The Tree Census Project.
CHAP 4. GEOLOCATION API.  You can request users to share their location and, if they agree, you can provide them with instructions on how to get to a.
CS50 SECTION WEEK 9 Kenny Yu. Announcements  Problem Set 6 Returned.  Problem Set 8 Walkthrough up  Final Project’s Proposal due 11am Monday 11/14.
By: Simon Kleinsmith Supervisor: Mr Mehrdad Ghaziasgar Co-supervisor: Mr James Connan.
Set 11: Mashups (emphasis on Google tools) IT452 Advanced Web and Internet Systems.
Programming Games Recap on Google Maps. Creating elements. Dynamic creation of elements (multiple video elements). Geolocation. Classwork/Homework: Catch-up.
Campus Google Map Applications Copyright Robert Workman 2006 This work is the intellectual property of the author. Permission is granted for this material.
Programming games Examples: Audio example. Google Maps api. Classwork: show more complex video. Classwork/Homework: Find place (lat and long) for basic.
Google Maps API. Static Maps send an HTTP GET request receive an image (PNG, GIF, JPEG) no javascript needed encode params in URL example:
JavaScript Programming B.Ramamurthy 6/113/2014B. Ramamurthy CSE6511.
SHOPPING CARTS CHAPTER 19. E-COMMERCE Typically, an e-commerce site will have public pages and admin pages.
Programming Games Google Map API examples. CSS. Classwork/homework: Catch up. Upload work. Show your [more] complex Google Maps API example. Plan your.
Social Media Apps Programming Min-Yuh Day, Ph.D. Assistant Professor Department of Information Management Tamkang University
How data rule the world Kristoffer Benjaminsson CTO.
ECE 3553 Final Project by Brian Robl. What is Eventor? A simple, yet effective, website for event planning and searching.  Influence from Facebook Events.
Programming Games Reprise: storage, datatypes. Geolocation/Google API example. Work session Homework: [Catch up. Upload work. Post proposal.] Work on your.
Final Project By: Robert Tseng. Overview Portfolio Website Meant to share information about myself to anyone, from future employers to family. Features.
Finding online information on the library website Tutorial Nyenrode Library.
Bloomington’s Online Resources for Public Communication Laura Haley GIS Manager Information & Technology Services (ITS) City of Bloomington.
Q&A TGEL Group 3/2009. SelectorGadget
TerraFly Project High Performance Database Research CenterHigh Performance Database Research Center NASA Regional Applications CenterNASA Regional Applications.
TEXTBOOK TUESDAYS. Map Bookwork Questions 9/15 Why is understanding the Great Circle Route important for shipping and airline companies? What is the name.
Tallahassee, Florida, 2015 COP4710 Database Systems Project Overview Fall 2015.
Creating Interfaces Show form validation examples, Hangman. HTML5 with Google Maps API. Add in localStorage. Design pitfalls. Homework: Make proposal for.
Chapter 16: Ajax-Enabled Rich Internet Applications with XML and JSON TP2543 Web Programming Mohammad Faidzul Nasrudin.
14 Lines and Polygons Mapping in the Cloud Peterson.
Quiz 1 Review (Week 10) Sam Green ’17 (646)
Chapter 1 Introduction to PHP Part 1. Textbook’s Code DOWNLOADS PHP and MySQL for Dynamic Web Sites Complete Set of Scripts.
RIA Geo Location. Finding Location modern devices can get location coordinates phones and tablets can use GPS desktops and laptops –often cannot use GPS.
 May be times when we need calculations in a report. ◦ Total of how much a salesman has sold ◦ Report showing total inservice training hours an employee.
CONTACTING OTHER SERVERS.
Thematic Mapping with Google Maps. "US-KS":{code:"US-KS", name:"Kansas", center:{lat: ,lng: },
MAMADOU BALDE & EDWIN PADILLA DICKINSON COLLEGE DECEMBER 19, 2015 Peace Operations Toolkit Final Presentation.
JavaScript, Sixth Edition
Phonegap Bridge –Geolocation and Google maps CIS 136 Building Mobile Apps 1.
1 Using the Google Maps JavaScript API. 2 The Google Maps APIs Permit web applications to use functionality of google maps. Documentation:
Feb 2016 Subsidiaries & Distributors eMotion. Contents 01 How to create subsidiaries or distributors ? 02 What is the forms ? 03 How to publish ?
Creating Databases Example using Google Maps API + file creation. Dollar sign problem. Classwork/Homework: [catch up]. Work on final project.
Google Maps API. Contents: 1. Google Maps API Key 2. Create a Basic Google Map 3. Google Maps Overlays 4. Google Maps Events 5. Google Maps Controls 6.
1 Bus Tracker A Google Maps Application. 22 Objectives You will be able to Add an icon to a map created with the Google Maps API. Use Ajax techniques.
Development of Internet Application Web API Ing. Jan Janoušek 9.
Google APIs and Facebook API
Web Services application that operates over a network
By Dan Gotlund & Eric Acierto
Introduction to PHP Part 1
CHAPTER 9 APIS. CHAPTER 9 APIS WHAT IS AN API?
Tracking and Booking Taxi
B2C Online Store. B2C Online Store Group Members Introduction Name: Muhammad Gulfam VU ID: MC Program: MCS Supervisor: Muhammad Qamar Usman.
Geolocation using Google maps
JavaScript: Array, Loop, Data File
Google Maps: A Short How-to
Geolocation using Google maps
JavaScript Programming Labs
Web Programming Anselm Spoerri PhD (MIT) Rutgers University
Geolocation using Google maps
Presentation transcript:

Industry case study: Data Eric Brumer 2/19/2014

Agenda Belltower Books Belltower Books Trucking: backend & frontend Google maps & javascript

Textbook buyback company Founded in 2004 at Cornell University

Belltower Books Database PHP & javascript & MySQL 110 tables 105 million records Uses Website (appointments, online store, etc) Selling books (listing, picking, shipping) Data tracking (books bought, cash-in-hands) Report generation (audit, paychecks, etc)

Agenda Belltower Books Belltower Books trucking: backend & frontend Google maps & javascript

trucking_driver id name phone trucking_route id name driver_id start_date turned_in trucking_location id name type latitude longitude trucking_point id route_id location_id ordinal picked_up {0, “6250 S 228 th ”, “ups”, , } {1, “505 W State St”, “ups”, , } {2, “University of Washington”, “school”, , } … {0, “Eric’s first route”, 0, 1/1/2014, 1} {1, “Eric’s second route”, 0, 2/1/2014, 0} … {0, “Eric Brumer”, “ ”} {1, “Bert McClendon”, “ ”} …

Agenda Belltower Books Belltower Books trucking: backend & frontend Google maps & javascript

Google Maps Javascript API Useful as a reference var mapOptions = { zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var markerOptions = { position:..., map: map }; var marker = new google.maps.Marker(markerOptions); Otherwise kinda sucky

get_data.php webpage containing raw data $year = $_GET["year"]; $data2005 = array( array(name => "New York University", lat => , lng => ), array(name => "LeMoyne College", lat => , lng => ),... array(name => "American University", lat => , lng => ), array(name => "George Washington University", lat => , lng => ) ); $data2013 = array( array(name => "Hampshire College", lat => , lng => ), array(name => "University of Massachusetts", lat => , lng => ),... array(name => "Walla Walla University", lat => , lng => ), array(name => "Whitman College", lat => , lng => ) ); if ($year == "2005") { $ret = $data2005; } else if ($year == "2013") { $ret = $data2013; } else { $ret = array(); } echo json_encode($ret);

HTML Page Layout These buttons access another website asynchronously for data!

Javascript class representing a school marker function School(name, lat, lng) { this.name = name; // name of the school this.lat = lat; // latitude coordinate this.lng = lng; // longitude coordinate this.marker = null; // reference to google maps marker object } School.prototype.CreateMarker = function(map) {... hidden for now... } School.prototype.ClickMarker = function() { alert("clicked marker for " + this.name); this.ClearMarker(); } School.prototype.ClearMarker = function() {... hidden for now... } Global variables var globals = { map: null, schools: null, buttonCounter: 0 };

Functions called to add markers function add_markers(year) { // First, clear any markers on the existing map for (var schoolsIndex in globals.schools) { globals.schools[schoolsIndex].ClearMarker(); } globals.schools = Array(); globals.buttonCounter++; ajax_get(" + year, function(res) { var schools = JSON.parse(res); for (var schoolsIndex in schools) { add_marker(schools[schoolsIndex], schoolsIndex, globals.buttonCounter); } }); } function add_marker(school, delay, buttonCounter) { setTimeout(function() { if (globals.buttonCounter == buttonCounter) { var s = new School(school.name, school.lat, school.lng); s.CreateMarker(globals.map); globals.schools.push(s); } }, delay * 5); }

Function called when the page is ready function initialize() { var mapOptions = { zoom: 4, center: new google.maps.LatLng(38, -97), panControl: false, streetViewControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; globals.map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); globals.buttonCounter = 0; } google.maps.event.addDomListener(window, 'load', initialize);

School.prototype.CreateMarker = function(map) { // Create the marker var markerData = { position: new google.maps.LatLng(this.lat, this.lng), title: this.name, map: map }; this.marker = new google.maps.Marker(markerData); // Create a callback to a member function when clicked var thisSchool = this; google.maps.event.addListener(this.marker, "click", function() { thisSchool.ClickMarker(); }); } School.prototype.ClearMarker = function() { if (this.marker) { this.marker.setMap(null); } this.marker = null; }