SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Google Map
            1   Ronald	
  Hsu	
  100062595	
  @	
  MIRLab

                h7p://about.me/hothero
                                                            20120417
12年4月17日星
Outline
    ¢Google	
  Map	
  
      — Closure
      — Func5onal	
  programming
      — Assignment
      — Related	
  Applica5ons	
  DEMO
    ¢Javascript	
  Encoder	
  &	
  Packer




                                             2

12年4月17日星
Google	
  Map	
  v3

 ¢Client	
  
   Loca5on
 ¢Direc5on
   s
 ¢GeoCode
   r
 ¢Marker

 ¢Event

                          3

12年4月17日星
Get	
  Started
                     CSS(Op5onal)

                      include	
  external	
  javascript	
  




                                                              4

12年4月17日星
google.maps.LatLng
    ¢latLng	
  =	
  new	
  google.maps.LatLng(la5tude,	
  
      longitude);	
  	
  	
  //	
  ini5aliza5on
    ¢Some	
  methods
      — equals(other:LatLng)	
  	
  	
  //	
  comparison	
  func5on
      — lat()
      — lng()
      — toString():	
  "(-­‐34.397,	
  150.644)"
      — toUrlValue(precision?:number):	
  "-­‐34.397,150.644"
    ¢DEMO:	
  h`p://goo.gl/iE7YY
                                                                       5

12年4月17日星
MapType




              6

12年4月17日星
Client	
  Loca5on
    ¢Add	
  another	
  external	
  javascript	
  library	
  or	
  use	
  
      another	
  sample	
  from	
  “Code	
  Samples”
      — src="h`p://www.google.com/jsapi"
    ¢Get	
  client	
  loca5on	
  from	
  google.loader	
  and	
  
      center	
  map	
  to	
  there.



    ¢DEMO:	
  h`p://goo.gl/NIVU

                                                                             7

12年4月17日星
google.maps.Marker
                                     MarkerOp5ons	
  
                                    wrapped	
  by	
  braces	
  {}

    ¢Some	
  proper5es
      — anima5on
      — icon
      — map
      — posi5on
      — 5tle
      — zIndex
    ¢DEMO:	
  h`p://goo.gl/3PRpO                                   8

12年4月17日星
Event



    ¢Concept:
      — Closure
      — Func5onal	
  Programming
    ¢Sample:	
  place	
  a	
  marker	
  on	
  client	
  loca5on
      — h`p://mirlab.org/users/ronald.hsu/
        web_course_demo/clientMarker.html

                                                                   9

12年4月17日星
JS	
  Advanced	
  Concept
    ¢Closure
      — Wikipedia:	
  In	
  computer	
  science,	
  a	
  closure	
  (also	
  lexical	
  
        closure	
  or	
  func5on	
  closure)	
  is	
  a	
  func5on	
  together	
  
        with	
  a	
  referencing	
  environment	
  for	
  the	
  non-­‐local	
  
        variables	
  of	
  that	
  func5on.	
  [1]	
  A	
  closure	
  allows	
  a	
  
        func5on	
  to	
  access	
  variables	
  outside	
  its	
  immediate	
  
        lexical	
  scope.
    ¢Func5onal	
  Programming
      — Extended	
  Reading:	
  h`p://www.slideshare.net/
        ihower/fp-­‐osdc2012v2
                                                                                            10

12年4月17日星
Closure	
  &	
  Func5onal	
  Programming


    ¢fffff                                 Closure

    Call	
  by	
  
    reference
                                                Func5onal	
  
                                               Programming

    ¢h`p://jsfiddle.net、h`p://jsbin.com/
                                                            11

12年4月17日星
Closure(Cont.)
  h`p://goo.gl/X`HA




                      Call	
  by	
  reference


                                                12

12年4月17日星
Func5onal	
  Programming(Cont.)




                                       Rename	
  
               Call	
  by	
  func5on   this	
  func5on   13

