SlideShare a Scribd company logo
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 router
Katy 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 AngularJS
Antonio 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 Components
Sven 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's
Antô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 2014
Mark 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 Backend
Backand Cohen
 
CCK For Code Junkies
CCK For Code JunkiesCCK For Code Junkies
CCK For Code Junkies
Geoff Maxey
 
Modern android development
Modern android developmentModern android development
Modern android development
Khiem-Kim Ho Xuan
 
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
Matt 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 2020
Matt Raible
 
Dynamic_UI_Concepts_version_2.pdf
Dynamic_UI_Concepts_version_2.pdfDynamic_UI_Concepts_version_2.pdf
Dynamic_UI_Concepts_version_2.pdf
JoeRodriguez477329
 
Warsaw Frontend Meetup #1 - Webpack
Warsaw Frontend Meetup #1 - WebpackWarsaw Frontend Meetup #1 - Webpack
Warsaw Frontend Meetup #1 - Webpack
Radosł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 Kotlin
Dmitriy Sobko
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratique
Simon 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 ReactJS
Visual 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 2019
Matt Raible
 
AngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPIAngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPI
Eric Wise
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworks
Eric 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.pptx
BOSC 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.pdf
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 
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
sanjeevbansal1970
 

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

How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 

Recently uploaded (20)

How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.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