SlideShare a Scribd company logo
1 of 7
Download to read offline
JavaScript
In this project you will create an interactive map for a cycling club in Boulder, Colorado,
allowing cyclists to view a map with directions between two popular cycling destinations. To
complete this project, you will need to set up a Google Cloud account along with an API key to
access the Google Maps, Directions Service, and Directions Renderer APIs. A preview of the
completed page is shown in Figure 10-42.
Do the following:
1. Use your code editor to open the project10-03_txt.html and project10-03_txt.js files from the
js10 c
project03 folder. Enter your name and the date in the comment section of each file and save them
as
project10-03.html and project10-03.js, respectively.
2. Go to the project10-03.html file in your code editor. Add a script element linked to the
project10-03js file.
Defer the loading of the script until after the page is loaded.
3. Add another script element with the following src attribute:
https://maps.googleapis.com/maps/
api/js?key=key&callback=showMap where key is your Google Maps API key. Also defer this
script until
after the page is loaded.
4. Close the file, saving your changes and then go to the project10-03.js file in your code editor.
Steps 5
through 10 should all be down within the showMap() function. Several variables have already
been
declared for you.
5. Use the new google.maps.DirectionsService() object constructor to create a DirectionsService
object named bikeFind.
6. Use the new google.maps.DirectionsRenderer() object constructor to create a
DirectionsRenderer object named bikeDraw.
7. Create a LatLng object named Boulder storing within it a latitude of 40.01753 and a longitude
of
-105.26496.
8. Use the new google.maps.Map() object constructor to instantiate a new Google map named
myMap. Set the
zoom level to 12 and center the map on Boulder.
9. Create event listeners for the startingPoint and endingPoint selection lists, running the
drawRoute()
function in response to the change event.
10. Create the drawRoute() function. Within the function insert an if statement that tests whether
the selected index for the startingPoint and endingPoint selection lists are both not equal to 0. If
true, then do the
following:
a. Define a route object named bikeRoute with an origin at startingPoint.value and a destination
at
endingPoint.value. Set the travelMode option to BICYCLING.
b. Apply the route() method to the bikeFind object generating directions between the starting and
ending
points. If the status of the request is OK then (i) apply the setDirections() method to bikeDraw
object request directions from the directions service, (ii) apply the setMap() method to bikeDraw
to
display the route within myMap, and (iii) apply the setPanel() method to bikeDraw to display the
turnby-turn directions within the bikeDirections object. If the status is not OK then change the
text content of the bikeDirections object to Directions
Unavailable: status.
11. Save your changes to the file and then load project10-03.html in your browser. Verify that a
map of Boulder,Colorado appears in the left box. Verify that when you select starting and ending
points from the two list boxes,a route is drawn on the map and turn-by-turn directions are
provided between the two points.
Filename: project10-3.html
Hands-on Project 10-3
Hands-on Project 10-3
Boulder Cycling Routes
Choose an origin and a destination of your cycling outingStarting PointFolsom FieldNCAREben
G. Fine ParkEldorado SpringsValmont Bike ParkKossler LakeRocky FlatsFoothills
ParkJamestownEnding PointFolsom FieldNCAREben G. Fine ParkEldorado SpringsValmont
Bike ParkKossler LakeRocky FlatsFoothills ParkJamestown
--------------------------------------------------------------------------------------------
Filename: project10-03.js
"use strict";
/* JavaScript 7th Edition
Chapter 10
Project 10-03
Boulder Cycling Directions
Author:
Date:
Filename: project10-03.js
*/
function showMap() {
// Page objects
let bikeMap = document.getElementById("bikeMap");
let bikeDirections = document.getElementById("bikeDirections");
let startingPoint = document.getElementById("startingPoint");
let endingPoint = document.getElementById("endingPoint");
}
--------------------------------------------------------------
Filename: styles.css
/* JavaScript 7th Edition
Chapter 10
Hands-on Project 10-3
Style sheet Boulder Cycling Directions
Filename: styles.css
*/
/* apply a natural box layout model to all elements */
* {
box-sizing: border-box;
}
/* reset rules */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
width: 1024px;
background: #F5F5F5;
margin: 0 auto;
font-family: Georgia, "Droid Serif", serif;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
body {
line-height: 1;
width: 960px;
background: white;
margin: 0 auto;
font-family: Verdana, Geneva, sans-serif;
}
ol, ul {
list-style: none;
}
/* page header */
header {
background: #5472B2;
width: 100%;
color: #FFFFFF;
font-size: 48px;
text-align: center;
line-height: 1.5em;
margin-bottom: 0;
}
/*-------------------- Project Styles ------------------*/
section {
background-color: #FFDB70;
margin-top: 0;
padding-bottom: 20px;
user-select:none;
height: 640px;
}
section h1 {
font-size: 2.8em;
text-align: center;
margin: 0;
padding: 20px 0 10px 0;
}
section p {
width: 800px;
margin: 0 auto;
font-size: 1.2em;
line-height: 1.3;
text-align: center;
}
fieldset {
width: 90%;
margin: 10px auto;
position: relative;
display: block;
height: 185px;
}
fieldset select#startingPoint {
position: absolute;
top: 0;
left: 220px;
width: 180px;
}
fieldset select#endingPoint {
position: absolute;
top: 0;
left: 460px;
width: 180px;
}
div#bikeMap {
width: 400px;
height: 300px;
border: 3px solid gray;
margin: 0 15px 0 70px;
float: left;
}
div#bikeDirections {
width: 400px;
height: 300px;
border: 3px solid gray;
margin: 0 30px 0 0;
float: left;
overflow: scroll;
}
select option:first-of-type {
font-size: 1.3em;
padding-bottom: 5px;
font-weight: bold;
} Boulder Cycling Routes Figure 10-42 Completed Project 10-3

