Who is Your Closest Team?

If you have ever wondered which baseball team you should support then you need Maptitude’s Closest Major or Minor League Baseball Stadium by Drive Time map. The map shows you which affiliated major or minor baseball stadium you can drive to in the quickest time in the contiguous United States.The map is a sort of combination of a voronoi diagram and an isochrone map. However, Maps Mania… more →
Posted in: Interactive Maps

JavaScript closest

When it comes to finding relationships between elements, we traditionally think of a top-down approach. We can thank CSS and querySelector/querySelectorAll for that relationship in selectors. What if we want to find an element’s parent based on selector? To look up the element tree and find a parent by selector, you can use HTMLElement‘s closest method: // Our sample element is an "a" tag that matches ul > li > a const link = document.querySelector('li a'); const list = a.closest('ul'); closest looks up the ancestor chain to find a matching parent element — the opposite of traditional CSS selectors. You can provide closest a simple or complex selector to look upward... more →
Posted in: JavaScript