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

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

abhisheksh/laravel-maps
=======================

Maps for your Laravel application

01JavaScript

Since Dec 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/abhishek3s/laravel-map)[ Packagist](https://packagist.org/packages/abhisheksh/laravel-maps)[ RSS](/packages/abhisheksh-laravel-maps/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)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

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![emanuelmutschlechner](https://avatars.githubusercontent.com/u/27734375?v=4)](https://github.com/emanuelmutschlechner "emanuelmutschlechner (34 commits)")[![abhishek3s](https://avatars.githubusercontent.com/u/134364632?v=4)](https://github.com/abhishek3s "abhishek3s (2 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)")

### Embed Badge

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

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

###  Alternatives

[wesbos/burner-email-providers

A list of burner email providers.

1.2k189.1k2](/packages/wesbos-burner-email-providers)[verbb/super-table

Super-charge your content builders and create nested Matrix fields.

3141.6M22](/packages/verbb-super-table)[ampproject/amp-toolbox

A collection of AMP tools making it easier to publish and host AMP pages with PHP.

73616.7k1](/packages/ampproject-amp-toolbox)[pugx/shortid-php

An implementation of shortid in PHP

52588.5k3](/packages/pugx-shortid-php)[eklundkristoffer/seedster

24757.6k5](/packages/eklundkristoffer-seedster)[sylius/promotion

Flexible promotion management for PHP applications.

28477.8k9](/packages/sylius-promotion)

PHPackages © 2026

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