SlideShare a Scribd company logo
Untangling the Web
Class 8 – maps and hosting
Agenda
 Homework recap
 Problems folks are running into
 Maps
 Google maps
 Leaflet
 Hosting
 Options and tradeoffs
Turning in homework
 All of you have turned in at least one homework. You know how to find me. But not
turning in a homework just mystifies me.
 If you turn something in that doesn’t work, you will likely get at least some credit
for having tried.
 If you try and need more time I am generous with extensions and can provide
assistance. Regardless of what point you are starting from, if you try in this class
and communicate when you are struggling you will do OK.
 But if you turn nothing in, the assignment is a zero.
 On the current trajectory, some of you will fail this class.
Homework recap
 How many used bootstrap? UI-kit? Flexbox?
 Go over some bootstrap code:
 Modal dialogs
 Revisit some core JS concepts
 Using the chrome developer tools to see a console window
 Variables and syntax
 Arrays and objects
 Some new JS concepts
Bootstrap examples
 https://jsfiddle.net/e4veh4yt/
 http://www.w3schools.com/bootstrap/bootstrap_modal.asp
Using JSFiddle
 From here on out I’d like homework submissions on either github or jsfiddle (or
another service such as nitrous.io)
 Github if it’s just code you’re submitting
 Jsfiddle or an alternative if it’s code I’m supposed to see run
 Using JS, you have three options on where to run the code – on load, in the head,
or in the body. Make sure you understand the difference!
 Console.log is still very useful, but it doesn’t print on the page! Have to use the
chrome developer tools.
Access DevTools On Windows On Mac
Open Developer
Tools
F12, Ctrl + Shift + I Cmd + Opt + I
Variables in the html
 Extension of the last example:
 https://jsfiddle.net/egrs4j7a/1/
 In the HTML
 <p id="foo"></p>
In the JS
 var myText = "Hello";
 document.getElementById('foo').innerHTML = myText;
Objects versus arrays
 Arrays are actually special cases of objects. All built-in variable types are, really.
 But you use them in different contexts
 Arrays - var myArray = [];
 Multidimensional (potentially)
 Ordered
 Native methods like push, pop
 Objects - var myObject = {};
 Unordered
 Best for key:value pairs
 More info: https://msdn.microsoft.com/en-us/library/89t1khd2%28v=vs.94%29.aspx?f=255&MSPPError=-
2147217396
var a = [1, 2, 3];
var o = {a: 1, b: 2, c: 3};
a[0] = 1; a[1]=2; etc.
o[“a”] = 1
o.a = 1;
A few new JS concepts
 Strict mode
 This
 Difference in behavior between strict mode and non-strict mode
 New
 Create a new instance
 Events
 Two ways of getting browser events
Strict Mode
 “use strict”; as the first line of a js file
 Mistakes become errors
 Global variables must be explicitly created
 Some other behaviors change
 See https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Strict_mode
This
 Recall the discussion last week of context
 This keyword retrieves the current execution context
 Some difference in strict mode where it retrieves the context at the time of the function
call
 In non-strict mode, the global context is the default, in strict mode will be at whatever it
was previously defined to, or undefined
 This is the basis of understanding arrow functions (ES6 concept we’ll explore later)
 Reference:
 https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/this
new
 function Car(make, model, year) {
 this.make = make;
 this.model = model;
 this.year = year;
 }
 var mycar = new Car("Eagle", "Talon TSi", 1993);
 console.log(mycar.make);
Events
 Two approaches we’ll look at today, both events on objects
 There are also events on the document object model, but we won’t discuss that in
depth today
 google.maps.event.addListener
 map.on('click', onMapClick);
Immediately Invoked Fucntion Expressions
(IIFE)
 (function () {
 })();
 The first pair of parentheses (function(){...}) turns the code within (in this case, a
function) into an expression, and the second pair of parentheses (function(){...})()
calls the function that results from that evaluated expression.
 This pattern is often used when trying to avoid polluting the global namespace,
