TrueGIS

How to Use OpenLayers for Web GIS (Beginner’s Guide)

OpenLayers is one of the most powerful open-source libraries for web mapping. TrueGIS itself relies on OpenLayers under the hood. Here’s how you can use it.

Step 1: Basic Map Setup

<script src="https://cdn.jsdelivr.net/npm/ol@latest/ol.js"></script>
<div id="map" style="width:100%; height:400px"></div>

Step 2: Adding Layers

OpenLayers supports OSM, vector layers, and more. For example, a vector layer can display GeoJSON features that you draw in TrueGIS.

Step 3: Export & Integration

TrueGIS simplifies printing, but OpenLayers gives you maximum flexibility. Many developers combine both.

🔗 Related: Why TrueGIS Is Different