Tuesday, July 13, 2021

Replicating The Nyt's Java Map


I was impressed today amongst the elementary blueprint of the New York Times' 101 Places to Find Great Coffee inward New York. I actually similar how the paper has used the Leaflet mapping platform to exercise a gray-scale map, amongst non-essential areas masked out together with route names which exclusively appear when you lot zoom inward on the map.

One of my origin thoughts was to wonder if you lot could exercise a similar looking map amongst the Google Maps API. The New York Knockout Map is the result. To enshroud the non-important areas of the map I used Vasile Cotovanu's polygon masking wizard Geomask. Using Geomask it is possible to exercise a doughnut type polygon which exclusively shows the map through the hole inward the doughnut polygon. The trial is that the areas to the W of Manhattan are hidden from persuasion on my finished map.

I used the Google Maps API Styled Map sorcerer to exercise the gray-scale map tiles together with to enshroud the route get upwardly labels on the map. However I exercise desire the route names to appear on the map when the user zooms in, thence I had to exercise an trial listener to depository fiscal establishment tally when the zoom levels is changed. I thence created around other map means amongst the route get upwardly labels turned on. Using the zoom trial listener I tin thence switch betwixt the ii map styles (one amongst route get upwardly labels together with i without) depending on the zoom score of the map.

I quite similar the results together with intend it is a fairly accurate reproduction of the New York Times' java map. All I demand straightaway is around information to map.

No comments:

Post a Comment