PHPackages                             lachlanhickey/laravel-maps - 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. lachlanhickey/laravel-maps

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

lachlanhickey/laravel-maps
==========================

Maps for your Laravel application

v2.0.0(3y ago)00MITPHPPHP ^8.1

Since Aug 30Pushed 3mo agoCompare

[ Source](https://github.com/lachlanhickey/laravel-maps)[ Packagist](https://packagist.org/packages/lachlanhickey/laravel-maps)[ Docs](https://gitlab.com/gonoware/laravel-maps)[ RSS](/packages/lachlanhickey-laravel-maps/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (17)Used By (0)

Maps for your Laravel application
=================================

[](#maps-for-your-laravel-application)

[![GitLab Repository](https://camo.githubusercontent.com/46d8e9a784dc94be807a463a9c21692fb508a439e60d546f837cb7dafd23b8b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744c61622d676f6e6f776172652f6c61726176656c2d2d6d6170732d626c75652e7376673f6c6f676f3d6769746c6162267374796c653d666c61742d737175617265266c6f6e6743616368653d74727565)](https://gitlab.com/gonoware/laravel-maps)![Laravel Version](https://camo.githubusercontent.com/1ee56de970498b884710a5a25ba26c29bff41bcbd4cf3c973d05cbd89d9cec30/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d392d626c75652e7376673f6c6f676f3d6c61726176656c267374796c653d666c61742d737175617265266c6f6e6743616368653d74727565)[![Latest Stable Version](https://camo.githubusercontent.com/007bf7e20e0eee5b2358832ffba13eba73b69a8cbf608b7dd5aa076b1b885bb1/68747470733a2f2f706f7365722e707567782e6f72672f676f6e6f776172652f6c61726176656c2d6d6170732f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/gonoware/laravel-maps)[![StyleCI](https://camo.githubusercontent.com/bfff4a8844668063ca3d0509f3a6ab586e96affbf8b496f3e6bae2b3bd54eb7d/68747470733a2f2f6769746c61622e7374796c6563692e696f2f7265706f732f383134363634362f736869656c64)](https://gitlab.styleci.io/repos/8146646)[![License](https://camo.githubusercontent.com/d855c2688eace837cf65264e6ff75b34604a0c66752c6141f28d39d5a59bdaf1/68747470733a2f2f706f7365722e707567782e6f72672f676f6e6f776172652f6c61726176656c2d6d6170732f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/gonoware/laravel-maps)[![Total Downloads](https://camo.githubusercontent.com/b4014c50b84f6d3b807712d0d55a64a8cbf3ee7af3435c570a3f3dfbedb8214d/68747470733a2f2f706f7365722e707567782e6f72672f676f6e6f776172652f6c61726176656c2d6d6170732f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/gonoware/laravel-maps)

Using this package you can easily display maps on your website.

Supported map services:

- Google Maps
- OpenStreetMap
- Bing Maps
- MapQuest
- Yandex Maps
- MapKit (beta)

> Note: Yandex Maps API does not work in Chrome.

Features
--------

[](#features)

Google MapsOpenStreetMapBing MapsMapQuestYandex MapsMapKit[Map](#basic-map)✔✔✔✔✔✔[Markers](#map-with-markers)✔✔✔✔✔✔[Marker Links](#marker-links)✔✔✔✔✔✔[Marker Popups](#marker-popups)✔✔✔✔✔❌[Custom Marker Icons](#custom-marker-icons)✔✔✔✔✔✔[Marker Click Event](#marker-clicked)✔✔✔✔✔✔Installation
------------

[](#installation)

This package can be installed through Composer.

```
composer require gonoware/laravel-maps
```

Publish the compiled assets to `public/vendor/maps` with one of these commands:

```
php artisan vendor:publish --tag=maps
```

```
php artisan vendor:publish --provider="GoNoWare\Maps\MapsServiceProvider" --tag=public
```

> When updating, use the `--force` switch to overwrite existing assets:

```
php artisan vendor:publish --tag=maps --force
```

Optionally, you can also publish the config file of this package with this command to `config/vendor/maps.php`:

```
php artisan vendor:publish --provider="GoNoWare\Maps\MapsServiceProvider" --tag=config
```

Usage
-----

[](#usage)

Load the map styles by adding the following directive to your Blade template before the `` closing tag.

```
@mapstyles
```

Then add the following directive to your Blade template before the `` closing tag, to load the map scripts.

```
@mapscripts
```

### Basic Map

[](#basic-map)

Display a map by adding the `@map` directive to your Blade template.

```
@map([
    'lat' => 48.134664,
    'lng' => 11.555220,
    'zoom' => 6,
])
```

### Map With Markers

[](#map-with-markers)

You can also show markers / pins / annotations:

```
@map([
    'lat' => 48.134664,
    'lng' => 11.555220,
    'zoom' => 6,
    'markers' => [
        [
            'title' => 'Go NoWare',
            'lat' => 48.134664,
            'lng' => 11.555220,
        ],
    ],
])
```

### Marker Links

[](#marker-links)

Open a url when a marker is clicked.

```
@map([
    'lat' => 48.134664,
    'lng' => 11.555220,
    'zoom' => 6,
    'markers' => [
        [
            'title' => 'Go NoWare',
            'lat' => 48.134664,
            'lng' => 11.555220,
            'url' => 'https://gonoware.com',
        ],
    ],
])
```

### Marker Popups

[](#marker-popups)

Show a popup when a marker is clicked. The `popup` attribute may contain HTML markup.

```
@map([
    'lat' => 48.134664,
    'lng' => 11.555220,
    'zoom' => 6,
    'markers' => [
        [
            'title' => 'Go NoWare',
            'lat' => 48.134664,
            'lng' => 11.555220,
            'popup' => 'DetailsClick here.',
        ],
    ],
])
```

### Custom Marker Icons

[](#custom-marker-icons)

Show a custom marker icon. Absolute and relative URLs are supported.

```
@map([
    'lat' => 48.134664,
    'lng' => 11.555220,
    'zoom' => 6,
    'markers' => [
        [
            'title' => 'Go NoWare',
            'lat' => 48.134664,
            'lng' => 11.555220,
            'url' => 'https://gonoware.com',
            'icon' => 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png',
        ],
    ],
])
```

Additionally you may also specify the icon image size and anchor in pixels. The image will be aligned so that the tip of the icon is at the marker's geographical location.

```
@map([
    'lat' => 48.134664,
    'lng' => 11.555220,
    'zoom' => 6,
    'markers' => [
        [
            'title' => 'Go NoWare',
            'lat' => 48.134664,
            'lng' => 11.555220,
            'url' => 'https://gonoware.com',
            'icon' => 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png',
            'icon_size' => [20, 32],
            'icon_anchor' => [0, 32],
        ],
    ],
])
```

Styling
-------

[](#styling)

To adjust the height of the map use CSS:

```
.gnw-map-service {
    height: 750px;
}
```

Change the background of the map container:

```
.gnw-map-service__osm {
    background: rgb(221, 221, 221);
}
```

Fade in by default when using Bootstrap 3.3.7 or 4+. To replicate or modify the animation use following CSS:

```
.gnw-map.fade {
    transition: opacity .15s linear;
}
.gnw-map.fade:not(.show) {
    opacity: 0;
}
```

Events
------

[](#events)

### Map Initialized

[](#map-initialized)

The event `LaravelMaps:MapInitialized` will be dispatched when a map and its markers were initialized. The DOM element, map, markers and service name can be accessed via the event details.

```
window.addEventListener('LaravelMaps:MapInitialized', function (event) {
   var element = event.detail.element;
   var map = event.detail.map;
   var markers = event.detail.markers;
   var service = event.detail.service;
   console.log('map initialized', element, map, markers, service);
});
```

Please refer to the respective documentation for advanced customization:

- [Google Maps](https://developers.google.com/maps/documentation/javascript/tutorial)
- [OpenStreetMap](https://leafletjs.com/reference-1.6.0.html)
- [Bing Maps](https://leafletjs.com/reference-1.6.0.html)
- [MapQuest](https://leafletjs.com/reference-1.6.0.html)
- [Yandex Maps](https://tech.yandex.com/maps/jsapi/)
- [MapKit (beta)](https://developer.apple.com/documentation/mapkitjs)

### Marker Clicked

[](#marker-clicked)

The event `LaravelMaps:MarkerClicked` will be dispatched when a marker was clicked. The DOM element, map, marker and service name can be accessed via the event details.

```
window.addEventListener('LaravelMaps:MarkerClicked', function (event) {
    var element = event.detail.element;
    var map = event.detail.map;
    var marker = event.detail.marker;
    var service = event.detail.service;
    console.log('marker clicked', element, map, marker, service);
});
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information 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)

- [Emanuel Mutschlechner](https://gitlab.com/emanuel)
- [Benedikt Tuschter](https://gitlab.com/benedikttuschter)
- [All Contributors](https://gitlab.com/gonoware/laravel-maps/graphs/master)

License
-------

[](#license)

[MIT](LICENSE.md)

Copyright (c) 2018-present Go NoWare

[![FOSSA Status](https://camo.githubusercontent.com/eeefb1465a501b15198fd7048955b97a6bd3da12cc93e00ec06f0bad8f8b1d89/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746c61622e636f6d253246676f6e6f776172652532466c61726176656c2d6d6170732e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgitlab.com%2Fgonoware%2Flaravel-maps?ref=badge_large)

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance55

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 87.2% 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 ~102 days

Recently: every ~261 days

Total

16

Last Release

1318d ago

Major Versions

v0.0.4 → v1.0.02018-08-30

v1.4.0 → v2.0.02022-11-16

PHP version history (4 changes)v0.0.1PHP &gt;=7.0.0|&gt;=7.1.3

v1.3.0PHP ^7.0.0|^7.2|^7.2.5

v1.3.1PHP ^7.2|^7.2.5

v2.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3acad65aa9881b693965139916c774ae7a46e2644f66c4274af78e42d3135ff?d=identicon)[lachlanhickey](/maintainers/lachlanhickey)

---

Top Contributors

[![emanuelmutschlechner](https://avatars.githubusercontent.com/u/27734375?v=4)](https://github.com/emanuelmutschlechner "emanuelmutschlechner (34 commits)")[![lachlanhickey](https://avatars.githubusercontent.com/u/3625525?v=4)](https://github.com/lachlanhickey "lachlanhickey (3 commits)")[![ivliev](https://avatars.githubusercontent.com/u/11749893?v=4)](https://github.com/ivliev "ivliev (1 commits)")[![juancruzsaldana](https://avatars.githubusercontent.com/u/12735038?v=4)](https://github.com/juancruzsaldana "juancruzsaldana (1 commits)")

---

Tags

laravelgooglemapsgooglemapsyandexosmOpenStreetMapbingmapquestmapkitgonowarebingmapsyandexmapsmapkitjs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lachlanhickey-laravel-maps/health.svg)

```
[![Health](https://phpackages.com/badges/lachlanhickey-laravel-maps/health.svg)](https://phpackages.com/packages/lachlanhickey-laravel-maps)
```

###  Alternatives

[gonoware/laravel-maps

Maps for your Laravel application

1728.0k](/packages/gonoware-laravel-maps)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[arcanedev/seo-helper

SEO Helper is a framework agnostic package that provides tools &amp; helpers for SEO (Laravel supported).

331469.8k4](/packages/arcanedev-seo-helper)[cornford/googlmapper

An easy way to integrate Google Maps with Laravel.

457451.1k4](/packages/cornford-googlmapper)

PHPackages © 2026

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