because all the variables used inside the IIFE (like in any other normal function) are
not visible outside its scope.
Mapping
 Two main options
 Google maps
 Leaflet
 Main decision is really whether to be in the google ecosphere
 Google maps may be slightly easier initially, but leaflet is easier to extend
 Leaflet sits primarily on open street map, so perhaps less detail than google
Google Maps example
 Getting an API key (will initially work without it, but some features disabled and will
not keep working)
 https://developers.google.com/maps/documentation/javascript/get-api-key
 https://jsfiddle.net/v892njbz/1/
 Key concepts
 Arrays (review)
 Looping (review)
 New objects
Google maps example 2
 New concepts
 Events
 https://jsfiddle.net/qswaLznm/5/
Google Maps example 3
 New Concept
 Immediately Invoked Function Expression (IIFE)
 https://jsfiddle.net/v892njbz/
Leaflet example
 https://jsfiddle.net/7yx1o6o8/6/
 No new concepts here but some things to emphasize:
 External resources
 Console log
 Events (a different syntax than in google)
Where to host?
 Many options
 Depends on cost, convenience, other services being used, etc.
Amazon Web Services (AWS)
 This is the default for big sites
 Many, many service offerings
 Confusing console and management
 But it is the only one with full flexibility and nearly infinite scalability, if you can
afford it. Cheaper at scale than the alternatives, though.
Heroku
 Built on top of AWS
 More expensive
 Hugely easier to use
 Great first deployment choice
IBM BlueMix
 Competitive service offerings and pricing
 Trying to break into the market
 Established cloud provider on their own services, just now opening up to the
general public
Google
 Lots of functionality
 Different programming model
 Kubernetes
 Containerization
 Hides underlying server architecture
Microsoft Azure
 Different set of service offerings
 Cognitive services, speech reco, etc.
 If you need c# or .NET this is a better platform, but otherwise more expensive
Digital Ocean
 Advantage of very easy to get a VPS (virtual private server) up and running
 $50 service credit as part of the github student developers package
 No services other than a VPS to speak of, though
Homework
 Create a map on your pizza web page that shows the locations of the stores
 Make up at least 3 locations and insert markers onto the map
 Style the page to look like a decent pizza store web page (using whatever styling
package you like)
 Extra difficulty question
 Allow the user to click on a marker and give the distance from the Uvic campus to that
marker, putting that distance into the popup dialog

More Related Content

What's hot

Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
Derek Jacoby
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9
Derek Jacoby
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10
Derek Jacoby
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
Susan Winters
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
Alex S
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1
Derek Jacoby
 
SocketStream
SocketStreamSocketStream
SocketStream
Paul Jensen
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery Plugins
Marc Grabanski
 
learning react
learning reactlearning react
learning react
Eueung Mulyana
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performance
kaven yan
 
The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose React
Oliver N
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
floydophone
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6
Derek Jacoby
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!
Raymond Camden
 
Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared To
Raymond Camden
 
Untangling - fall2017 - week5
Untangling - fall2017 - week5Untangling - fall2017 - week5
Untangling - fall2017 - week5
Derek Jacoby
 
JavaScript : A trending scripting language
JavaScript : A trending scripting languageJavaScript : A trending scripting language
JavaScript : A trending scripting language
AbhayDhupar
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOM
Daiwei Lu
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
Remy Sharp
 
Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1
Derek Jacoby
 

What's hot (20)

Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1
 
SocketStream
SocketStreamSocketStream
SocketStream
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery Plugins
 
learning react
learning reactlearning react
learning react
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performance
 
The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose React
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!
 
Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared To
 
Untangling - fall2017 - week5
Untangling - fall2017 - week5Untangling - fall2017 - week5
Untangling - fall2017 - week5
 
JavaScript : A trending scripting language
JavaScript : A trending scripting languageJavaScript : A trending scripting language
JavaScript : A trending scripting language
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOM
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
 
Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1
 

Viewers also liked

Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3
Derek Jacoby
 
Untangling spring week6
Untangling spring week6Untangling spring week6
Untangling spring week6
Derek Jacoby
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2
Derek Jacoby
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
Derek Jacoby
 
Untangling the web - week 3
Untangling the web - week 3Untangling the web - week 3
Untangling the web - week 3
Derek Jacoby
 
