PHPackages                             lbcdev/map-geometries - 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. lbcdev/map-geometries

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lbcdev/map-geometries
=====================

Geometry classes for maps (Markers, Polylines, Polygons, etc.)

v1.0.0(3mo ago)082MITPHPPHP ^8.1|^8.2|^8.3CI passing

Since Feb 16Pushed 3mo agoCompare

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

READMEChangelogDependencies (4)Versions (2)Used By (2)

Map Geometries
==============

[](#map-geometries)

[![Tests](https://github.com/Luinux81/map-geometries/workflows/Tests/badge.svg)](https://github.com/Luinux81/map-geometries/actions)[![Latest Stable Version](https://camo.githubusercontent.com/0f2652ed75f2baaf51ebe1515d3199e1a971bbceca356d161115c6fa4f098af9/68747470733a2f2f706f7365722e707567782e6f72672f6c62636465762f6d61702d67656f6d6574726965732f76)](https://packagist.org/packages/lbcdev/map-geometries)[![Total Downloads](https://camo.githubusercontent.com/d721026fe2237f9da13fd7fede1e638d77c75b0ed8b42ae59fb19040e34c2043/68747470733a2f2f706f7365722e707567782e6f72672f6c62636465762f6d61702d67656f6d6574726965732f646f776e6c6f616473)](https://packagist.org/packages/lbcdev/map-geometries)[![License](https://camo.githubusercontent.com/e9e2db7a8e8200985413478bbc73a68a882b5c884f5ee5e09867aac42e8b7c42/68747470733a2f2f706f7365722e707567782e6f72672f6c62636465762f6d61702d67656f6d6574726965732f6c6963656e7365)](https://packagist.org/packages/lbcdev/map-geometries)

A PHP package for working with map geometries (Markers, Polylines, Polygons, etc.) with full Livewire support.

Features
--------

[](#features)

- 🎯 **Marker Support**: Create and manage map markers
- 🔄 **Livewire Integration**: Full Wireable support for real-time updates
- 📦 **Collections**: Powerful MarkerCollection with Iterator, Countable, ArrayAccess
- 🎨 **Fluent API**: Chainable methods for clean, readable code
- ✅ **Well Tested**: Comprehensive test suite with 36+ tests
- 📚 **Fully Documented**: Complete PHPDoc and usage examples

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Composer

Installation
------------

[](#installation)

```
composer require lbcdev/map-geometries
```

Quick Start
-----------

[](#quick-start)

### Creating a Marker

[](#creating-a-marker)

```
use LBCDev\MapGeometries\Marker;

$marker = Marker::make(40.7128, -74.0060, 'New York City')
    ->tooltip('The Big Apple')
    ->iconColor('blue')
    ->icon('custom-icon');
```

### Using MarkerCollection

[](#using-markercollection)

```
use LBCDev\MapGeometries\MarkerCollection;

$markers = new MarkerCollection();

$markers->add(
    Marker::make(40.7128, -74.0060, 'New York')
);

$markers->add(
    Marker::make(51.5074, -0.1278, 'London')
);

// Iterate
foreach ($markers as $marker) {
    echo $marker->getLabel();
}

// Count
echo count($markers); // 2

// Access by index
$firstMarker = $markers[0];
```

API Documentation
-----------------

[](#api-documentation)

### Marker

[](#marker)

#### Creation

[](#creation)

```
Marker::make(float $latitude, float $longitude, ?string $label = null): self
```

#### Methods

[](#methods)

MethodDescriptionReturn`label(?string $label)`Set the marker label`self``tooltip(?string $tooltip)`Set the tooltip (supports HTML)`self``icon(?string $icon)`Set custom icon`self``iconColor(?string $color)`Set icon color`self``options(array $options)`Set custom options`self``metadata(array $metadata)`Set metadata`self``getLatitude()`Get latitude`float``getLongitude()`Get longitude`float``getCoordinates()`Get \[lat, lng\]`array``toArray()`Convert to array`array``toJson()`Convert to JSON`string`### MarkerCollection

[](#markercollection)

#### Methods of `MarkerCollection`

[](#methods-of-markercollection)

MethodDescriptionReturn`add(Marker $marker)`Add marker to collection`self``get(int $index)`Get marker by index`Marker|null``remove(int $index)`Remove marker by index`self``clear()`Remove all markers`self``all()`Get all markers`array``isEmpty()`Check if empty`bool``count()`Count markers`int``toArray()`Convert to array`array``toJson()`Convert to JSON`string`Livewire Integration
--------------------

[](#livewire-integration)

Markers are fully compatible with Livewire:

```
use LBCDev\MapGeometries\Marker;
use Livewire\Component;

class MapComponent extends Component
{
    public Marker $marker;

    public function mount()
    {
        $this->marker = Marker::make(40.7128, -74.0060, 'NYC');
    }

    public function updateMarker()
    {
        $this->marker->iconColor('red');
    }
}
```

Testing
-------

[](#testing)

```
composer test
```

With coverage:

```
composer test-coverage
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Luinux81](https://github.com/Luinux81)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Related Packages
----------------

[](#related-packages)

This package is part of the LBCDev Maps Suite:

- [livewire-maps-core](https://github.com/Luinux81/livewire-maps-core) - Core Livewire map component
- [filament-maps-fields](https://github.com/Luinux81/filament-maps-fields) - Map form fields for Filament
- [filament-maps-widgets](https://github.com/Luinux81/filament-maps-widgets) - Map widgets for Filament panels

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance82

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

91d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/123c45b9a8f1e49e5a68964dee6ba594b89a0529ed3645136381aa2f6d65c5eb?d=identicon)[luinux81](/maintainers/luinux81)

---

Top Contributors

[![Luinux81](https://avatars.githubusercontent.com/u/8471444?v=4)](https://github.com/Luinux81 "Luinux81 (7 commits)")

---

Tags

mapgeometryleafletPolygonpolylinemarker

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[mjaschen/phpgeo

Simple Yet Powerful Geo Library

1.6k8.6M22](/packages/mjaschen-phpgeo)[emcconville/point-reduction-algorithms

A collection of algorithms for reducing the number of points in polyline

61196.1k1](/packages/emcconville-point-reduction-algorithms)[mostafaznv/nova-map-field

Map Field for Laravel Nova

4693.4k](/packages/mostafaznv-nova-map-field)[clickstorm/go-maps-ext

Google Maps Extension. Simply insert a google map Version 3 without jQuery, calculate a route, images for markers, style maps, KML, categories, responsive and many more.

23159.1k1](/packages/clickstorm-go-maps-ext)[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)[symfony/ux-leaflet-map

Symfony UX Map Leaflet Bridge

13146.6k1](/packages/symfony-ux-leaflet-map)

PHPackages © 2026

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