PHPackages                             jeromegillard/map - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jeromegillard/map

ActiveFlarum-extension[Utility &amp; Helpers](/categories/utility)

jeromegillard/map
=================

Display a map in Flarum.

v0.1.9(2y ago)45342[3 issues](https://github.com/JeromeGillard/flarum-map/issues)[1 PRs](https://github.com/JeromeGillard/flarum-map/pulls)MITJavaScript

Since Oct 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/JeromeGillard/flarum-map)[ Packagist](https://packagist.org/packages/jeromegillard/map)[ RSS](/packages/jeromegillard-map/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (4)Versions (13)Used By (0)

Flarum Map extension
====================

[](#flarum-map-extension)

[![MIT license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/JeromeGillard/flarum-map/blob/main/LICENSE.md) [![Latest Stable Version](https://camo.githubusercontent.com/763c225994253fbe4fd35aa12189258f829ac2c7e8047b731520d1ee10ddc252/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a65726f6d6567696c6c6172642f6d61702e737667)](https://packagist.org/packages/jeromegillard/map) [![Total Downloads](https://camo.githubusercontent.com/5ae275f5d1d1497c31558ed90bfbfd023a8f608fe50a3ab37059c1400a85f429/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a65726f6d6567696c6c6172642f6d61702e737667)](https://packagist.org/packages/jeromegillard/map) [![](https://camo.githubusercontent.com/b64ba708da0746e6958b87afd72c749bae793e3c7de252c1f800d97893d46840/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f6a65726f6d6567696c6c6172642f666c6172756d2d6d6170)](https://github.com/JeromeGillard/flarum-map/issues) [![](https://camo.githubusercontent.com/cc404b6ac3d029a4bf916dcf7cf79c6d5c91131f6f669631c505b4bb3ec75074/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722d7261772f6a65726f6d6567696c6c6172642f666c6172756d2d6d6170)](https://github.com/JeromeGillard/flarum-map/pulls)

A [Flarum](http://flarum.org) extension. Display a map in flarum in those ways:

- insert a BBCode in a post
- upload a `.gpx` file to display it on a map and a download link
- upload a `GeoJSON` file (`.geojson` of `.json`) display it on a map and a download link

[![Snaphost](https://raw.githubusercontent.com/JeromeGillard/flarum-map/main/assets/readme-marker-example.png)](https://raw.githubusercontent.com/JeromeGillard/flarum-map/main/assets/readme-marker-example.png)[![Snaphost](https://raw.githubusercontent.com/JeromeGillard/flarum-map/main/assets/readme-snapshot.png)](https://raw.githubusercontent.com/JeromeGillard/flarum-map/main/assets/readme-snapshot.png)

To include a map in your post, there's an icon in the bar when composing: [![Post icon](https://raw.githubusercontent.com/JeromeGillard/flarum-map/main/assets/readme-post-icon.png)](https://raw.githubusercontent.com/JeromeGillard/flarum-map/main/assets/readme-post-icon.png)

It will insert that BBCode:

```
[map provider=osm style=street zoom=13 title='Marker title' desc='Marker pop-up content. Leave title and desc both empty to hide the marker.']WHERE[/map]

```

The `WHERE` value can be any location:

- `Nonceveux, Liège, Belgium` as a plain text place name.
- `50.45626367636966, 5.744007900692774` as coordinates to pin point an exact place.

You can also change the zoom level by changing the `zoom` attribute within the BBCode:

```
# Zoom=13 can fit my village
[map provider=osm style=street zoom=13]Nonceveux[/map]

# Zoom=8 can fit my country
[map provider=osm style=street zoom=8]Belgium[/map]

```

Valid values for `zoom` are between `0` (world) and `18` (house).

How to customize the map
========================

[](#how-to-customize-the-map)

The post above was written like this:

```
# Mapbox satelite streets (need to register at MapBox.com to get a free API key) :
[map provider=mapbox style=mapbox/satellite-streets-v11 zoom=15]Nonceveux, Liège, Belgium[/map]

# GPX example:
[upl-file uuid=e89405b4-7c99-4af6-9fb3-8bd80df9ea64 size=2kB url=http://localhost/assets/files/2022-10-31/1667250318-401743-gpxexample.gpx]gpxexample.gpx[/upl-file]

# GeoJSON example:
[upl-file uuid=022d8589-8c9c-4e63-b0ad-1942b5a4b480 size=133kB url=http://localhost/assets/files/2022-10-11/1665509211-565647-trail-center-ambleve.geojson]trail-center-ambleve.geojson[/upl-file]

```

Supported tile layers
---------------------

[](#supported-tile-layers)

Free, no registration needed: OpenStreetMap.

ProviderStyleTiles typeDescription`osm``street`Rasters[OpenStreetMap](https://www.openstreetmap.org), default.### MapTiler

[](#maptiler)

Free, API key needed at

ProviderStyleTiles typeDescription`maptiler``basic-v2`Vectors[Basic (basic-v2)](https://cloud.maptiler.com/maps/basic-v2/)`maptiler``basic-4326`Vectors[Basic EPSG:4326 (basic-4326)](https://cloud.maptiler.com/maps/basic-4326/)`maptiler``bright-v2`Vectors[Bright (bright-v2)](https://cloud.maptiler.com/maps/bright-v2/)`maptiler``openstreetmap`Vectors[OpenStreetMap (openstreetmap)](https://cloud.maptiler.com/maps/openstreetmap/)`maptiler``outdoor`Vectors[Outdoor (outdoor)](https://cloud.maptiler.com/maps/outdoor/)`maptiler``pastel`Vectors[Pasterl (pastel)](https://cloud.maptiler.com/maps/pastel/)`maptiler``hybrid`Vectors[Satelite hybrid (hybrid)](https://cloud.maptiler.com/maps/hybrid/)`maptiler``streets-v2`Vectors[Street (streets-v2)](https://cloud.maptiler.com/maps/streets-v2/)`maptiler``toner`Vectors[Toner (toner)](https://cloud.maptiler.com/maps/toner/)`maptiler``topo`Vectors[Topo (topo)](https://cloud.maptiler.com/maps/topo/)`maptiler``topographique`Vectors[Topographique (topographique)](https://cloud.maptiler.com/maps/topographique/)`maptiler``voyager`Vectors[Voyager (voyager)](https://cloud.maptiler.com/maps/voyager/)`maptiler``winter`Vectors[Winter (winter)](https://cloud.maptiler.com/maps/winter/)### MapBox

[](#mapbox)

Free, API key needed at

ProviderStyleTiles typeDescription`mapbox``mapbox/streets-v11`Vectors[Streets (mapbox/streets-v11)](https://www.mapbox.com/maps/streets)`mapbox``mapbox/outdoors-v11`Vectors[Outdoors (mapbox/outdoors-v11)](https://www.mapbox.com/maps/outdoors)`mapbox``mapbox/light-v10`Vectors[Light (mapbox/light-v10)](https://www.mapbox.com/maps/light)`mapbox``mapbox/dark-v10`Vectors[Dark (mapbox/dark-v10)](https://www.mapbox.com/maps/dark)`mapbox``mapbox/satellite-v9`Vectors[Satelite (mapbox/satellite-v9)](https://www.mapbox.com/maps/satellite)`mapbox``mapbox/satellite-streets-v11`Vectors[Satelite streets (mapbox/satellite-streets-v11)](https://docs.mapbox.com/help/getting-started/satellite-imagery/)`mapbox``mapbox/navigation-day-v1`Vectors[Navigation day (mapbox/navigation-day-v1)](https://api.mapbox.com/styles/v1/mapbox/navigation-day-v1.html?access_token=pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p0MG01MXRqMW45cjQzb2R6b2ptc3J4MSJ9.zA2W0IkI0c6KaAhJfk9bWg#13/40.41695/-3.70192)`mapbox``mapbox/navigation-night-v1`Vectors[Navigation night (mapbox/navigation-night-v1)](https://api.mapbox.com/styles/v1/mapbox/navigation-night-v1.html?access_token=pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p0MG01MXRqMW45cjQzb2R6b2ptc3J4MSJ9.zA2W0IkI0c6KaAhJfk9bWg#13/40.41695/-3.70192)### ThunderForest

[](#thunderforest)

Free, API key needed at

ProviderStyleTiles typeDescription`thunderforest``cycle`Rasters[cycle](https://www.thunderforest.com/maps/opencyclemap/)`thunderforest``transport`Rasters[transport](https://www.thunderforest.com/maps/transport/)`thunderforest``landscape`Rasters[landscape](https://www.thunderforest.com/maps/landscape/)`thunderforest``outdoors`Rasters[outdoors](https://www.thunderforest.com/maps/outdoors/)`thunderforest``transport-dark`Rasters[transport-dark](https://www.thunderforest.com/maps/transport-dark/)`thunderforest``spinal-map`Rasters[spinal-map](https://www.thunderforest.com/maps/spinal-map/)`thunderforest``pioneer`Rasters[pioneer](https://www.thunderforest.com/maps/pioneer/)`thunderforest``mobile-atlas`Rasters[mobile-atlas](https://www.thunderforest.com/maps/mobile-atlas/)`thunderforest``neighbourhood`Rasters[neighbourhood](https://www.thunderforest.com/maps/neighbourhood/)`thunderforest``atlas`Rasters[atlas](https://www.thunderforest.com/maps/atlas/)Installation
============

[](#installation)

Composer
--------

[](#composer)

Install with composer:

```
composer require jeromegillard/map:"*"
```

Configure extensions
--------------------

[](#configure-extensions)

1. Enable the `FoF Uploads` extension.
2. Enable the `Map` extension.
3. Configure `FoF Uploads` to add the new GPX Template:

- Write `^application\/.*(gpx|json|xml|geojson|geo.json)` mime type upload adapter mapping.
- Select `Map` as template.
- Click the `|+|` button to add the mapping [![Setup FoF Upload MIME type](https://raw.githubusercontent.com/JeromeGillard/flarum-map/main/assets/readme-fof-upload-mime.png)](https://raw.githubusercontent.com/JeromeGillard/flarum-map/main/assets/readme-fof-upload-mime.png)

4. Then add `gpx,json,geojson` extensions to this list: [![Setup FoF Upload MIME type](https://raw.githubusercontent.com/JeromeGillard/flarum-map/main/assets/readme-fof-upload-extensions.png)](https://raw.githubusercontent.com/JeromeGillard/flarum-map/main/assets/readme-fof-upload-extensions.png)
5. ⚠️ **Save changes** (bottom of the screen)
6. Configure the `Map` extension (optional).

Updating
========

[](#updating)

```
composer update jeromegillard/map:"*"
php flarum migrate
php flarum cache:clear
```

Go further
==========

[](#go-further)

GeoJSON
-------

[](#geojson)

FeatureCollection can be displayed.

As an example, to generate the GeoJSON file `assets/GeoJSON.example.json` to get a view of all trails of the [Amblève Trail Center](https://endurovtt.be), follow those steps:

```
# Go to https://overpass-turbo.eu/
# Input that query:
[out:json][timeout:25];
(
  relation(13959062);>>;
)->.a;
rel.a;
out body;
>;
out skel qt;

# Click export, as GeoJSON

```

Development
-----------

[](#development)

I've prepared a all-in-one `docker-compose.yml` file to get up and running to develop this Flarum extension easily.

### Prepare the environment

[](#prepare-the-environment)

1. create the `flarum-dev.env.local` file. There's an example just nearby.
2. Spin the containers: `docker compose up -d`
3. Enter the container: `docker exec -it -w /flarum/app flarum-dev /bin/sh`
4. Allow local packages sources: `composer config repositories.0 path "packages/*"`
5. Install the extension: `composer require jeromegillard/map *@dev`
6. Wait for the container to start. It might be long stuck on last log "\[INFO\] Setting folder permissions", just wait.
7. You can browse to `http://localhost` when logs shows "\[INFO\] End of startup script. Forum is starting."
8. To rebuild the front-end, outside the container, go to the `js` folder and do `npm install` then `npm run dev` (you'll need npm installed on your computer).

Links
=====

[](#links)

- [Packagist](https://packagist.org/packages/jeromegillard/map)
- [GitHub](https://github.com/JeromeGillard/flarum-map)
- [Discuss](https://discuss.flarum.org/d/31732-map-extension-display-a-map-a-gpx-or-a-geojson-file-in-a-post)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance5

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~55 days

Recently: every ~102 days

Total

9

Last Release

874d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/48ffd869333c0ba256163b2d7d96b0e656606de178bf3cd06e787b6c8cdb5a1f?d=identicon)[jeromegillard](/maintainers/jeromegillard)

---

Top Contributors

[![JGillardBM](https://avatars.githubusercontent.com/u/65887454?v=4)](https://github.com/JGillardBM "JGillardBM (24 commits)")[![JeromeGillard](https://avatars.githubusercontent.com/u/10224878?v=4)](https://github.com/JeromeGillard "JeromeGillard (8 commits)")[![bientran](https://avatars.githubusercontent.com/u/10374431?v=4)](https://github.com/bientran "bientran (7 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![brian-guru](https://avatars.githubusercontent.com/u/111941966?v=4)](https://github.com/brian-guru "brian-guru (1 commits)")[![Litalino](https://avatars.githubusercontent.com/u/99712477?v=4)](https://github.com/Litalino "Litalino (1 commits)")

---

Tags

flarumleafletmapmapboxopenstreetmapleafletflarumgeojsonosmOpenStreetMapgpxmapboxthunderforest

### Embed Badge

![Health badge](/badges/jeromegillard-map/health.svg)

```
[![Health](https://phpackages.com/badges/jeromegillard-map/health.svg)](https://phpackages.com/packages/jeromegillard-map)
```

###  Alternatives

[mediawiki/maps

Adds various mapping features to MediaWiki

84145.0k3](/packages/mediawiki-maps)[fof/byobu

Well integrated, advanced private discussions.

61105.8k9](/packages/fof-byobu)[funiq/geophp

Open-source native PHP library for doing geometry operations. Can read and write a wide variety of formats: (E)WKT, (E)WKB, TWKB, GeoJSON, KML, GPX, GeoRSS. Works with all Simple-Feature geometries (Point, LineString, Polygon...) and can be used to get centroids, bounding-boxes, area, etc.

21114.4k1](/packages/funiq-geophp)[fof/user-bio

Add a user bio to user profiles

2196.5k9](/packages/fof-user-bio)[fof/drafts

Allow users to create post and discussion drafts

1771.1k5](/packages/fof-drafts)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
