SlideShare una empresa de Scribd logo
1 de 53
Descargar para leer sin conexión
Fast Map Interaction
                               Without Flash
                        Tom MacWright @tmcw from MapBox @mapbox




Wednesday, April 20, 2011
Solutions That Aren’t



Wednesday, April 20, 2011
Flash is a dead end

                    • Hopefully this goes without saying
                    • Maps are especially mobile
                    • We don’t tolerate closed-source
                            components




Wednesday, April 20, 2011
Vectors aren’t there yet
                    • Internet Explorer still owns 45% of the
                            market
                    • Polymaps is working on IE9
                    • Even bleeding-edge browsers are still in
                            early stages of optimization
                    • Passable for points, but rendering
                            OpenStreetMap in-browser?


Wednesday, April 20, 2011
Polygons in-Browser
                    • GeoJSON is nifty but bandwidth-inefficient
                    • Browser APIs are weak (VML?)
                    • Calculating polygon collisions is code-heavy
                            and slow
                    • Simplifying polygons to speed up browsers
                            doesn’t cut it


Wednesday, April 20, 2011
Wednesday, April 20, 2011
Wednesday, April 20, 2011
WMS GetFeatureInfo




Wednesday, April 20, 2011
WMS GetFeatureInfo

                    • Not cacheable: requires a running web
                            server
                    • Hover interaction near-impossible
                    • Just as friendly and great as WMS itself


Wednesday, April 20, 2011
“Designing Around It”

                    • Zooming out makes points disappear?
                    • Clustering for performance reasons?
                    • Restricting panning?


Wednesday, April 20, 2011
Inspiration: Google



Wednesday, April 20, 2011
Wednesday, April 20, 2011
Wednesday, April 20, 2011
Wednesday, April 20, 2011
• Awesome idea!
                    • Undocumented
                    • Only supports points
                    • A single type of data


Wednesday, April 20, 2011
http://bit.ly/utfgrid

                            UTFGrid
Wednesday, April 20, 2011
Wednesday, April 20, 2011
Rasterized Tiles
                           +
                Pixel-Driven Interaction

Wednesday, April 20, 2011
Wednesday, April 20, 2011
Wednesday, April 20, 2011
Wednesday, April 20, 2011
JSON, in the nick of time!




Wednesday, April 20, 2011
where am I, in this tile?




Wednesday, April 20, 2011
Wednesday, April 20, 2011
Wednesday, April 20, 2011
letters are numbers after all




Wednesday, April 20, 2011
Wednesday, April 20, 2011
application-specific formatting




Wednesday, April 20, 2011
Hooray!




Wednesday, April 20, 2011
Size Optimizations

                    • One UTF-8 character per feature
                    • 256px / 256px tiles
                    • 2x2 pixel grid (users aren’t pixel-precise)
                    • gzip

Wednesday, April 20, 2011
Lower bound

                               256 2   1kb
                             (    ) ∗       = 16kb
                                2     1024b
                                    Upper bound

                              256 2   1kb
                            (    ) ∗       ∗ 2 = 32kb
                               2     1024b


Wednesday, April 20, 2011
non-scientific survey of observed file size
                                        (aka, thanks, gzip)

                       3


                  2.25


    #req            1.5


                  0.75


                       0
                             4   5   6   7   8   9   10   11   12   13   14   15   16   17   18

                                                     in kb
Wednesday, April 20, 2011
Wednesday, April 20, 2011
• Grid size is limited by the number of pixel
                            blocks, so zooming out to the US actually
                            can work

                    • The grid also works for points, and
                            lines too




Wednesday, April 20, 2011
13k points




Wednesday, April 20, 2011
Speed
                    • Once you have the grid, the mouse
                            coordinate, and the tile coordinate, there
                            are no loops required to find the grid
                            feature, if any.
                    • Grid computations are typically outweighed
                            by the time taken to display tooltips
                    • Once a grid is generated, it doesn’t need to
                            change. It could be a file sitting on S3.


Wednesday, April 20, 2011
... about that ‘application specific formatting’




                    • Designed to be usable outside of a browser
                    • And much more than just tooltips
                    • You get ‘just data’ from the server, not
                            HTML




Wednesday, April 20, 2011
// Bring your own JavaScript
                            function (options, data) {
                                ...
                                return formatted_output;
                            }