Untangling the web week 2 - SEO
Untangling the web week 2 - SEOUntangling the web week 2 - SEO
Untangling the web week 2 - SEO
Derek Jacoby
 
Biohacking
BiohackingBiohacking
Biohacking
Derek Jacoby
 
Meta 4.2
Meta 4.2Meta 4.2
Discapacidad visual
Discapacidad visualDiscapacidad visual
Discapacidad visual
Laura Buchelli Lamprea
 
Mapa mental cooperativas
Mapa mental cooperativasMapa mental cooperativas
Mapa mental cooperativas
Ronny Ocanto
 
Ryan del rosario
Ryan del rosarioRyan del rosario
Ryan del rosario
yanyanz
 
Desigualdade de gênero no brasil
Desigualdade de gênero no brasilDesigualdade de gênero no brasil
Desigualdade de gênero no brasil
Fabio Cruz
 
Beyond the Gig Economy
Beyond the Gig EconomyBeyond the Gig Economy
Beyond the Gig Economy
Jon Lieber
 
Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020
CEW Georgetown
 
3 hard facts shaping higher education thinking and behavior
3 hard facts shaping higher education thinking and behavior3 hard facts shaping higher education thinking and behavior
3 hard facts shaping higher education thinking and behavior
Grant Thornton LLP
 
African Americans: College Majors and Earnings
African Americans: College Majors and Earnings African Americans: College Majors and Earnings
African Americans: College Majors and Earnings
CEW Georgetown
 

Viewers also liked (16)

Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3
 
Untangling spring week6
Untangling spring week6Untangling spring week6
Untangling spring week6
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
 
Untangling the web - week 3
Untangling the web - week 3Untangling the web - week 3
Untangling the web - week 3
 
Untangling the web week 2 - SEO
Untangling the web week 2 - SEOUntangling the web week 2 - SEO
Untangling the web week 2 - SEO
 
Biohacking
BiohackingBiohacking
Biohacking
 
Meta 4.2
Meta 4.2Meta 4.2
Meta 4.2
 
Discapacidad visual
Discapacidad visualDiscapacidad visual
Discapacidad visual
 
Mapa mental cooperativas
Mapa mental cooperativasMapa mental cooperativas
Mapa mental cooperativas
 
Ryan del rosario
Ryan del rosarioRyan del rosario
Ryan del rosario
 
Desigualdade de gênero no brasil
Desigualdade de gênero no brasilDesigualdade de gênero no brasil
Desigualdade de gênero no brasil
 
Beyond the Gig Economy
Beyond the Gig EconomyBeyond the Gig Economy
Beyond the Gig Economy
 
Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020Recovery: Job Growth and Education Requirements Through 2020
Recovery: Job Growth and Education Requirements Through 2020
 
3 hard facts shaping higher education thinking and behavior
3 hard facts shaping higher education thinking and behavior3 hard facts shaping higher education thinking and behavior
3 hard facts shaping higher education thinking and behavior
 
African Americans: College Majors and Earnings
African Americans: College Majors and Earnings African Americans: College Majors and Earnings
African Americans: College Majors and Earnings
 

Similar to Untangling8

The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
kaven yan
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
Tony Frame
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
Heather Dionne
 
Professional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsProfessional JavaScript: AntiPatterns
Professional JavaScript: AntiPatterns
Mike Wilcox
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScript
dominion
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
Brian Lyttle
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
Togakangaroo
 
Optimizing Flex Applications
Optimizing Flex ApplicationsOptimizing Flex Applications
Optimizing Flex Applications
dcoletta
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 
All of javascript
All of javascriptAll of javascript
All of javascript
Togakangaroo
 
Getting Started in Custom Programming for Talent Sourcing
Getting Started in Custom Programming for Talent SourcingGetting Started in Custom Programming for Talent Sourcing
Getting Started in Custom Programming for Talent Sourcing
Glenn Gutmacher
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
David Padbury
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
zonathen
 
