gerber-map
gerber-map copied to clipboard
Leaflet.js hacked into a multilayer SVG viewer with annotations, for use with PCB Gerber files
gerber-map
About
This project uses Leaflet to render PCB design files turned into SVGs by gerber-to-svg.
Demo
A demo of the repo contents is available at http://roysmeding.nl/gerber-map/.
Files
-
data/power_stage_rev1_2015-03-20.jsonThis is the JSON file linked from index.html. It specifies the SVG filename, name and colour for each layer, as well as the positions, texts and types for all of the layout notes.In case you're curious, the design files are from one of my electronics projects, an induction heater power stage board.
-
index.htmlThis is the main HTML file. It includes the necessary JS and CSS, and contains a map div that points to the metadata JSON file using a data attribute. -
gerber-viewer.jsThe JavaScript file for the Gerber viewer class. After the document is loaded, the code here looks for all divs with the 'board-viewer' class, retrieves their associated JSON files, and sets up a Leaflet map with the listed layers and markers for each one. In addition, it contains some definitions for the coordinate transformation used, as well as the note markers. -
gerber-layer.jsThe JavaScript file for the Gerber layer class. It gets passed all the info it needs for one layer, then loads it asynchronously. It also contains the code for how the layer responds to zooming and such. -
viewer.cssGerber-viewer-specific CSS goes in here. It's mostly stuff for how large the map view is, and how the notes list is laid out. -
leaflet.css,leaflet.js,leaflet-src.jsThese are just Leaflet's files, unchanged from how they were downloaded. -
data/*.svgThe SVG files pointed to by the JSON file. -
images/*This directory contains the icons for the 'warning' and 'error' markers. -
README.mdYou're reading it :) -
LICENSE.mdThe license. This software is licensed under the MIT License.
Author
Written by Roy Smeding