12年4月17日星
Func5onal	
  Programming(Cont.)


                                         Anonymous	
  
                                         Func5on


                                  Callback	
  func5on


    ¢More:	
  Node.js	
  、Meteor(Server-­‐side)         14

12年4月17日星
Google	
  Map	
  v3(Cont.)




¢Direc5ons

¢GeoCoder




                                 15

12年4月17日星
DOMListener	
  &	
  GeoCoder
    ¢My	
  version:




    ¢DEMO:	
  h`p://goo.gl/v8AtJ   16

12年4月17日星
Direc5on	
  /	
  Route




                                  BICYCLING,	
  WALKING




             For	
  showing	
  (or	
  polyline)

    ¢DEMO:	
  h`p://goo.gl/zfvkk                         17

12年4月17日星
MarkerCluster




    ¢DEMO:	
  h`p://goo.gl/8iWs

                                   18

12年4月17日星
Reference	
  Usage	
  (Other	
  parts	
  of	
  GMap)
    ¢h`ps://developers.google.com/maps/

    ¢Developer’s	
  Guide
      — Services
      — Libraries
    ¢API	
  Reference

    ¢Code	
  Samples	
  &	
  More	
  Resources(Advanced)

    ¢Another	
  alterna5ve:	
  an	
  open	
  source	
  project	
  
      “OpenStreetMap”
                                                                      19

12年4月17日星
Assignment




    ¢h`p://mirlab.org/users/ronald.hsu/
      web_course_demo/homework.html




                                           20

12年4月17日星
Dic5onary	
  /	
  Hash	
  Table
 1
     var	
  ipeen_hsinchu	
  =	
  {};
     ipeen_hsinchu[0]	
  =	
  {};
     ipeen_hsinchu[0]["name"]	
  =	
  "均鎂糕餅公司";
     ipeen_hsinchu[0]["address"]	
  =	
  "新竹縣竹北市文平路302號";
 2
     var a = {};
     a[0] = {"name": "test",
     "number": 3};
     alert(a[0].number);

                                                            21

12年4月17日星
DEMO
    ¢Joytrip

    ¢Spotmap

    ¢Anyweather
      — h`p://anyweather.hothero.org/




                                         22

12年4月17日星
Javascript	
  encoder
    ¢h`p://dean.edwards.name/packer/	
  、	
  h`p://
      javascriptcompressor.com/
      — Prac5cally
    ¢h`p://uv-­‐8.jp/public/aaencode.html
      — For	
  fun
    ¢More:	
  h`p://goo.gl/JKvqC

    ¢Keyword:	
  Obfuscator,	
  obfusca5on,	
  compiler,	
  
      encoder,	
  ...	
  etc.
                                                                23

12年4月17日星
Thanks	
  for	
  your	
  listening	
  




    ¢Q	
  &	
  A




                                             24

12年4月17日星