Wednesday, April 20, 2011
function (options, data) {
                if (options.format == 'teaser') {
                    return '<h1>' + data.NAME + '</h1>';
                } else if (options.format == 'full') {
                    return '<h1>' + data.NAME + '</h1>' + data.AREA;
                }
            }




Wednesday, April 20, 2011
“The Implementation”



Wednesday, April 20, 2011
Generating: Mapnik
                                      http://mapnik.org/

                    • Mapnik is everyone’s favorite world-beating
                            open source map renderer
                    • Initially we rendered the map, and then
                            queried a 642 grid. It was slow.
                    • Dane Springmeyer has been writing a grid
                            renderer deep in AGG which is way faster.



Wednesday, April 20, 2011
Parsing: APIs
                              http://github.com/mapbox/wax


                    •       Google Maps API v3
                    • OpenLayers
                    • Modest Maps


Wednesday, April 20, 2011
• (let’s do it!)




Wednesday, April 20, 2011
(sidenote: APIs)

                    • Grids reduce the role of mapping APIs:
                            their parsing task is reduced to <200 lines
                    • Do one thing, and do it well: provide a tiling
                            interface
                    • Thus, for our usage,
                            Modest Maps > OpenLayers.



Wednesday, April 20, 2011
Making Grids:
                                  TileMill
                            http://tilemill.com/


Wednesday, April 20, 2011
Wednesday, April 20, 2011
Wednesday, April 20, 2011
Using Grids
                 TileStream, iPad, & Wax


Wednesday, April 20, 2011
Or, make your own?

                    • Grid implementation in Mapnik core - with
                            bindings to nodejs and Python (LGPL &
                            BSD licensed)
                    • Grid reader implementations in Wax,
                            supporting Google Maps, OpenLayers, and
                            Modest Maps (BSD licensed)



Wednesday, April 20, 2011
• No seriously, it’s open source.




Wednesday, April 20, 2011
URLS!

                    • http://mbtiles.org/ (read the full spec)
                    • http://tilemill.com/
                    • http://github.com/mapbox/


Wednesday, April 20, 2011
Rough Edges!

                    • Can’t highlight features yet
                    • More APIs! (except Bing, because of TOS)
                    • Formatter spec needs security spec -
                            currently relies on trust
                    • Contributions welcome!

Wednesday, April 20, 2011
Thanks!
                                 @mapbox

                            @tmcw Tom MacWright


Wednesday, April 20, 2011

Más contenido relacionado

Similar a Fast Map Interaction without Flash

JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forwardeug3n_cojocaru
 
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011Guillaume Laforge
 
In the land of the blind the squinter rules
In the land of the blind the squinter rulesIn the land of the blind the squinter rules
In the land of the blind the squinter ruleswremes
 
Building Scalable Systems: an asynchronous approach
Building Scalable Systems: an asynchronous approachBuilding Scalable Systems: an asynchronous approach
Building Scalable Systems: an asynchronous approachTheo Schlossnagle
 
PyCon 2011 Scaling Disqus
PyCon 2011 Scaling DisqusPyCon 2011 Scaling Disqus
PyCon 2011 Scaling Disquszeeg
 
Node js techtalksto
Node js techtalkstoNode js techtalksto
Node js techtalkstoJason Diller
 
Java EE and Google App Engine
Java EE and Google App EngineJava EE and Google App Engine
Java EE and Google App EngineArun Gupta
 
Milkyway@home rcos presentation_4_8_2011
Milkyway@home rcos presentation_4_8_2011Milkyway@home rcos presentation_4_8_2011
Milkyway@home rcos presentation_4_8_2011mskmoorthy
 
RepRap Presentation UJEP
RepRap Presentation UJEPRepRap Presentation UJEP
RepRap Presentation UJEPJosef Průša
 
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGuillaume Laforge
 
Intro to HTML5 Game Programming
Intro to HTML5 Game ProgrammingIntro to HTML5 Game Programming
Intro to HTML5 Game ProgrammingJames Williams
 
Webinar Mobile ECM Apps with Nuxeo EP
Webinar Mobile ECM Apps with Nuxeo EPWebinar Mobile ECM Apps with Nuxeo EP
Webinar Mobile ECM Apps with Nuxeo EPNuxeo
 
DCI - Data, Context and Interaction @ Jug Genova April 2011
DCI - Data, Context and Interaction @ Jug Genova April 2011DCI - Data, Context and Interaction @ Jug Genova April 2011
DCI - Data, Context and Interaction @ Jug Genova April 2011Fabrizio Giudici
 

