<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mussadaq Awan</title>
    <description>The latest articles on DEV Community by Mussadaq Awan (@mussadiqkhan10).</description>
    <link>https://dev.to/mussadiqkhan10</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4264238%2Fff59125b-2ad3-40d4-a1a3-96f658b29d13.png</url>
      <title>DEV Community: Mussadaq Awan</title>
      <link>https://dev.to/mussadiqkhan10</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mussadiqkhan10"/>
    <language>en</language>
    <item>
      <title>How I Built an Interactive GTA 6 Map of Leonida with Next.js and Leaflet</title>
      <dc:creator>Mussadaq Awan</dc:creator>
      <pubDate>Wed, 25 Nov 2026 08:39:04 +0000</pubDate>
      <link>https://dev.to/mussadiqkhan10/how-i-built-an-interactive-gta-6-map-of-leonida-with-nextjs-and-leaflet-1p8m</link>
      <guid>https://dev.to/mussadiqkhan10/how-i-built-an-interactive-gta-6-map-of-leonida-with-nextjs-and-leaflet-1p8m</guid>
      <description>&lt;p&gt;GTA 6 came out on 19 November 2026, and within hours players were finding bunker codes, hidden Easter eggs and secret cars all over Leonida. I wanted one place where every find gets a pin on the real map and a full answer page. So I built &lt;a href="https://leonidaplayers.com" rel="noopener noreferrer"&gt;Leonida Players&lt;/a&gt;, a GTA 6 wiki, map and guide site. This post covers how the &lt;a href="https://leonidaplayers.com/map" rel="noopener noreferrer"&gt;interactive GTA 6 map&lt;/a&gt; works, since that was the most fun part to build.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.js 16&lt;/strong&gt; (App Router, server rendering) with React 19 and TypeScript&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Postgres 17&lt;/strong&gt; with Drizzle ORM (PGlite for local dev and tests, so no Docker on my PC)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leaflet&lt;/strong&gt; for the map&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sharp&lt;/strong&gt; for image processing and map tiles&lt;/li&gt;
&lt;li&gt;Cloudflare in front, caching public HTML for signed-out visitors&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Turning a poster into a slippy map
&lt;/h2&gt;

&lt;p&gt;Rockstar released an official printable map of Leonida. It's one big image, not a world with GPS coordinates. Leaflet normally expects latitude and longitude, but it also has &lt;code&gt;CRS.Simple&lt;/code&gt;, which treats the map as a flat picture with plain x/y pixels.&lt;/p&gt;

&lt;p&gt;So the pipeline is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take the poster image (5775 × 7900 pixels).&lt;/li&gt;
&lt;li&gt;Cut it into 256×256 WebP tiles at zoom levels 0 to 5 with sharp, where zoom 5 is full resolution.&lt;/li&gt;
&lt;li&gt;Serve the tiles as static files from &lt;code&gt;/map-tiles/{z}/{y}/{x}.webp&lt;/code&gt; with long cache headers.&lt;/li&gt;
&lt;li&gt;Point a Leaflet &lt;code&gt;TileLayer&lt;/code&gt; at them under &lt;code&gt;CRS.Simple&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;L&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;crs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;L&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CRS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Simple&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;minZoom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;maxZoom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;zoomSnap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.25&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="no"&gt;L&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tileLayer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/map-tiles/{z}/{y}/{x}.webp'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;tileSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;noWrap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bounds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;maxNativeZoom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fitBounds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bounds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  A coordinate system that survives re-tiling
&lt;/h2&gt;

&lt;p&gt;I didn't want pins stored in pixels, because pixels change if the tiles are ever rebuilt at a different size. Every pin is stored as &lt;strong&gt;0 to 1000 on each axis&lt;/strong&gt; of the poster instead. A small helper turns that into Leaflet's space:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// zoom 5 = full resolution, so scale the 0-1000 grid down by 2^5&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;kx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5775&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;ky&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7900&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;toLatLng&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ky&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;kx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// y runs down, lat runs up&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Editors and members can place a pin without knowing anything about tiles, and the same numbers work on the full map and on the small mini-maps shown on each wiki page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Being honest about precision
&lt;/h2&gt;

&lt;p&gt;Players often know a secret is "somewhere in the Keys" before anyone has the exact spot. Each pin therefore has a precision level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;exact&lt;/code&gt;: the spot itself&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;approximate&lt;/code&gt;: within a short drive&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;region&lt;/code&gt;: placed in the right region, with the route on the linked page&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;illustrative&lt;/code&gt;: shows the area, not a spot&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Anything that isn't &lt;code&gt;exact&lt;/code&gt; gets a dashed outline on the map, so nobody mistakes a regional pin for an exact spot. Each pin also has a short provenance note saying how it was found.&lt;/p&gt;

&lt;h2&gt;
  
  
  Every pin is a full page
&lt;/h2&gt;

&lt;p&gt;A pin on its own isn't an answer. Each one links to a wiki entry (a vehicle, collectible, secret, business or region) with the steps, rewards, tips and the player clip that proves it. Wiki entries show a mini-map of their own pin, and the first mention of any other wiki name in the text links to that entry automatically. That builds a dense internal-link web, which helps readers and search engines move around the site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open data
&lt;/h2&gt;

&lt;p&gt;I published the current pins as open data on GitHub: &lt;a href="https://github.com/MussadiqKhan10/gta6-map-data" rel="noopener noreferrer"&gt;gta6-map-data&lt;/a&gt;. That's 109 pins as JSON and CSV, with category, region, x/y on the 0–1000 grid, precision and a link to the full page. Use it for your own GTA 6 tools or mods; just credit the site.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Member-submitted pins with review, more mission pages and a patch-notes tracker. If you're building something for GTA 6 too, I'd love to see it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Leonida Players is an unofficial fan project, not affiliated with Rockstar Games.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>nextjs</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