Contenu connexe

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Google map slide

  • 1. Google Map 1 Ronald  Hsu  100062595  @  MIRLab h7p://about.me/hothero 20120417 12年4月17日星
  • 2. Outline ¢Google  Map   — Closure — Func5onal  programming — Assignment — Related  Applica5ons  DEMO ¢Javascript  Encoder  &  Packer 2 12年4月17日星
  • 3. Google  Map  v3 ¢Client   Loca5on ¢Direc5on s ¢GeoCode r ¢Marker ¢Event 3 12年4月17日星
  • 4. Get  Started CSS(Op5onal) include  external  javascript   4 12年4月17日星
  • 5. google.maps.LatLng ¢latLng  =  new  google.maps.LatLng(la5tude,   longitude);      //  ini5aliza5on ¢Some  methods — equals(other:LatLng)      //  comparison  func5on — lat() — lng() — toString():  "(-­‐34.397,  150.644)" — toUrlValue(precision?:number):  "-­‐34.397,150.644" ¢DEMO:  h`p://goo.gl/iE7YY 5 12年4月17日星
  • 6. MapType 6 12年4月17日星
  • 7. Client  Loca5on ¢Add  another  external  javascript  library  or  use   another  sample  from  “Code  Samples” — src="h`p://www.google.com/jsapi" ¢Get  client  loca5on  from  google.loader  and   center  map  to  there. ¢DEMO:  h`p://goo.gl/NIVU 7 12年4月17日星
  • 8. google.maps.Marker MarkerOp5ons   wrapped  by  braces  {} ¢Some  proper5es — anima5on — icon — map — posi5on — 5tle — zIndex ¢DEMO:  h`p://goo.gl/3PRpO 8 12年4月17日星
  • 9. Event ¢Concept: — Closure — Func5onal  Programming ¢Sample:  place  a  marker  on  client  loca5on — h`p://mirlab.org/users/ronald.hsu/ web_course_demo/clientMarker.html 9 12年4月17日星
  • 10. JS  Advanced  Concept ¢Closure — Wikipedia:  In  computer  science,  a  closure  (also  lexical   closure  or  func5on  closure)  is  a  func5on  together   with  a  referencing  environment  for  the  non-­‐local   variables  of  that  func5on.  [1]  A  closure  allows  a   func5on  to  access  variables  outside  its  immediate   lexical  scope. ¢Func5onal  Programming — Extended  Reading:  h`p://www.slideshare.net/ ihower/fp-­‐osdc2012v2 10 12年4月17日星
  • 11. Closure  &  Func5onal  Programming ¢fffff Closure Call  by   reference Func5onal   Programming ¢h`p://jsfiddle.net、h`p://jsbin.com/ 11 12年4月17日星
  • 12. Closure(Cont.) h`p://goo.gl/X`HA Call  by  reference 12 12年4月17日星
  • 13. Func5onal  Programming(Cont.) Rename   Call  by  func5on this  func5on 13 12年4月17日星
  • 14. Func5onal  Programming(Cont.) Anonymous   Func5on Callback  func5on ¢More:  Node.js  、Meteor(Server-­‐side) 14 12年4月17日星
  • 16. DOMListener  &  GeoCoder ¢My  version: ¢DEMO:  h`p://goo.gl/v8AtJ 16 12年4月17日星
  • 17. Direc5on  /  Route BICYCLING,  WALKING For  showing  (or  polyline) ¢DEMO:  h`p://goo.gl/zfvkk 17 12年4月17日星
  • 18. MarkerCluster ¢DEMO:  h`p://goo.gl/8iWs 18 12年4月17日星
  • 19. Reference  Usage  (Other  parts  of  GMap) ¢h`ps://developers.google.com/maps/ ¢Developer’s  Guide — Services — Libraries ¢API  Reference ¢Code  Samples  &  More  Resources(Advanced) ¢Another  alterna5ve:  an  open  source  project   “OpenStreetMap” 19 12年4月17日星
  • 20. Assignment ¢h`p://mirlab.org/users/ronald.hsu/ web_course_demo/homework.html 20 12年4月17日星
  • 21. Dic5onary  /  Hash  Table 1 var  ipeen_hsinchu  =  {}; ipeen_hsinchu[0]  =  {}; ipeen_hsinchu[0]["name"]  =  "均鎂糕餅公司"; ipeen_hsinchu[0]["address"]  =  "新竹縣竹北市文平路302號"; 2 var a = {}; a[0] = {"name": "test", "number": 3}; alert(a[0].number); 21 12年4月17日星
  • 22. DEMO ¢Joytrip ¢Spotmap ¢Anyweather — h`p://anyweather.hothero.org/ 22 12年4月17日星
  • 23. Javascript  encoder ¢h`p://dean.edwards.name/packer/  、  h`p:// javascriptcompressor.com/ — Prac5cally ¢h`p://uv-­‐8.jp/public/aaencode.html — For  fun ¢More:  h`p://goo.gl/JKvqC ¢Keyword:  Obfuscator,  obfusca5on,  compiler,   encoder,  ...  etc. 23 12年4月17日星
  • 24. Thanks  for  your  listening   ¢Q  &  A 24 12年4月17日星