More Related Content

Similar to JavaScriptIn this project you will create an interactive map for a.pdf

Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerKaty Slemon
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
 
RESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsRESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsSven Wolfermann
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'sAntônio Roberto Silva
 
Using SharePoint's Geolocation Field - SPSUK 2014
Using SharePoint's Geolocation Field - SPSUK 2014Using SharePoint's Geolocation Field - SPSUK 2014
Using SharePoint's Geolocation Field - SPSUK 2014Mark Stokes
 
How to Build Dynamic Forms in Angular Directive with a Backend
How to Build Dynamic Forms in Angular Directive with a BackendHow to Build Dynamic Forms in Angular Directive with a Backend
How to Build Dynamic Forms in Angular Directive with a BackendBackand Cohen
 
CCK For Code Junkies
CCK For Code JunkiesCCK For Code Junkies
CCK For Code JunkiesGeoff Maxey
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Matt Raible
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Matt Raible
 
Dynamic_UI_Concepts_version_2.pdf
Dynamic_UI_Concepts_version_2.pdfDynamic_UI_Concepts_version_2.pdf
Dynamic_UI_Concepts_version_2.pdfJoeRodriguez477329
 
Warsaw Frontend Meetup #1 - Webpack
Warsaw Frontend Meetup #1 - WebpackWarsaw Frontend Meetup #1 - Webpack
Warsaw Frontend Meetup #1 - WebpackRadosław Rosłaniec
 
Designing REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDesigning REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDmitriy Sobko
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratiqueSimon Morvan
 
Workshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJSWorkshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJSVisual Engineering
 
A Gentle Introduction to Angular Schematics - Angular SF 2019
A Gentle Introduction to Angular Schematics - Angular SF 2019A Gentle Introduction to Angular Schematics - Angular SF 2019
A Gentle Introduction to Angular Schematics - Angular SF 2019Matt Raible
 
AngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPIAngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPIEric Wise
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworksEric Guo
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
Top 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptxTop 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptxBOSC Tech Labs
 

Similar to JavaScriptIn this project you will create an interactive map for a.pdf (20)

Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue router
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJS
 
RESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsRESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side Components
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Using SharePoint's Geolocation Field - SPSUK 2014
Using SharePoint's Geolocation Field - SPSUK 2014Using SharePoint's Geolocation Field - SPSUK 2014
Using SharePoint's Geolocation Field - SPSUK 2014
 