Similar a Fast Map Interaction without Flash (20)

Geolinkeddata 07042011 1
Geolinkeddata 07042011 1Geolinkeddata 07042011 1
Geolinkeddata 07042011 1
 
GeoLinkedData
GeoLinkedDataGeoLinkedData
GeoLinkedData
 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
 
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
 
In the land of the blind the squinter rules
In the land of the blind the squinter rulesIn the land of the blind the squinter rules
In the land of the blind the squinter rules
 
Building Scalable Systems: an asynchronous approach
Building Scalable Systems: an asynchronous approachBuilding Scalable Systems: an asynchronous approach
Building Scalable Systems: an asynchronous approach
 
PyCon 2011 Scaling Disqus
PyCon 2011 Scaling DisqusPyCon 2011 Scaling Disqus
PyCon 2011 Scaling Disqus
 
Web heresies
Web heresiesWeb heresies
Web heresies
 
Godoggo
GodoggoGodoggo
Godoggo
 
Node js techtalksto
Node js techtalkstoNode js techtalksto
Node js techtalksto
 
Web Storage
Web StorageWeb Storage
Web Storage
 
Java EE and Google App Engine
Java EE and Google App EngineJava EE and Google App Engine
Java EE and Google App Engine
 
Milkyway@home rcos presentation_4_8_2011
Milkyway@home rcos presentation_4_8_2011Milkyway@home rcos presentation_4_8_2011
Milkyway@home rcos presentation_4_8_2011
 
RepRap Presentation UJEP
RepRap Presentation UJEPRepRap Presentation UJEP
RepRap Presentation UJEP
 
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
 
Intro to HTML5 Game Programming
Intro to HTML5 Game ProgrammingIntro to HTML5 Game Programming
Intro to HTML5 Game Programming
 
Hadoop at Nokia
Hadoop at NokiaHadoop at Nokia
Hadoop at Nokia
 
Webinar Mobile ECM Apps with Nuxeo EP
Webinar Mobile ECM Apps with Nuxeo EPWebinar Mobile ECM Apps with Nuxeo EP
Webinar Mobile ECM Apps with Nuxeo EP
 
DCI - Data, Context and Interaction @ Jug Genova April 2011
DCI - Data, Context and Interaction @ Jug Genova April 2011DCI - Data, Context and Interaction @ Jug Genova April 2011
DCI - Data, Context and Interaction @ Jug Genova April 2011
 
Stardog talk-dc-march-17
Stardog talk-dc-march-17Stardog talk-dc-march-17
Stardog talk-dc-march-17
 

Más de Development Seed

Rasters are not Monsters - GeoMTL 2019
Rasters are not Monsters - GeoMTL 2019Rasters are not Monsters - GeoMTL 2019
Rasters are not Monsters - GeoMTL 2019Development Seed
 
Cartography with TileMill, PostGIS, and OpenStreetMap
Cartography with TileMill, PostGIS, and OpenStreetMapCartography with TileMill, PostGIS, and OpenStreetMap
Cartography with TileMill, PostGIS, and OpenStreetMapDevelopment Seed
 
Nonprofit Mapping at Net2DC Meetup
Nonprofit Mapping at Net2DC MeetupNonprofit Mapping at Net2DC Meetup
Nonprofit Mapping at Net2DC MeetupDevelopment Seed
 
Tilemill: Making Custom Transit Maps
Tilemill: Making Custom Transit MapsTilemill: Making Custom Transit Maps
Tilemill: Making Custom Transit MapsDevelopment Seed
 
Mapnik2 Performance, September 2011
Mapnik2 Performance, September 2011Mapnik2 Performance, September 2011
Mapnik2 Performance, September 2011Development Seed
 
Tech@State Preview of Designing Custom Maps with TileMill
Tech@State Preview of Designing Custom Maps with TileMillTech@State Preview of Designing Custom Maps with TileMill
Tech@State Preview of Designing Custom Maps with TileMillDevelopment Seed
 
ReliefWeb Drupal 7 Build Plan
ReliefWeb Drupal 7 Build PlanReliefWeb Drupal 7 Build Plan
ReliefWeb Drupal 7 Build PlanDevelopment Seed
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationDevelopment Seed
 
Offline Mapping: International Crisis
Offline Mapping: International CrisisOffline Mapping: International Crisis
Offline Mapping: International CrisisDevelopment Seed
 