[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...
Functional Thursday
 
ASP.NET MVC3 RAD
ASP.NET MVC3 RADASP.NET MVC3 RAD
ASP.NET MVC3 RAD
Mădălin Ștefîrcă
 
Writing native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptWriting native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScript
Igalia
 
Mobile optimization
Mobile optimizationMobile optimization
Mobile optimization
purplecabbage
 
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And DxlBp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
dominion
 
Web Performance Tips
Web Performance TipsWeb Performance Tips
Web Performance Tips
Ravi Raj
 
Code generation
Code generationCode generation
Code generation
Rafael Chaves
 

Similar to Untangling8 (20)

The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
Professional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsProfessional JavaScript: AntiPatterns
Professional JavaScript: AntiPatterns
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScript
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
Optimizing Flex Applications
Optimizing Flex ApplicationsOptimizing Flex Applications
Optimizing Flex Applications
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
 
All of javascript
All of javascriptAll of javascript
All of javascript
 
Getting Started in Custom Programming for Talent Sourcing
Getting Started in Custom Programming for Talent SourcingGetting Started in Custom Programming for Talent Sourcing
Getting Started in Custom Programming for Talent Sourcing
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...
 
ASP.NET MVC3 RAD
ASP.NET MVC3 RADASP.NET MVC3 RAD
ASP.NET MVC3 RAD
 
Writing native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptWriting native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScript
 
Mobile optimization
Mobile optimizationMobile optimization
Mobile optimization
 
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And DxlBp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
 
Web Performance Tips
Web Performance TipsWeb Performance Tips
Web Performance Tips
 
Code generation
Code generationCode generation
Code generation
 

More from Derek Jacoby

Untangling11
Untangling11Untangling11
Untangling11
Derek Jacoby
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
Derek Jacoby
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
Derek Jacoby
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
Derek Jacoby
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7
Derek Jacoby
 
Untangling the web - fall2017 - class 4
Untangling the web - fall2017 - class 4Untangling the web - fall2017 - class 4
Untangling the web - fall2017 - class 4
Derek Jacoby
 
Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Untangling the web fall2017 class 3
Untangling the web fall2017 class 3
Derek Jacoby
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
Derek Jacoby
 
Untangling fall2017 week1
Untangling fall2017 week1Untangling fall2017 week1
Untangling fall2017 week1
Derek Jacoby
 
Untangling spring week12
Untangling spring week12Untangling spring week12
Untangling spring week12
Derek Jacoby
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11
Derek Jacoby
 

More from Derek Jacoby (12)

Untangling11
Untangling11Untangling11
Untangling11
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7
 
Untangling the web - fall2017 - class 4
Untangling the web - fall2017 - class 4Untangling the web - fall2017 - class 4
Untangling the web - fall2017 - class 4
 
Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Untangling the web fall2017 class 3
Untangling the web fall2017 class 3
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Untangling fall2017 week1
Untangling fall2017 week1Untangling fall2017 week1
Untangling fall2017 week1
 
Untangling spring week12
Untangling spring week12Untangling spring week12
Untangling spring week12
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11
 

Recently uploaded

FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdfFINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
HayddieMaeCapunong
 
How to define Related field in Odoo 17 - Odoo 17 Slides
How to define Related field in Odoo 17 - Odoo 17 SlidesHow to define Related field in Odoo 17 - Odoo 17 Slides
How to define Related field in Odoo 17 - Odoo 17 Slides
Celine George
 
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptxParkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
AnujVishwakarma34
 
Java Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHatJava Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHat
Scholarhat
 
classroom orientation/ back to school...
classroom orientation/ back to school...classroom orientation/ back to school...
classroom orientation/ back to school...
RoselleRaguindin
 
React Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHatReact Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHat
Scholarhat
 
New features of Maintenance Module in Odoo 17
New features of Maintenance Module in Odoo 17New features of Maintenance Module in Odoo 17
New features of Maintenance Module in Odoo 17
Celine George
 
Celebrating 25th Year SATURDAY, 27th JULY, 2024
Celebrating 25th Year SATURDAY, 27th JULY, 2024Celebrating 25th Year SATURDAY, 27th JULY, 2024
Celebrating 25th Year SATURDAY, 27th JULY, 2024
APEC Melmaruvathur
 
VRS An Strategic Approch to Meet Need of Organisation.pptx
VRS An Strategic Approch to Meet Need of Organisation.pptxVRS An Strategic Approch to Meet Need of Organisation.pptx
VRS An Strategic Approch to Meet Need of Organisation.pptx
Banker and Adjunct Lecturer
 
Lecture Notes Unit5 chapter 15 PL/SQL Programming
Lecture Notes Unit5 chapter 15 PL/SQL ProgrammingLecture Notes Unit5 chapter 15 PL/SQL Programming
Lecture Notes Unit5 chapter 15 PL/SQL Programming
Murugan146644
 
Class 6 English Chapter 1 Fables and Folk Stories
Class 6 English Chapter 1 Fables and Folk StoriesClass 6 English Chapter 1 Fables and Folk Stories
Class 6 English Chapter 1 Fables and Folk Stories
sweetygupta8413
 
Java MCQ Questions and Answers PDF By ScholarHat
Java MCQ Questions and Answers PDF By ScholarHatJava MCQ Questions and Answers PDF By ScholarHat
Java MCQ Questions and Answers PDF By ScholarHat
Scholarhat
 
NLC 2024 - Certificate of Recognition
NLC  2024  -  Certificate of RecognitionNLC  2024  -  Certificate of Recognition
NLC 2024 - Certificate of Recognition
Deped
 
Production Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptxProduction Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptx
UmeshTimilsina1
 
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdfPRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
nservice241
 
Lecture Notes Unit4 Chapter13 users , roles and privileges
Lecture Notes Unit4 Chapter13 users , roles and privilegesLecture Notes Unit4 Chapter13 users , roles and privileges
Lecture Notes Unit4 Chapter13 users , roles and privileges
Murugan146644
 
Form for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docxForm for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docx
VenuzSayanAday
 
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
OliverVillanueva13
 
Official MATATAG Weekly Lesson Log Format.pdf
Official MATATAG Weekly Lesson Log Format.pdfOfficial MATATAG Weekly Lesson Log Format.pdf
Official MATATAG Weekly Lesson Log Format.pdf
JaReah
 
How to Make a Field Storable in Odoo 17 - Odoo Slides
How to Make a Field Storable in Odoo 17 - Odoo SlidesHow to Make a Field Storable in Odoo 17 - Odoo Slides
How to Make a Field Storable in Odoo 17 - Odoo Slides
Celine George
 

Recently uploaded (20)

FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdfFINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
FINAL MATATAG PE and Health CG 2023 Grades 4-10.pdf
 
How to define Related field in Odoo 17 - Odoo 17 Slides
How to define Related field in Odoo 17 - Odoo 17 SlidesHow to define Related field in Odoo 17 - Odoo 17 Slides
How to define Related field in Odoo 17 - Odoo 17 Slides
 
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptxParkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
 
Java Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHatJava Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHat
 
classroom orientation/ back to school...
classroom orientation/ back to school...classroom orientation/ back to school...
classroom orientation/ back to school...
 
React Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHatReact Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHat
 
New features of Maintenance Module in Odoo 17
New features of Maintenance Module in Odoo 17New features of Maintenance Module in Odoo 17
New features of Maintenance Module in Odoo 17
 
Celebrating 25th Year SATURDAY, 27th JULY, 2024
Celebrating 25th Year SATURDAY, 27th JULY, 2024Celebrating 25th Year SATURDAY, 27th JULY, 2024
Celebrating 25th Year SATURDAY, 27th JULY, 2024
 
VRS An Strategic Approch to Meet Need of Organisation.pptx
VRS An Strategic Approch to Meet Need of Organisation.pptxVRS An Strategic Approch to Meet Need of Organisation.pptx
VRS An Strategic Approch to Meet Need of Organisation.pptx
 
Lecture Notes Unit5 chapter 15 PL/SQL Programming
Lecture Notes Unit5 chapter 15 PL/SQL ProgrammingLecture Notes Unit5 chapter 15 PL/SQL Programming
Lecture Notes Unit5 chapter 15 PL/SQL Programming
 
Class 6 English Chapter 1 Fables and Folk Stories
Class 6 English Chapter 1 Fables and Folk StoriesClass 6 English Chapter 1 Fables and Folk Stories
Class 6 English Chapter 1 Fables and Folk Stories
 
Java MCQ Questions and Answers PDF By ScholarHat
Java MCQ Questions and Answers PDF By ScholarHatJava MCQ Questions and Answers PDF By ScholarHat
Java MCQ Questions and Answers PDF By ScholarHat
 
NLC 2024 - Certificate of Recognition
NLC  2024  -  Certificate of RecognitionNLC  2024  -  Certificate of Recognition
NLC 2024 - Certificate of Recognition
 
Production Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptxProduction Technology of Mango in Nepal.pptx
Production Technology of Mango in Nepal.pptx
 
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdfPRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdf
 
Lecture Notes Unit4 Chapter13 users , roles and privileges
Lecture Notes Unit4 Chapter13 users , roles and privilegesLecture Notes Unit4 Chapter13 users , roles and privileges
Lecture Notes Unit4 Chapter13 users , roles and privileges
 
Form for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docxForm for Brigada eskwela-04 SY 2024.docx
Form for Brigada eskwela-04 SY 2024.docx
 
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
21stcenturyskillsframeworkfinalpresentation2-240509214747-71edb7ee.pptx
 
Official MATATAG Weekly Lesson Log Format.pdf
Official MATATAG Weekly Lesson Log Format.pdfOfficial MATATAG Weekly Lesson Log Format.pdf
Official MATATAG Weekly Lesson Log Format.pdf
 
How to Make a Field Storable in Odoo 17 - Odoo Slides
How to Make a Field Storable in Odoo 17 - Odoo SlidesHow to Make a Field Storable in Odoo 17 - Odoo Slides
How to Make a Field Storable in Odoo 17 - Odoo Slides
 

Untangling8

  • 1. Untangling the Web Class 8 – maps and hosting
  • 2. Agenda  Homework recap  Problems folks are running into  Maps  Google maps  Leaflet  Hosting  Options and tradeoffs
  • 3. Turning in homework  All of you have turned in at least one homework. You know how to find me. But not turning in a homework just mystifies me.  If you turn something in that doesn’t work, you will likely get at least some credit for having tried.  If you try and need more time I am generous with extensions and can provide assistance. Regardless of what point you are starting from, if you try in this class and communicate when you are struggling you will do OK.  But if you turn nothing in, the assignment is a zero.  On the current trajectory, some of you will fail this class.
  • 4. Homework recap  How many used bootstrap? UI-kit? Flexbox?  Go over some bootstrap code:  Modal dialogs  Revisit some core JS concepts  Using the chrome developer tools to see a console window  Variables and syntax  Arrays and objects  Some new JS concepts
  • 5. Bootstrap examples  https://jsfiddle.net/e4veh4yt/  http://www.w3schools.com/bootstrap/bootstrap_modal.asp
  • 6. Using JSFiddle  From here on out I’d like homework submissions on either github or jsfiddle (or another service such as nitrous.io)  Github if it’s just code you’re submitting  Jsfiddle or an alternative if it’s code I’m supposed to see run  Using JS, you have three options on where to run the code – on load, in the head, or in the body. Make sure you understand the difference!  Console.log is still very useful, but it doesn’t print on the page! Have to use the chrome developer tools. Access DevTools On Windows On Mac Open Developer Tools F12, Ctrl + Shift + I Cmd + Opt + I
  • 7. Variables in the html  Extension of the last example:  https://jsfiddle.net/egrs4j7a/1/  In the HTML  <p id="foo"></p> In the JS  var myText = "Hello";  document.getElementById('foo').innerHTML = myText;
  • 8. Objects versus arrays  Arrays are actually special cases of objects. All built-in variable types are, really.  But you use them in different contexts  Arrays - var myArray = [];  Multidimensional (potentially)  Ordered  Native methods like push, pop  Objects - var myObject = {};  Unordered  Best for key:value pairs  More info: https://msdn.microsoft.com/en-us/library/89t1khd2%28v=vs.94%29.aspx?f=255&MSPPError=- 2147217396 var a = [1, 2, 3]; var o = {a: 1, b: 2, c: 3}; a[0] = 1; a[1]=2; etc. o[“a”] = 1 o.a = 1;
  • 9. A few new JS concepts  Strict mode  This  Difference in behavior between strict mode and non-strict mode  New  Create a new instance  Events  Two ways of getting browser events
  • 10. Strict Mode  “use strict”; as the first line of a js file  Mistakes become errors  Global variables must be explicitly created  Some other behaviors change  See https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Strict_mode
  • 11. This  Recall the discussion last week of context  This keyword retrieves the current execution context  Some difference in strict mode where it retrieves the context at the time of the function call  In non-strict mode, the global context is the default, in strict mode will be at whatever it was previously defined to, or undefined  This is the basis of understanding arrow functions (ES6 concept we’ll explore later)  Reference:  https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/this
  • 12. new  function Car(make, model, year) {  this.make = make;  this.model = model;  this.year = year;  }  var mycar = new Car("Eagle", "Talon TSi", 1993);  console.log(mycar.make);
  • 13. Events  Two approaches we’ll look at today, both events on objects  There are also events on the document object model, but we won’t discuss that in depth today  google.maps.event.addListener  map.on('click', onMapClick);
  • 14. Immediately Invoked Fucntion Expressions (IIFE)  (function () {  })();  The first pair of parentheses (function(){...}) turns the code within (in this case, a function) into an expression, and the second pair of parentheses (function(){...})() calls the function that results from that evaluated expression.  This pattern is often used when trying to avoid polluting the global namespace, because all the variables used inside the IIFE (like in any other normal function) are not visible outside its scope.
  • 15. Mapping  Two main options  Google maps  Leaflet  Main decision is really whether to be in the google ecosphere  Google maps may be slightly easier initially, but leaflet is easier to extend  Leaflet sits primarily on open street map, so perhaps less detail than google
  • 16. Google Maps example  Getting an API key (will initially work without it, but some features disabled and will not keep working)  https://developers.google.com/maps/documentation/javascript/get-api-key  https://jsfiddle.net/v892njbz/1/  Key concepts  Arrays (review)  Looping (review)  New objects
  • 17. Google maps example 2  New concepts  Events  https://jsfiddle.net/qswaLznm/5/
  • 18. Google Maps example 3  New Concept  Immediately Invoked Function Expression (IIFE)  https://jsfiddle.net/v892njbz/
  • 19. Leaflet example  https://jsfiddle.net/7yx1o6o8/6/  No new concepts here but some things to emphasize:  External resources  Console log  Events (a different syntax than in google)
  • 20. Where to host?  Many options  Depends on cost, convenience, other services being used, etc.
  • 21. Amazon Web Services (AWS)  This is the default for big sites  Many, many service offerings  Confusing console and management  But it is the only one with full flexibility and nearly infinite scalability, if you can afford it. Cheaper at scale than the alternatives, though.
  • 22. Heroku  Built on top of AWS  More expensive  Hugely easier to use  Great first deployment choice
  • 23. IBM BlueMix  Competitive service offerings and pricing  Trying to break into the market  Established cloud provider on their own services, just now opening up to the general public
  • 24. Google  Lots of functionality  Different programming model  Kubernetes  Containerization  Hides underlying server architecture
  • 25. Microsoft Azure  Different set of service offerings  Cognitive services, speech reco, etc.  If you need c# or .NET this is a better platform, but otherwise more expensive
  • 26. Digital Ocean  Advantage of very easy to get a VPS (virtual private server) up and running  $50 service credit as part of the github student developers package  No services other than a VPS to speak of, though
  • 27. Homework  Create a map on your pizza web page that shows the locations of the stores  Make up at least 3 locations and insert markers onto the map  Style the page to look like a decent pizza store web page (using whatever styling package you like)  Extra difficulty question  Allow the user to click on a marker and give the distance from the Uvic campus to that marker, putting that distance into the popup dialog