How to Build Dynamic Forms in Angular Directive with a Backend
How to Build Dynamic Forms in Angular Directive with a BackendHow to Build Dynamic Forms in Angular Directive with a Backend
How to Build Dynamic Forms in Angular Directive with a Backend
 
CCK For Code Junkies
CCK For Code JunkiesCCK For Code Junkies
CCK For Code Junkies
 
Modern android development
Modern android developmentModern android development
Modern android development
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020
 
Dynamic_UI_Concepts_version_2.pdf
Dynamic_UI_Concepts_version_2.pdfDynamic_UI_Concepts_version_2.pdf
Dynamic_UI_Concepts_version_2.pdf
 
Warsaw Frontend Meetup #1 - Webpack
Warsaw Frontend Meetup #1 - WebpackWarsaw Frontend Meetup #1 - Webpack
Warsaw Frontend Meetup #1 - Webpack
 
Designing REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDesigning REST API automation tests in Kotlin
Designing REST API automation tests in Kotlin
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratique
 
Workshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJSWorkshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJS
 
A Gentle Introduction to Angular Schematics - Angular SF 2019
A Gentle Introduction to Angular Schematics - Angular SF 2019A Gentle Introduction to Angular Schematics - Angular SF 2019
A Gentle Introduction to Angular Schematics - Angular SF 2019
 
AngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPIAngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPI
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworks
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Top 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptxTop 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptx
 

More from sanjeevbansal1970

In the year 3000, engineers at MIT finally created the technology ne.pdf
In the year 3000, engineers at MIT finally created the technology ne.pdfIn the year 3000, engineers at MIT finally created the technology ne.pdf
In the year 3000, engineers at MIT finally created the technology ne.pdfsanjeevbansal1970
 
In the context of fraud explain the differences between (1) incentiv.pdf
In the context of fraud explain the differences between (1) incentiv.pdfIn the context of fraud explain the differences between (1) incentiv.pdf
In the context of fraud explain the differences between (1) incentiv.pdfsanjeevbansal1970
 
In the article liars dont qualify by Junius Edwards, What does the .pdf
In the article liars dont qualify by Junius Edwards, What does the .pdfIn the article liars dont qualify by Junius Edwards, What does the .pdf
In the article liars dont qualify by Junius Edwards, What does the .pdfsanjeevbansal1970
 
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdfIn PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdfsanjeevbansal1970
 
In the early 1970s, the US economy experienced a strong increase in.pdf
In the early 1970s, the US economy experienced a strong increase in.pdfIn the early 1970s, the US economy experienced a strong increase in.pdf
In the early 1970s, the US economy experienced a strong increase in.pdfsanjeevbansal1970
 
In the context of crystallization of monazite in a silicate melt, La.pdf
In the context of crystallization of monazite in a silicate melt, La.pdfIn the context of crystallization of monazite in a silicate melt, La.pdf
In the context of crystallization of monazite in a silicate melt, La.pdfsanjeevbansal1970
 
in the article liars dont qualify, y Junius Edwards, What does the .pdf
in the article liars dont qualify, y Junius Edwards, What does the .pdfin the article liars dont qualify, y Junius Edwards, What does the .pdf
in the article liars dont qualify, y Junius Edwards, What does the .pdfsanjeevbansal1970
 
In which of the following ways can you not use a subquery in a SELEC.pdf
In which of the following ways can you not use a subquery in a SELEC.pdfIn which of the following ways can you not use a subquery in a SELEC.pdf
In which of the following ways can you not use a subquery in a SELEC.pdfsanjeevbansal1970
 
In the Government of Canada, individuals within departments to whom .pdf
In the Government of Canada, individuals within departments to whom .pdfIn the Government of Canada, individuals within departments to whom .pdf
In the Government of Canada, individuals within departments to whom .pdfsanjeevbansal1970
 
