TrueGIS

A Minimal Leaflet App That’s Print-Friendly

Reading time: ~7 min

Leaflet is small, readable, and ideal for simple maps. This guide shows a minimal setup with vector overlays and styles that hold up when you print or export.

Core ideas

Minimal structure

<div id="map"></div>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script>
// init
const map = L.map('map').setView([51.5, -0.1], 12);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{
  maxZoom:19, attribution:'© OSM'
}).addTo(map);

// vector overlay
const geojson = {"type":"FeatureCollection","features":[ /* your features */ ]};
L.geoJSON(geojson,{
  style: {color:'#000', weight:2, opacity:1, fillOpacity:0.4}
}).addTo(map);
</script>

Print tips

Also see: Leaflet vs OpenLayers and Prepare GeoJSON for TrueGIS.