Using AI to Age OSM Maps / / No Comments The screenshot above, from the SynthMap Demo, shows a side-by-side view of an Open Street Map and an AI generated map of the same OSM data changed to look like a 19th Century era Ordnance Survey map. This Victorian cosplaying map (on the right) was developed by Zekun Li, of the University of Minnesota, who trained an AI to transform OpenStreetMap data into images that resemble the Maps Mania… more → Posted in: Interactive Maps Tagged with: maps, using
Adding URL Parameters to an Interactive Map / / No Comments It’s Saturday so I have decided to give myself a 30 minute break. Today I will only be spending ½ an hour on the One Hour AI Map Challenge. In these 30 minutes I want to create URL parameters for Meet in the Middle which will allow us to replace the Google Maps link for shared meeting points with a link back to our own map.Prompt No.1:how can i add url parameters to a leaflet.js map to show Maps Mania… more → Posted in: Interactive Maps Tagged with: Adding, Interactive, Parameters
Using Generative AI to Improve Image Filenames / / No Comments Last night I had an interesting thought. Many times I work with images that have vague filenames. For example, screenshot_1_24_12_23.jpg. Given that there are many APIs out there that can look at an image and provide a summary, what if we could use that to provide a better file name based on the content of the image? Here’s what I was able to find. As always, I began by prototyping in Google AI Studio. I apologize for stating this in basically every post on the topic, but I really want to stress how useful that is for development. I used a very simple prompt: Write a one sentence short summary of this image. The sentence should be no more than five words. And then did a quick test: If... more → Posted in: JavaScript Tagged with: Filenames, Generative, Image, improve, using
Fixing Cumulative Layout Shift Problems on DavidWalshBlog / / No Comments Over 50 thousand developers visit DavidWalshBlog every month from around the world to learn JavaScript tricks and fix problems in their code. Unfortunately, some of them have a slow experience on the site. David tracks the performance of his Core Web Vitals and overall performance with Request Metrics. Recently, we noticed that his CLS performance score was trending pretty slow for both desktop and mobile users. Wait, what is CLS? Cumulative Layout Shift (CLS) is one of the Core Web Vital performance metrics. It doesn’t measure load time directly, instead it measures how much a page shifts while it is being loaded. You’ve definitely seen this and been annoyed by it. These shifts... more → Posted in: JavaScript Tagged with: Cumulative, DavidWalshBlog, Fixing, layout, Problems, shift
Plasticine Earth / / No Comments Google Arts & Culture has used AI to turn the world into colorful dough. In this game your task is to identify famous cultural monuments around the world while turning unformed blobs of plasticine into colorful 3d models of the very same monuments.Each game of Google Un-Dough starts with a 3D plasticine globe. To begin the game you just need to spin this globe and select the country whose Maps Mania… more → Posted in: Interactive Maps Tagged with: Earth, Plasticine
Extract a Number from a String with JavaScript / / No Comments User input from HTML form fields is generally provided to JavaScript as a string. We’ve lived with that fact for decades but sometimes developers need to extract numbers from that string. There are multiple ways to get those numbers but let’s rely on regular expressions to extract those numbers! To employ a regular expression to get a number within a string, we can use \d+: const string = "x12345david"; const [match] = string.match(/(\d+)/); match; // 12345 Regular expressions are capable of really powerful operations within JavaScript; this practice is one of the easier operations. Converting the number using a Number() wrapper will give you the number as a Number type. The... more → Posted in: JavaScript Tagged with: Extract, from, JavaScript, Number, String
Mapping the Drift-backing of Refugees / / No Comments ‘Drift-back’ is a controversial practice which is used by some coast guard services, particularly in the Aegean Sea, to deter asylum seekers and prevent them from reaching their intended destination. It involves intercepting boats carrying asylum seekers within EU territorial waters, then forcing them back towards the country they departed from. This is sometimes allegedly done by loading Maps Mania… more → Posted in: Interactive Maps Tagged with: Driftbacking, Mapping, refugees
You Should Attend theJam.dev 2024! / / No Comments Next week, a very cool, and very free, online event is being held by the fine folks at Certified Fresh Events, theJam.dev 2024. This is a two-day online conference covering web development, AI, serverless, frameworks, and certainly more than just the Jamstack. Speakers include Cassidy Williams, Alex Russel, Zach Leatherman (creator of Eleventy!), Rizèl Scarlett, and more. I’ll be giving a quick lightning talk on generative AI and writing, and you can see the full schedule on the website. Did I mention it was free? Did I mention it was online? You’ve got no reason to miss this, so check it out! Raymond Camden… more → Posted in: JavaScript Tagged with: 2024, Attend, should, theJam.dev