SlideShare a Scribd company logo
1 of 27
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 week8Derek Jacoby
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9Derek Jacoby
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10Derek Jacoby
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGapAlex S
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1Derek Jacoby
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery PluginsMarc Grabanski
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performancekaven 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 ReactOliver N
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practicesfloydophone
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6Derek 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 ToRaymond Camden
 
Untangling - fall2017 - week5
Untangling - fall2017 - week5Untangling - fall2017 - week5
Untangling - fall2017 - week5Derek Jacoby
 
JavaScript : A trending scripting language
JavaScript : A trending scripting languageJavaScript : A trending scripting language
JavaScript : A trending scripting languageAbhayDhupar
 
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 DOMDaiwei Lu
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for MobileRemy Sharp
 
Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1Derek 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 week3Derek Jacoby
 
Untangling spring week6
Untangling spring week6Untangling spring week6
Untangling spring week6Derek Jacoby
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2Derek Jacoby
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5Derek Jacoby
 
Untangling the web - week 3
Untangling the web - week 3Untangling the web - week 3
Untangling the web - week 3Derek Jacoby
 
Untangling the web week 2 - SEO
Untangling the web week 2 - SEOUntangling the web week 2 - SEO
Untangling the web week 2 - SEODerek Jacoby
 
Mapa mental cooperativas
Mapa mental cooperativasMapa mental cooperativas
Mapa mental cooperativasRonny Ocanto
 
Ryan del rosario
Ryan del rosarioRyan del rosario
Ryan del rosarioyanyanz
 
Desigualdade de gênero no brasil
Desigualdade de gênero no brasilDesigualdade de gênero no brasil
Desigualdade de gênero no brasilFabio Cruz
 
Beyond the Gig Economy
Beyond the Gig EconomyBeyond the Gig Economy
Beyond the Gig EconomyJon 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 2020CEW 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 behaviorGrant 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 Domkaven yan
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Tony Frame
 
Professional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsProfessional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsMike Wilcox
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptdominion
 
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 PythonBrian Lyttle
 
Optimizing Flex Applications
Optimizing Flex ApplicationsOptimizing Flex Applications
Optimizing Flex Applicationsdcoletta
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller ColumnsJonathan Fine
 
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 SourcingGlenn Gutmacher
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application developmentzonathen
 
Marionette - TorontoJS
Marionette - TorontoJSMarionette - TorontoJS
Marionette - TorontoJSmatt-briggs
 
[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
 
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 JavaScriptIgalia
 
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 Dxldominion
 
Web Performance Tips
Web Performance TipsWeb Performance Tips
Web Performance TipsRavi Raj
 

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
 
Marionette - TorontoJS
Marionette - TorontoJSMarionette - TorontoJS
Marionette - TorontoJS
 
[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
 

More from Derek Jacoby

Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Derek Jacoby
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Derek Jacoby
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Derek Jacoby
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Derek Jacoby
 
Untangling the web - fall2017 - class 4
Untangling the web - fall2017 - class 4Untangling the web - fall2017 - class 4
Untangling the web - fall2017 - class 4Derek Jacoby
 
Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Derek Jacoby
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2Derek Jacoby
 
Untangling fall2017 week1
Untangling fall2017 week1Untangling fall2017 week1
Untangling fall2017 week1Derek Jacoby
 
Untangling spring week12
Untangling spring week12Untangling spring week12
Untangling spring week12Derek Jacoby
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11Derek 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

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 

Recently uploaded (20)

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 

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