SlideShare a Scribd company logo
Performance and
Scalability for Maps API
Sites



 Ossama Alami
 Developer Advocate, Google
 @ossamaalami
 @googlemapsapi
“Every millisecond
counts”


Google User Experience Guidelines
http://www.google.com/corporate/ux.html
Loading the JavaScript API
Lots of Resources

                    V2:
                      Simple Map

                    V3:
                      Simple Map
Maps API v3
              •   Latency #1 priority
              •   Aggressive modularization
              •   Latency features
              •   Mobile Web (iPhone, Android)
Displaying Many Markers
Problem: GMarker/Marker

       = <img>*5 + <map>*1
Solution: Light Weight Marker




        Many Markers Comparison V2 V3
Creating a Custom Overlay
First, subclass OverlayView:
1. function MarkerLight(latlng, opts, map) {
2. this.latlng = latlng;
3. if (!opts) opts = {};
4. this.map_ = map;
5.
6. this.height_ = opts.height || 32;
7. this.width_ = opts.width || 32;
8. this.image_ = opts.image;
9.
10. this.setMap(map);
11.}
12.
13.MarkerLight.prototype = new google.maps.OverlayView();
Creating a Custom Overlay
Then implement onAdd() and onRemove() called by the API:
1.    MarkerLight.prototype.onAdd = function() {
2.     // Create the DIV representing our MarkerLight
3.     var div = document.createElement("div");
4.     div.style.border = "1px solid white";
5.     div.style.position = "absolute";
6.     div.style.paddingLeft = "0px";
7.     div.style.cursor = 'pointer';
8.
9.     var img = document.createElement("img");
10.    img.src = this.image_;
11.    img.style.width = this.width_ + "px";
12.    img.style.height = this.height_ + "px";
13.    div.appendChild(img);
14.
15.    var panes = this.getPanes();
16.    panes.overlayLayer.appendChild(div);
17.
18.     this.div_ = div;
19.   };
20.
21.   MarkerLight.prototype.onRemove = function() {
22.     this.div_.parentNode.removeChild(this.div_);
23.     this.div_ = null;
24.   };
Creating a Custom Overlay
Then implement draw() and position the DIV:
 1.    MarkerLight.prototype.draw = function() {
 2.     var overlayProjection = this.getProjection();
 3.
 4.     // Calculate the DIV coordinates of two opposite corners
 5.     // of our bounds to get the size and position of our MarkerLight
 6.     var divPixel = overlayProjection.fromLatLngToDivPixel(this.latlng);
 7.
 8.      // Now position our DIV based on the DIV coordinates of our bounds
 9.      this.div_.style.width = this.width_ + "px";
 10.     this.div_.style.left = (divPixel.x) + "px";
 11.     this.div_.style.height = (this.height_) + "px";
 12.     this.div_.style.top = (divPixel.y) - this.height_ + "px";
 13.   };




Then, just create the Marker:
1. var marker = new MarkerLight(latlng,
2. {image:"bluecirclemarker.png"}, map));
Solution: Light Weight Marker




        Many Markers Comparison V2 V3
Light Weight Marker for Flash, Too!




                    MadoffMap
Problem: Too Many DOM Nodes
Solution: Clustering




                AuthorMapper
Solution: K-means Clustering




                 360Cities
Solution: Grid Based Clustering




            MarkerClusterer V2 V3
Solution: Regional Clustering




              US Pizzas Travellr
More Clustering Resources



             Article: Handling Large Amounts of Markers



             Python k-means



             Maptimize
Solution: View Only Visualization




                   FundRace
Solution: View Only Visualization




       HeatMapAPI                   Boston Pizza

                NY Times Taxi Map
Solution: Clickable Marker Layer




                                   Clickable Tile Layer



        Google Local Search
Rendering Large Polys
Problem: Polygon/GPolygon
Solution: Lightweight Polys




                 Polygonzo
Problem: Too Many Points




     13500 points          2200 points
Solution: Data Simplification


                  MapShaper
                  MapSimplification



                  Mapping the Votes: Resources
Solution: Encoded Polys




             Encoded Poly Example
Problem: Browsers + Vector Graphics




           VML

                       SVG
                      Canvas
Solution: Maps API for Flash




    Thematic Mapping           HowSFVotes