In Xcode, Using decomposition, type the code that will most efficien.pdf
In Xcode, Using decomposition, type the code that will most efficien.pdfIn Xcode, Using decomposition, type the code that will most efficien.pdf
In Xcode, Using decomposition, type the code that will most efficien.pdfsanjeevbansal1970
 
In the article liars dont qualify by Junius Edwards, What is the pu.pdf
In the article liars dont qualify by Junius Edwards, What is the pu.pdfIn the article liars dont qualify by Junius Edwards, What is the pu.pdf
In the article liars dont qualify by Junius Edwards, What is the pu.pdfsanjeevbansal1970
 
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdfJohn y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdfsanjeevbansal1970
 
John is a minor who lives with his mother and stepfather and not his.pdf
John is a minor who lives with his mother and stepfather and not his.pdfJohn is a minor who lives with his mother and stepfather and not his.pdf
John is a minor who lives with his mother and stepfather and not his.pdfsanjeevbansal1970
 
John and Sara are married and live in AZ. They do not have a prenup.pdf
John and Sara are married and live in AZ.  They do not have a prenup.pdfJohn and Sara are married and live in AZ.  They do not have a prenup.pdf
John and Sara are married and live in AZ. They do not have a prenup.pdfsanjeevbansal1970
 
In Visual Studios C# console app using multiple class files create a.pdf
In Visual Studios C# console app using multiple class files create a.pdfIn Visual Studios C# console app using multiple class files create a.pdf
In Visual Studios C# console app using multiple class files create a.pdfsanjeevbansal1970
 
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdfJoel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdfsanjeevbansal1970
 
Jin has configured File History on his Windows 10 computer using an .pdf
Jin has configured File History on his Windows 10 computer using an .pdfJin has configured File History on his Windows 10 computer using an .pdf
Jin has configured File History on his Windows 10 computer using an .pdfsanjeevbansal1970
 
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdfJJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdfsanjeevbansal1970
 
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdfJim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdfsanjeevbansal1970
 
Jean has her first child at age 14. By the time she is 30, she has f.pdf
Jean has her first child at age 14. By the time she is 30, she has f.pdfJean has her first child at age 14. By the time she is 30, she has f.pdf
Jean has her first child at age 14. By the time she is 30, she has f.pdfsanjeevbansal1970
 

More from sanjeevbansal1970 (20)

In the year 3000, engineers at MIT finally created the technology ne.pdf
In the year 3000, engineers at MIT finally created the technology ne.pdfIn the year 3000, engineers at MIT finally created the technology ne.pdf
In the year 3000, engineers at MIT finally created the technology ne.pdf
 
In the context of fraud explain the differences between (1) incentiv.pdf
In the context of fraud explain the differences between (1) incentiv.pdfIn the context of fraud explain the differences between (1) incentiv.pdf
In the context of fraud explain the differences between (1) incentiv.pdf
 
In the article liars dont qualify by Junius Edwards, What does the .pdf
In the article liars dont qualify by Junius Edwards, What does the .pdfIn the article liars dont qualify by Junius Edwards, What does the .pdf
In the article liars dont qualify by Junius Edwards, What does the .pdf
 
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdfIn PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
 
In the early 1970s, the US economy experienced a strong increase in.pdf
In the early 1970s, the US economy experienced a strong increase in.pdfIn the early 1970s, the US economy experienced a strong increase in.pdf
In the early 1970s, the US economy experienced a strong increase in.pdf
 
In the context of crystallization of monazite in a silicate melt, La.pdf
In the context of crystallization of monazite in a silicate melt, La.pdfIn the context of crystallization of monazite in a silicate melt, La.pdf
In the context of crystallization of monazite in a silicate melt, La.pdf
 
in the article liars dont qualify, y Junius Edwards, What does the .pdf
in the article liars dont qualify, y Junius Edwards, What does the .pdfin the article liars dont qualify, y Junius Edwards, What does the .pdf
in the article liars dont qualify, y Junius Edwards, What does the .pdf
 
In which of the following ways can you not use a subquery in a SELEC.pdf
In which of the following ways can you not use a subquery in a SELEC.pdfIn which of the following ways can you not use a subquery in a SELEC.pdf
In which of the following ways can you not use a subquery in a SELEC.pdf
 