Aegir one drupal to rule them all
Aegir one drupal to rule them allAegir one drupal to rule them all
Aegir one drupal to rule them allDevelopment Seed
 
Backstage with Drupal localization- Part 2
Backstage with Drupal localization- Part 2Backstage with Drupal localization- Part 2
Backstage with Drupal localization- Part 2Development Seed
 
For every site a make file
For every site a make fileFor every site a make file
For every site a make fileDevelopment Seed
 
Go real time with pubsubhubbub and feeds
Go real time with pubsubhubbub and feedsGo real time with pubsubhubbub and feeds
Go real time with pubsubhubbub and feedsDevelopment Seed
 
Drupal Distributions: The Dos and Don'ts:
Drupal Distributions: The Dos and Don'ts:Drupal Distributions: The Dos and Don'ts:
Drupal Distributions: The Dos and Don'ts:Development Seed
 

Más de Development Seed (18)

Rasters are not Monsters - GeoMTL 2019
Rasters are not Monsters - GeoMTL 2019Rasters are not Monsters - GeoMTL 2019
Rasters are not Monsters - GeoMTL 2019
 
Cartography with TileMill, PostGIS, and OpenStreetMap
Cartography with TileMill, PostGIS, and OpenStreetMapCartography with TileMill, PostGIS, and OpenStreetMap
Cartography with TileMill, PostGIS, and OpenStreetMap
 
Nonprofit Mapping at Net2DC Meetup
Nonprofit Mapping at Net2DC MeetupNonprofit Mapping at Net2DC Meetup
Nonprofit Mapping at Net2DC Meetup
 
Famine Mapping with USAID
Famine Mapping with USAIDFamine Mapping with USAID
Famine Mapping with USAID
 
Tilemill: Making Custom Transit Maps
Tilemill: Making Custom Transit MapsTilemill: Making Custom Transit Maps
Tilemill: Making Custom Transit Maps
 
Mapnik2 Performance, September 2011
Mapnik2 Performance, September 2011Mapnik2 Performance, September 2011
Mapnik2 Performance, September 2011
 
Transparency camp
Transparency campTransparency camp
Transparency camp
 
Tech@State Preview of Designing Custom Maps with TileMill
Tech@State Preview of Designing Custom Maps with TileMillTech@State Preview of Designing Custom Maps with TileMill
Tech@State Preview of Designing Custom Maps with TileMill
 
ReliefWeb Drupal 7 Build Plan
ReliefWeb Drupal 7 Build PlanReliefWeb Drupal 7 Build Plan
ReliefWeb Drupal 7 Build Plan
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
 
Offline Mapping: International Crisis
Offline Mapping: International CrisisOffline Mapping: International Crisis
Offline Mapping: International Crisis
 
Aegir one drupal to rule them all
Aegir one drupal to rule them allAegir one drupal to rule them all
Aegir one drupal to rule them all
 
Backstage with Drupal localization- Part 2
Backstage with Drupal localization- Part 2Backstage with Drupal localization- Part 2
Backstage with Drupal localization- Part 2
 
For every site a make file
For every site a make fileFor every site a make file
For every site a make file
 
Go real time with pubsubhubbub and feeds
Go real time with pubsubhubbub and feedsGo real time with pubsubhubbub and feeds
Go real time with pubsubhubbub and feeds
 
Drupal Distributions: The Dos and Don'ts:
Drupal Distributions: The Dos and Don'ts:Drupal Distributions: The Dos and Don'ts:
Drupal Distributions: The Dos and Don'ts:
 
Open Atrium
Open Atrium Open Atrium
Open Atrium
 