Solution: Earth API




                  Map of The Fallen
Solution: Tile Layers
Static Data Tiles: Counties Example




    Zoom 5                                          Zoom 9

              Zoom 6                     Zoom 8

                            Zoom 7


   Generated County Tiles
   • Tiles generated with Perl script using data in PostGRE
     database for zoom levels 5-9
Hosting Geo Data
Hosting Geo Data
Google Maps Data API
 • Stores geo data and associated attributes.
 • Supports geospatial and attribute queries
 • Storage scales simply with usage.
 • Geodata is accessible across platforms and devices.
 • Geodata from the Google Maps Data API can be instantly
   indexed and made searchable in Google Maps.
App Engine
 • Host and run your web applications on Google's infrastructure.
 • Easy to build, maintain and scale. Highly customizable.
 • Supports Python and Java
 • Libraries available to make geospatial queries easier on App
   Engine
    o   http://code.google.com/p/geodatastore/
    o   http://code.google.com/p/geomodel/
Developer Qualification




          Community Driven.
Q&A
Thanks!

More Related Content

Similar to Performance and Scalability for Maps API Sites (Dev Fest '10 Mexico)

Web enabling your survey business ppt version
Web enabling your survey business ppt versionWeb enabling your survey business ppt version
Web enabling your survey business ppt version
rudy_stricklan
 
Location Based Services Without the Cocoa
Location Based Services Without the CocoaLocation Based Services Without the Cocoa
Location Based Services Without the Cocoa
EDINA, University of Edinburgh
 
Drupal and the GeoSpatial Web
Drupal and the GeoSpatial WebDrupal and the GeoSpatial Web
Drupal and the GeoSpatial Web
Andrew Turner
 
3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.
agup2009
 
Building Mobile Cross-Platform Geospatial Apps, Nick Landry
Building Mobile Cross-Platform Geospatial Apps, Nick LandryBuilding Mobile Cross-Platform Geospatial Apps, Nick Landry
Building Mobile Cross-Platform Geospatial Apps, Nick Landry
Xamarin
 
Mapping in Drupal using OpenLayers
Mapping in Drupal using OpenLayersMapping in Drupal using OpenLayers
Mapping in Drupal using OpenLayers
Peter Vanhee
 
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Esri Nederland
 
FOSS4G-NA 2012 : ReadyMap - OpenLayers in 3D
FOSS4G-NA 2012 : ReadyMap - OpenLayers in 3DFOSS4G-NA 2012 : ReadyMap - OpenLayers in 3D
FOSS4G-NA 2012 : ReadyMap - OpenLayers in 3D
Glenn Waldron
 
Concepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into MapsConcepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into Maps
Mohammad Liton Hossain
 
Online mapping with_the_google_maps_api
Online mapping with_the_google_maps_apiOnline mapping with_the_google_maps_api
Online mapping with_the_google_maps_api
Celny Quispe
 
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
Google Developer Relations Team
 
Maps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkokMaps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkok
ss318
 
Mapping mobile robotics
Mapping mobile roboticsMapping mobile robotics
Mapping mobile robotics
Devasena Inupakutika
 
Precisely MapInfo Pro v2019 and Roadmap
Precisely MapInfo Pro v2019 and RoadmapPrecisely MapInfo Pro v2019 and Roadmap
Precisely MapInfo Pro v2019 and Roadmap
Peter Horsbøll Møller
 
Day4_WebGIS
Day4_WebGISDay4_WebGIS
Day4_WebGIS
Jalal Eddin Omari
 
We are the music makers and we are the dreamers of dreams
We are the music makers and we are the dreamers of dreamsWe are the music makers and we are the dreamers of dreams
We are the music makers and we are the dreamers of dreams
Texas Natural Resources Information System
 
Open@EDINA
Open@EDINAOpen@EDINA
An online viewer for Geospatial Vector Data using HTML5 Canvas and JavaScript
An online viewer for Geospatial Vector Data using HTML5 Canvas and JavaScript An online viewer for Geospatial Vector Data using HTML5 Canvas and JavaScript
An online viewer for Geospatial Vector Data using HTML5 Canvas and JavaScript
Manikanta Kondeti
 
Google Geo APIs Overview
Google Geo APIs OverviewGoogle Geo APIs Overview
Google Geo APIs Overview
Ossama Alami
 
Mapping in Drupal 7 using OpenLayers
Mapping in Drupal 7 using OpenLayersMapping in Drupal 7 using OpenLayers
Mapping in Drupal 7 using OpenLayers
Peter Vanhee
 

Similar to Performance and Scalability for Maps API Sites (Dev Fest '10 Mexico) (20)

Web enabling your survey business ppt version
Web enabling your survey business ppt versionWeb enabling your survey business ppt version
Web enabling your survey business ppt version
 
Location Based Services Without the Cocoa
Location Based Services Without the CocoaLocation Based Services Without the Cocoa
Location Based Services Without the Cocoa
 
Drupal and the GeoSpatial Web
Drupal and the GeoSpatial WebDrupal and the GeoSpatial Web
Drupal and the GeoSpatial Web
 
3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.
 
Building Mobile Cross-Platform Geospatial Apps, Nick Landry
Building Mobile Cross-Platform Geospatial Apps, Nick LandryBuilding Mobile Cross-Platform Geospatial Apps, Nick Landry
Building Mobile Cross-Platform Geospatial Apps, Nick Landry
 
Mapping in Drupal using OpenLayers
Mapping in Drupal using OpenLayersMapping in Drupal using OpenLayers
Mapping in Drupal using OpenLayers
 
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
 
FOSS4G-NA 2012 : ReadyMap - OpenLayers in 3D
FOSS4G-NA 2012 : ReadyMap - OpenLayers in 3DFOSS4G-NA 2012 : ReadyMap - OpenLayers in 3D
FOSS4G-NA 2012 : ReadyMap - OpenLayers in 3D
 
Concepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into MapsConcepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into Maps
 
Online mapping with_the_google_maps_api
Online mapping with_the_google_maps_apiOnline mapping with_the_google_maps_api
Online mapping with_the_google_maps_api
 
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
 
Maps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkokMaps API on_mobile_dev_festbangkok
Maps API on_mobile_dev_festbangkok
 
Mapping mobile robotics
Mapping mobile roboticsMapping mobile robotics
Mapping mobile robotics
 
Precisely MapInfo Pro v2019 and Roadmap
Precisely MapInfo Pro v2019 and RoadmapPrecisely MapInfo Pro v2019 and Roadmap
Precisely MapInfo Pro v2019 and Roadmap
 
Day4_WebGIS
Day4_WebGISDay4_WebGIS
Day4_WebGIS
 
We are the music makers and we are the dreamers of dreams
We are the music makers and we are the dreamers of dreamsWe are the music makers and we are the dreamers of dreams
We are the music makers and we are the dreamers of dreams
 
Open@EDINA
Open@EDINAOpen@EDINA
Open@EDINA
 
An online viewer for Geospatial Vector Data using HTML5 Canvas and JavaScript
An online viewer for Geospatial Vector Data using HTML5 Canvas and JavaScript An online viewer for Geospatial Vector Data using HTML5 Canvas and JavaScript
An online viewer for Geospatial Vector Data using HTML5 Canvas and JavaScript
 
Google Geo APIs Overview
Google Geo APIs OverviewGoogle Geo APIs Overview
Google Geo APIs Overview
 
Mapping in Drupal 7 using OpenLayers
Mapping in Drupal 7 using OpenLayersMapping in Drupal 7 using OpenLayers
Mapping in Drupal 7 using OpenLayers
 

Recently uploaded

Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 

Recently uploaded (20)

Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 

Performance and Scalability for Maps API Sites (Dev Fest '10 Mexico)

  • 1. Performance and Scalability for Maps API Sites Ossama Alami Developer Advocate, Google @ossamaalami @googlemapsapi
  • 2. “Every millisecond counts” Google User Experience Guidelines http://www.google.com/corporate/ux.html
  • 4. Lots of Resources V2: Simple Map V3: Simple Map
  • 5. Maps API v3 • Latency #1 priority • Aggressive modularization • Latency features • Mobile Web (iPhone, Android)
  • 7. Problem: GMarker/Marker = <img>*5 + <map>*1
  • 8. Solution: Light Weight Marker Many Markers Comparison V2 V3
  • 9. Creating a Custom Overlay First, subclass OverlayView: 1. function MarkerLight(latlng, opts, map) { 2. this.latlng = latlng; 3. if (!opts) opts = {}; 4. this.map_ = map; 5. 6. this.height_ = opts.height || 32; 7. this.width_ = opts.width || 32; 8. this.image_ = opts.image; 9. 10. this.setMap(map); 11.} 12. 13.MarkerLight.prototype = new google.maps.OverlayView();
  • 10. Creating a Custom Overlay Then implement onAdd() and onRemove() called by the API: 1. MarkerLight.prototype.onAdd = function() { 2. // Create the DIV representing our MarkerLight 3. var div = document.createElement("div"); 4. div.style.border = "1px solid white"; 5. div.style.position = "absolute"; 6. div.style.paddingLeft = "0px"; 7. div.style.cursor = 'pointer'; 8. 9. var img = document.createElement("img"); 10. img.src = this.image_; 11. img.style.width = this.width_ + "px"; 12. img.style.height = this.height_ + "px"; 13. div.appendChild(img); 14. 15. var panes = this.getPanes(); 16. panes.overlayLayer.appendChild(div); 17. 18. this.div_ = div; 19. }; 20. 21. MarkerLight.prototype.onRemove = function() { 22. this.div_.parentNode.removeChild(this.div_); 23. this.div_ = null; 24. };
  • 11. Creating a Custom Overlay Then implement draw() and position the DIV: 1. MarkerLight.prototype.draw = function() { 2. var overlayProjection = this.getProjection(); 3. 4. // Calculate the DIV coordinates of two opposite corners 5. // of our bounds to get the size and position of our MarkerLight 6. var divPixel = overlayProjection.fromLatLngToDivPixel(this.latlng); 7. 8. // Now position our DIV based on the DIV coordinates of our bounds 9. this.div_.style.width = this.width_ + "px"; 10. this.div_.style.left = (divPixel.x) + "px"; 11. this.div_.style.height = (this.height_) + "px"; 12. this.div_.style.top = (divPixel.y) - this.height_ + "px"; 13. }; Then, just create the Marker: 1. var marker = new MarkerLight(latlng, 2. {image:"bluecirclemarker.png"}, map));
  • 12. Solution: Light Weight Marker Many Markers Comparison V2 V3
  • 13. Light Weight Marker for Flash, Too! MadoffMap
  • 14. Problem: Too Many DOM Nodes
  • 15. Solution: Clustering AuthorMapper
  • 17. Solution: Grid Based Clustering MarkerClusterer V2 V3
  • 18. Solution: Regional Clustering US Pizzas Travellr
  • 19. More Clustering Resources Article: Handling Large Amounts of Markers Python k-means Maptimize
  • 20. Solution: View Only Visualization FundRace
  • 21. Solution: View Only Visualization HeatMapAPI Boston Pizza NY Times Taxi Map
  • 22. Solution: Clickable Marker Layer Clickable Tile Layer Google Local Search
  • 26. Problem: Too Many Points 13500 points 2200 points
  • 27. Solution: Data Simplification MapShaper MapSimplification Mapping the Votes: Resources
  • 28. Solution: Encoded Polys Encoded Poly Example
  • 29. Problem: Browsers + Vector Graphics VML SVG Canvas
  • 30. Solution: Maps API for Flash Thematic Mapping HowSFVotes
  • 31. Solution: Earth API Map of The Fallen
  • 33. Static Data Tiles: Counties Example Zoom 5 Zoom 9 Zoom 6 Zoom 8 Zoom 7 Generated County Tiles • Tiles generated with Perl script using data in PostGRE database for zoom levels 5-9
  • 35. Hosting Geo Data Google Maps Data API • Stores geo data and associated attributes. • Supports geospatial and attribute queries • Storage scales simply with usage. • Geodata is accessible across platforms and devices. • Geodata from the Google Maps Data API can be instantly indexed and made searchable in Google Maps. App Engine • Host and run your web applications on Google's infrastructure. • Easy to build, maintain and scale. Highly customizable. • Supports Python and Java • Libraries available to make geospatial queries easier on App Engine o http://code.google.com/p/geodatastore/ o http://code.google.com/p/geomodel/
  • 36. Developer Qualification Community Driven.