In the Government of Canada, individuals within departments to whom .pdf
In the Government of Canada, individuals within departments to whom .pdfIn the Government of Canada, individuals within departments to whom .pdf
In the Government of Canada, individuals within departments to whom .pdf
 
In Xcode, Using decomposition, type the code that will most efficien.pdf
In Xcode, Using decomposition, type the code that will most efficien.pdfIn Xcode, Using decomposition, type the code that will most efficien.pdf
In Xcode, Using decomposition, type the code that will most efficien.pdf
 
In the article liars dont qualify by Junius Edwards, What is the pu.pdf
In the article liars dont qualify by Junius Edwards, What is the pu.pdfIn the article liars dont qualify by Junius Edwards, What is the pu.pdf
In the article liars dont qualify by Junius Edwards, What is the pu.pdf
 
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdfJohn y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
 
John is a minor who lives with his mother and stepfather and not his.pdf
John is a minor who lives with his mother and stepfather and not his.pdfJohn is a minor who lives with his mother and stepfather and not his.pdf
John is a minor who lives with his mother and stepfather and not his.pdf
 
John and Sara are married and live in AZ. They do not have a prenup.pdf
John and Sara are married and live in AZ.  They do not have a prenup.pdfJohn and Sara are married and live in AZ.  They do not have a prenup.pdf
John and Sara are married and live in AZ. They do not have a prenup.pdf
 
In Visual Studios C# console app using multiple class files create a.pdf
In Visual Studios C# console app using multiple class files create a.pdfIn Visual Studios C# console app using multiple class files create a.pdf
In Visual Studios C# console app using multiple class files create a.pdf
 
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdfJoel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
 
Jin has configured File History on his Windows 10 computer using an .pdf
Jin has configured File History on his Windows 10 computer using an .pdfJin has configured File History on his Windows 10 computer using an .pdf
Jin has configured File History on his Windows 10 computer using an .pdf
 
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdfJJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
 
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdfJim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
 
Jean has her first child at age 14. By the time she is 30, she has f.pdf
Jean has her first child at age 14. By the time she is 30, she has f.pdfJean has her first child at age 14. By the time she is 30, she has f.pdf
Jean has her first child at age 14. By the time she is 30, she has f.pdf
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

