whoami

Lucas Jenß

cat /etc/motd

The Coding Journal ツ — Notes taken on an epic coding journey. Technical solutions, debugging notes, and practical guides from the trenches of software development.

Close-up of white dominoes with black dots standing on green felt surface, shallow depth of field, focused mood

ls -la ~/languages/

total 8
drwxr-xr-x
▶ PHP
▶ Ruby
▶ Scala
▶ C#
▶ JavaScript
▶ Objective-C
▶ Shell Scripting

ls -la ~/toolchain/

total 7
drwxr-xr-x
▶ Typo3
▶ Akka
▶ Capistrano
▶ Git
▶ MAMP
▶ Adobe Illustrator
▶ NSTrackingArea (Cocoa)

uname -a

platforms
drwxr-xr-x
▶ Mac OS X
▶ Unix

Creating a static SVG map with Illustrator and clickable regions

A static SVG map offers crisp shapes, a compact file and native browser links without loading a full mapping library. The useful division of labour is to let Illustrator handle geometry, colours and artwork, then use HTML to add anchors, accessible names and interaction states. The result can behave like a small interactive graphic while remaining easy to cache and deploy.

Many failed attempts begin when an exported illustration is dropped into an <img> element. That file can look perfect, but its paths are not addressable by the surrounding page. Inline the SVG instead, preserve identifiable paths, and give every intended destination a real hyperlink. This also avoids the coordinate drift that plagues raster hotspots.

The workflow below covers creating clickable regions in HTML from Illustrator artwork without turning the illustration into a scripted application. It suits a hand-drawn site plan, venue guide or regional illustration rather than a tile map. Once the vector file has been prepared, ordinary HTML and CSS are enough to maintain the finished map.

Preparing artwork for a reliable SVG export

Start with a dedicated artboard for the map and isolate the artwork that should respond to clicks. A clickable region must be a closed, filled path or shape; a loose line or an open decorative stroke does not provide a dependable hit area. Keep boundaries between regions clear, and avoid placing two destinations on top of one another unless the topmost shape is intentionally the winner.

Before exporting, remove hidden objects, unused layers and stray clipping paths that might intercept pointer events. Keep every intended target as a separate object rather than merging it into the background. Choose Save As or Export As with SVG, use a small decimal precision to control file size, and retain the CSS properties or presentation attributes your theme expects.

Designing regions that are easy to click

Treat each logical destination as one SVG path with a stable identity. A region might represent a Melbourne office, a Sydney store or an entire council area, but the markup should describe that role rather than rely on its colour. Keep the visible artwork separate from the clickable geometry, and ensure each target can be selected independently in Illustrator.

Geometry matters as much as naming. Dense city maps can contain paths only a few pixels wide, particularly around Melbourne laneways or transit entrances. Where the design allows it, enlarge the interactive shape slightly without changing the visible artwork. If that would create ambiguity, add a transparent hit-area path and set pointer-events="all" so the browser receives the tap even when the painted outline is narrow.

Naming paths and adding accessible labels

After the SVG is exported, inspect its source and confirm that every target path has a unique id. Illustrator-generated names such as <path id="Layer_7"> are valid but poor maintenance hooks. Edit the XML directly or generate it from a small script, then preserve those IDs whenever the source file is re-exported. A naming convention shared by design and development prevents most “wrong shape opens” bugs.

Accessible labels belong beside the geometry, not in a colour legend. Add a <title> and <desc> to the root SVG, then give every <a> an aria-label with the destination name. If the SVG contains links, role="group" is usually more useful than role="img", because the latter may hide its descendants from assistive technology. Keep visible text readable with HTML text where possible.

Connecting SVG regions to HTML links

Paste the prepared SVG into the page and wrap each target path in an HTML-compatible SVG anchor. The code can remain completely static; no JavaScript is needed for ordinary navigation.

<svg viewBox="0 0 800 600" role="group"
     aria-labelledby="map-title map-desc">
  <title id="map-title">Office locations</title>
  <desc id="map-desc">Choose a location to view contact details.</desc>
  <a href="/offices/melbourne/" aria-label="Melbourne office">
    <path id="region-melbourne" class="map-region"
          d="M80 120H360V320H80Z"></path>
  </a>
</svg>

There are several delivery models, depending on how much control the surrounding page needs:

Approach Region interaction Scaling behaviour Main upkeep
Inline SVG Paths can contain normal anchors and accept CSS states Excellent with a viewBox and responsive width Region IDs and anchors live with the page
SVG in an <object> Internal SVG links work; CSS reaches the child document Good, although sizing and focus styling need care The SVG remains a separate file with its own link paths
Raster image with HTML hotspots Rectangular or polygonal hotspots use HTML coordinates Awkward on dense or high-density displays Coordinates must be recalculated whenever artwork changes

