Craft Geoman banner
handplant handplant

Craft Geoman

Development community

Description

This plugin adds a “Geoman” field type to Craft CMS, which provides geometry editing powered by leaflet-geoman by geoman.io.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Craft Geoman

This plugin adds a “Geoman” field type to Craft CMS, which provides geometry editing powered by [leaflet-geoman](https://geoman.io/leaflet-geoman) by geoman.io.

Requirements

This plugin requires Craft CMS 4.0 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Craft Geoman”. Then click on the “Install” button in its modal window.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project

# tell Composer to load the plugin
composer require handplant/craft-geoman

# tell Craft to install the plugin
./craft plugin/install craft-geoman

Simple frontend example




{{ entry.geoman }}
var map = L.map(document.getElementById('map')).setView([47.9034, 8.10577], 10); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: 'Data ©OpenStreetMap', maxZoom: 18 }).addTo(map); var layer = L.featureGroup().addTo(map); var geojson = document.getElementById('geojson'); if (geojson.innerHTML) { var geojsonLayer = L.geoJson(JSON.parse(geojson.innerHTML), { pointToLayer: (feature, latlng) => { if (feature.properties.radius) { return new L.Circle(latlng, feature.properties.radius) } else if (feature.properties.shape == "CircleMarker") { return new L.CircleMar