JavaScriptIn this project you will create an interactive map for a.pdf

  • 1. JavaScript In this project you will create an interactive map for a cycling club in Boulder, Colorado, allowing cyclists to view a map with directions between two popular cycling destinations. To complete this project, you will need to set up a Google Cloud account along with an API key to access the Google Maps, Directions Service, and Directions Renderer APIs. A preview of the completed page is shown in Figure 10-42. Do the following: 1. Use your code editor to open the project10-03_txt.html and project10-03_txt.js files from the js10 c project03 folder. Enter your name and the date in the comment section of each file and save them as project10-03.html and project10-03.js, respectively. 2. Go to the project10-03.html file in your code editor. Add a script element linked to the project10-03js file. Defer the loading of the script until after the page is loaded. 3. Add another script element with the following src attribute: https://maps.googleapis.com/maps/ api/js?key=key&callback=showMap where key is your Google Maps API key. Also defer this script until after the page is loaded. 4. Close the file, saving your changes and then go to the project10-03.js file in your code editor. Steps 5 through 10 should all be down within the showMap() function. Several variables have already been declared for you. 5. Use the new google.maps.DirectionsService() object constructor to create a DirectionsService object named bikeFind. 6. Use the new google.maps.DirectionsRenderer() object constructor to create a DirectionsRenderer object named bikeDraw. 7. Create a LatLng object named Boulder storing within it a latitude of 40.01753 and a longitude of -105.26496. 8. Use the new google.maps.Map() object constructor to instantiate a new Google map named myMap. Set the zoom level to 12 and center the map on Boulder.
  • 2. 9. Create event listeners for the startingPoint and endingPoint selection lists, running the drawRoute() function in response to the change event. 10. Create the drawRoute() function. Within the function insert an if statement that tests whether the selected index for the startingPoint and endingPoint selection lists are both not equal to 0. If true, then do the following: a. Define a route object named bikeRoute with an origin at startingPoint.value and a destination at endingPoint.value. Set the travelMode option to BICYCLING. b. Apply the route() method to the bikeFind object generating directions between the starting and ending points. If the status of the request is OK then (i) apply the setDirections() method to bikeDraw object request directions from the directions service, (ii) apply the setMap() method to bikeDraw to display the route within myMap, and (iii) apply the setPanel() method to bikeDraw to display the turnby-turn directions within the bikeDirections object. If the status is not OK then change the text content of the bikeDirections object to Directions Unavailable: status. 11. Save your changes to the file and then load project10-03.html in your browser. Verify that a map of Boulder,Colorado appears in the left box. Verify that when you select starting and ending points from the two list boxes,a route is drawn on the map and turn-by-turn directions are provided between the two points. Filename: project10-3.html Hands-on Project 10-3 Hands-on Project 10-3 Boulder Cycling Routes Choose an origin and a destination of your cycling outingStarting PointFolsom FieldNCAREben G. Fine ParkEldorado SpringsValmont Bike ParkKossler LakeRocky FlatsFoothills ParkJamestownEnding PointFolsom FieldNCAREben G. Fine ParkEldorado SpringsValmont Bike ParkKossler LakeRocky FlatsFoothills ParkJamestown -------------------------------------------------------------------------------------------- Filename: project10-03.js "use strict";
  • 3. /* JavaScript 7th Edition Chapter 10 Project 10-03 Boulder Cycling Directions Author: Date: Filename: project10-03.js */ function showMap() { // Page objects let bikeMap = document.getElementById("bikeMap"); let bikeDirections = document.getElementById("bikeDirections"); let startingPoint = document.getElementById("startingPoint"); let endingPoint = document.getElementById("endingPoint"); } -------------------------------------------------------------- Filename: styles.css /* JavaScript 7th Edition Chapter 10 Hands-on Project 10-3 Style sheet Boulder Cycling Directions Filename: styles.css */ /* apply a natural box layout model to all elements */ * { box-sizing: border-box; } /* reset rules */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, acronym, address, big, cite, code,
  • 4. del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } /* HTML5 display-role reset for older browsers */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } body { line-height: 1; width: 1024px; background: #F5F5F5; margin: 0 auto; font-family: Georgia, "Droid Serif", serif; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after,
  • 5. q:before, q:after { content: ''; content: none; } table { border-collapse: collapse; border-spacing: 0; } body { line-height: 1; width: 960px; background: white; margin: 0 auto; font-family: Verdana, Geneva, sans-serif; } ol, ul { list-style: none; } /* page header */ header { background: #5472B2; width: 100%; color: #FFFFFF; font-size: 48px; text-align: center; line-height: 1.5em; margin-bottom: 0; } /*-------------------- Project Styles ------------------*/ section { background-color: #FFDB70; margin-top: 0; padding-bottom: 20px; user-select:none; height: 640px;
  • 6. } section h1 { font-size: 2.8em; text-align: center; margin: 0; padding: 20px 0 10px 0; } section p { width: 800px; margin: 0 auto; font-size: 1.2em; line-height: 1.3; text-align: center; } fieldset { width: 90%; margin: 10px auto; position: relative; display: block; height: 185px; } fieldset select#startingPoint { position: absolute; top: 0; left: 220px; width: 180px; } fieldset select#endingPoint { position: absolute; top: 0; left: 460px; width: 180px; } div#bikeMap { width: 400px; height: 300px;
  • 7. border: 3px solid gray; margin: 0 15px 0 70px; float: left; } div#bikeDirections { width: 400px; height: 300px; border: 3px solid gray; margin: 0 30px 0 0; float: left; overflow: scroll; } select option:first-of-type { font-size: 1.3em; padding-bottom: 5px; font-weight: bold; } Boulder Cycling Routes Figure 10-42 Completed Project 10-3