Several visual elements can be nested inside the same <a>, allowing them to share one destination. For new pages, use absolute URLs; for a single-page site, a fragment such as href="#melbourne" is enough. If a link opens another site in a new tab, add target="_blank" with rel="noopener noreferrer". Set the root SVG to display: block, width: 100% and height: auto so its viewBox controls the proportions.

Adding feedback for mouse and touch

Use CSS to make the response to input obvious without redesigning the illustration. A modest fill change on hover, a strong focus outline for keyboard navigation and a pointer cursor can all be attached to the target paths. Decorative layers should receive pointer-events="none", otherwise a transparent label or route line may block the region underneath it.

.map-region {
  cursor: pointer;
  transition: fill 150ms ease;
}
.map-region:hover {
  fill: #e85d04;
}
a:focus-visible .map-region {
  stroke: #005fcc;
  stroke-width: 4;
}

Small touch targets need a physical check, not just a browser preview. Rotate a phone, increase the text size and tap the narrowest boundaries. For animation, respect prefers-reduced-motion, and never remove the focus indicator. When an SVG behaves differently in a design review, save a minimal reproduction and compare it with the broader Ayuda GPlus library for related browser or tooling fixes.

A practical checklist for Australian deployment

A quick arvo sanity check is worthwhile for Australian visitors: “arvo” is casual local shorthand for the afternoon, while “no worries” is a natural tone for support notes. Test routes that reflect real places around Melbourne’s laneways, Sydney Harbour and Brisbane’s riverside, rather than using only a generic grid of dots. Include a clear text route to contact details for people who cannot use the graphic.

  • Maintain a source-to-export manifest that records every region, its destination, its unique SVG ID and the devices on which it has been tested.
  • Validate keyboard order so links follow a sensible geographic or reading sequence, and confirm that each focus state remains visible against the artwork.
  • Test in Safari on iPhone, Chrome on Android and a desktop browser commonly used by the client’s Australian office.
  • Record the Illustrator version, export settings and asset version beside the published file so a future export can be reproduced.

Local content details also prevent avoidable confusion. Spell out Queensland, New South Wales and Victoria on first use rather than relying only on QLD, NSW and VIC. Australian businesses commonly operate on .com.au or .au domains, so serve the map from the same origin where practical. If the graphic leads to booking, show prices in Australian dollars and make GST treatment clear; those expectations differ from some overseas markets.

Publishing the map and keeping it maintainable

Treat an external SVG as a normal site asset, cache it like other images, and keep a copy of the exported file with its source artwork. Inline SVG is convenient for interaction, while a separate document can be easier to manage inside an <object> element. Choose one approach deliberately and record the path convention used by links, especially when the map forms part of a larger TYPO3 or PHP deployment.

I keep related build notes and reusable fixes in the Coding Journal archive, which is useful when a map sits within a broader site rather than standing alone. Open the finished page in a browser, click every region, keyboard through every destination and check the smallest supported screen. Publish the tested asset, update the release note and point the site team to the source artwork.


cat ~/interests.json

KeyValue
editorTerminal-first workflow
osMac OS X / Unix
vcsGit, distributed version control
deployCapistrano, cron automation
graphicsSVG, Adobe Illustrator troubleshooting
networkingIP validation, SSH, VPN

git log --oneline --reverse

2013-10-30

Solving SVG import issues in Adobe Illustrator CS6 and CC

When importing an SVG into Illustrator, the operation fails with an unknown error [CANT]. A workaround for this Adobe-side bug.

2013

Solving NDK build issues on OS X

Troubleshooting native development kit compilation problems on Mac OS X.

2013

Programmatically adding PHP generated TypoScript to the backend configuration

Integrating dynamically generated TypoScript into Typo3 backend setups using PHP.

2013

ArgumentError: Could not parse PKey: no start line

Debugging an SSH key parsing error encountered during deployment.

2011-08-04

Validating IP-Addresses in PHP

Using PHP filter functions with flags like FILTER_FLAG_IPV4 and FILTER_FLAG_IPV6, and understanding how filter_var handles reserved IP addresses.

2011-07-09

Cocoa: Using NSTrackingArea

A short tutorial on using Cocoa's NSTrackingArea to capture mouseEntered and mouseExited events.


cat ~/contact.txt

github: github.com/x3ro
stackoverflow: x3ro
coderwall: coderwall.com/x3ro
twitter: @x3rames