Opening Large Data Sets
Opening Large Data SetsOpening Large Data Sets
Opening Large Data Sets
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Fast Map Interaction without Flash

  • 1. Fast Map Interaction Without Flash Tom MacWright @tmcw from MapBox @mapbox Wednesday, April 20, 2011
  • 3. Flash is a dead end • Hopefully this goes without saying • Maps are especially mobile • We don’t tolerate closed-source components Wednesday, April 20, 2011
  • 4. Vectors aren’t there yet • Internet Explorer still owns 45% of the market • Polymaps is working on IE9 • Even bleeding-edge browsers are still in early stages of optimization • Passable for points, but rendering OpenStreetMap in-browser? Wednesday, April 20, 2011
  • 5. Polygons in-Browser • GeoJSON is nifty but bandwidth-inefficient • Browser APIs are weak (VML?) • Calculating polygon collisions is code-heavy and slow • Simplifying polygons to speed up browsers doesn’t cut it Wednesday, April 20, 2011
  • 9. WMS GetFeatureInfo • Not cacheable: requires a running web server • Hover interaction near-impossible • Just as friendly and great as WMS itself Wednesday, April 20, 2011
  • 10. “Designing Around It” • Zooming out makes points disappear? • Clustering for performance reasons? • Restricting panning? Wednesday, April 20, 2011
  • 15. • Awesome idea! • Undocumented • Only supports points • A single type of data Wednesday, April 20, 2011
  • 16. http://bit.ly/utfgrid UTFGrid Wednesday, April 20, 2011
  • 18. Rasterized Tiles + Pixel-Driven Interaction Wednesday, April 20, 2011
  • 22. JSON, in the nick of time! Wednesday, April 20, 2011
  • 23. where am I, in this tile? Wednesday, April 20, 2011
  • 26. letters are numbers after all Wednesday, April 20, 2011
  • 30. Size Optimizations • One UTF-8 character per feature • 256px / 256px tiles • 2x2 pixel grid (users aren’t pixel-precise) • gzip Wednesday, April 20, 2011
  • 31. Lower bound 256 2 1kb ( ) ∗ = 16kb 2 1024b Upper bound 256 2 1kb ( ) ∗ ∗ 2 = 32kb 2 1024b Wednesday, April 20, 2011
  • 32. non-scientific survey of observed file size (aka, thanks, gzip) 3 2.25 #req 1.5 0.75 0 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 in kb Wednesday, April 20, 2011
  • 34. • Grid size is limited by the number of pixel blocks, so zooming out to the US actually can work • The grid also works for points, and lines too Wednesday, April 20, 2011
  • 36. Speed • Once you have the grid, the mouse coordinate, and the tile coordinate, there are no loops required to find the grid feature, if any. • Grid computations are typically outweighed by the time taken to display tooltips • Once a grid is generated, it doesn’t need to change. It could be a file sitting on S3. Wednesday, April 20, 2011
  • 37. ... about that ‘application specific formatting’ • Designed to be usable outside of a browser • And much more than just tooltips • You get ‘just data’ from the server, not HTML Wednesday, April 20, 2011
  • 38. // Bring your own JavaScript function (options, data) { ... return formatted_output; } Wednesday, April 20, 2011
  • 39. function (options, data) { if (options.format == 'teaser') { return '<h1>' + data.NAME + '</h1>'; } else if (options.format == 'full') { return '<h1>' + data.NAME + '</h1>' + data.AREA; } } Wednesday, April 20, 2011
  • 41. Generating: Mapnik http://mapnik.org/ • Mapnik is everyone’s favorite world-beating open source map renderer • Initially we rendered the map, and then queried a 642 grid. It was slow. • Dane Springmeyer has been writing a grid renderer deep in AGG which is way faster. Wednesday, April 20, 2011
  • 42. Parsing: APIs http://github.com/mapbox/wax • Google Maps API v3 • OpenLayers • Modest Maps Wednesday, April 20, 2011
  • 43. • (let’s do it!) Wednesday, April 20, 2011
  • 44. (sidenote: APIs) • Grids reduce the role of mapping APIs: their parsing task is reduced to <200 lines • Do one thing, and do it well: provide a tiling interface • Thus, for our usage, Modest Maps > OpenLayers. Wednesday, April 20, 2011
  • 45. Making Grids: TileMill http://tilemill.com/ Wednesday, April 20, 2011
  • 48. Using Grids TileStream, iPad, & Wax Wednesday, April 20, 2011
  • 49. Or, make your own? • Grid implementation in Mapnik core - with bindings to nodejs and Python (LGPL & BSD licensed) • Grid reader implementations in Wax, supporting Google Maps, OpenLayers, and Modest Maps (BSD licensed) Wednesday, April 20, 2011
  • 50. • No seriously, it’s open source. Wednesday, April 20, 2011
  • 51. URLS! • http://mbtiles.org/ (read the full spec) • http://tilemill.com/ • http://github.com/mapbox/ Wednesday, April 20, 2011
  • 52. Rough Edges! • Can’t highlight features yet • More APIs! (except Bing, because of TOS) • Formatter spec needs security spec - currently relies on trust • Contributions welcome! Wednesday, April 20, 2011
  • 53. Thanks! @mapbox @tmcw Tom MacWright Wednesday, April 20, 2011