PHPackages                             atrian/laravelgooglemaps - 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. atrian/laravelgooglemaps

ActiveLibrary

atrian/laravelgooglemaps
========================

Laravel Google Map package for 5.x. You can use all google map features in laravel. UPDATED: Laravel 7 support, strtolower replaced with mb\_strtolower in geocache, gestureHandling Gmap option

v2.5.1(5y ago)014MITPHPPHP &gt;=5.6.0

Since May 4Pushed 5y agoCompare

[ Source](https://github.com/atrian/laravelgooglemaps)[ Packagist](https://packagist.org/packages/atrian/laravelgooglemaps)[ RSS](/packages/atrian-laravelgooglemaps/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (22)Used By (0)

Laravel Google Maps
===================

[](#laravel-google-maps)

[![Rank](https://camo.githubusercontent.com/8276b54e0375562820936fa30ff24cab9e31e114ddec194b8582dd7440e7acf8/68747470733a2f2f7068707061636b616765732e6f72672f702f66617268616e77617a69722f6c61726176656c676f6f676c656d6170732f62616467652f72616e6b2e737667)](http://phppackages.org/p/farhanwazir/laravelgooglemaps)[![Total Downloads](https://camo.githubusercontent.com/5b31e334c71403da1b928c6f2e42090827b22abca5f0ed1631af65423b73e4aa/68747470733a2f2f706f7365722e707567782e6f72672f66617268616e77617a69722f6c61726176656c676f6f676c656d6170732f642f746f74616c2e737667)](https://packagist.org/packages/farhanwazir/laravelgooglemaps)[![Latest Stable Version](https://camo.githubusercontent.com/9658276598c8b4eb2d131001bf8eed4f95c21850a0ca53098beb83da90508f82/68747470733a2f2f706f7365722e707567782e6f72672f66617268616e77617a69722f6c61726176656c676f6f676c656d6170732f762f737461626c652e737667)](https://packagist.org/packages/farhanwazir/laravelgooglemaps)[![Latest Unstable Version](https://camo.githubusercontent.com/b8803f11df27756056faccb486eff87782d97c6615bf253d738cff69a89ba19b/68747470733a2f2f706f7365722e707567782e6f72672f66617268616e77617a69722f6c61726176656c676f6f676c656d6170732f762f756e737461626c652e737667)](https://packagist.org/packages/farhanwazir/laravelgooglemaps)[![License](https://camo.githubusercontent.com/1ae249309a1149430557b64e2b7c5a42150d395e4c47e019dc2866d81dfde411/68747470733a2f2f706f7365722e707567782e6f72672f66617268616e77617a69722f6c61726176656c676f6f676c656d6170732f6c6963656e73652e737667)](https://packagist.org/packages/farhanwazir/laravelgooglemaps)

This repo aims to use google map features in laravel 5.x. It is easy to use and flexible, you can just install this package and enjoy google map in your website and/or applications.

Features
--------

[](#features)

```
1. Localizing
2. Map Types
3. Custom Style
4. Makers
5. Info Window
6. Shapes
7. Symbols
8. Overlays
9. KML and GeoRSS
10. Traffic and Bicycling Layer
11. Geocoding Caches
12. Controls
13. Street View
14. Events
15. Reverse Geocoding
16. Travel Moding
17. Proxy

```

### Services &amp; Libraries

[](#services--libraries)

```
1. Directions
2. Geocoding
3. Geometry
4. Drawing
5. Places
6. Autocomplete
7. Adsense
8. Geofence (For now only server side geofence available)

```

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

[](#installation)

Add in composer.json

```
  "require": {
      "farhanwazir/laravelgooglemaps": "^2.3"
      ----
  }

```

Then

```
  composer update

```

Or install via composer cli

```
  composer require farhanwazir/laravelgooglemaps

```

Add service provider `config/app.php`

```
        FarhanWazir\GoogleMaps\GMapsServiceProvider::class,
```

And finally add in the alias section `config/app.php`

```
        'GMaps' => FarhanWazir\GoogleMaps\Facades\GMapsFacade::class,
```

Now publish configuration file

```
    php artisan vendor:publish --provider="FarhanWazir\GoogleMaps\GMapsServiceProvider"
```

\##Usage Example files are under FarhanWazir/GoogleMaps/Example:

Controller Example; reference code for display method

```
/******** Custom Map Controls ********/

        $leftTopControls = ['document.getElementById("leftTopControl")']; // values must be html or javascript element
        $this->gmap->injectControlsInLeftTop = $leftTopControls; // inject into map
        $leftCenterControls = ['document.getElementById("leftCenterControl")'];
        $this->gmap->injectControlsInLeftCenter = $leftCenterControls;
        $leftBottomControls = ['document.getElementById("leftBottomControl")'];
        $this->gmap->injectControlsInLeftBottom = $leftBottomControls;

        $bottomLeftControls = ['document.getElementById("bottomLeftControl")'];
        $this->gmap->injectControlsInBottomLeft = $bottomLeftControls;
        $bottomCenterControls = ['document.getElementById("bottomCenterControl")'];
        $this->gmap->injectControlsInBottomCenter = $bottomCenterControls;
        $bottomRightControls = ['document.getElementById("bottomRightControl")'];
        $this->gmap->injectControlsInBottomRight = $bottomRightControls;

        $rightTopControls = ['document.getElementById("rightTopControl")'];
        $this->gmap->injectControlsInRightTop = $rightTopControls;
        $rightCenterControls = ['document.getElementById("rightCenterControl")'];
        $this->gmap->injectControlsInRightCenter = $rightCenterControls;
        $rightBottomControls = ['document.getElementById("rightBottomControl")'];
        $this->gmap->injectControlsInRightBottom = $rightBottomControls;

        $topLeftControls = ['document.getElementById("topLeftControl")'];
        $this->gmap->injectControlsInTopLeft = $topLeftControls;
        $topCenterControls = ['document.getElementById("topCenterControl")'];
        $this->gmap->injectControlsInTopCenter = $topCenterControls;
        $topRightControls = ['document.getElementById("topRightControl")'];
        $this->gmap->injectControlsInTopRight = $topRightControls;

        /******** End Controls ********/

        $config = array();
        $config['map_height'] = "100%";
        $config['center'] = 'Clifton, Karachi';

        $this->gmap->initialize($config); // Initialize Map with custom configuration

        /*********** Marker Setup ***********/
        $marker = array();
        $marker['draggable'] = true;
        //Marker event dragend
        $marker['ondragend'] = '
        iw_'. $this->gmap->map_name .'.close();
        reverseGeocode(event.latLng, function(status, result, mark){
            if(status == 200){
                iw_'. $this->gmap->map_name .'.setContent(result);
                iw_'. $this->gmap->map_name .'.open('. $this->gmap->map_name .', mark);
            }
        }, this);
        ';
        $this->gmap->add_marker($marker);
        /*********** End Marker Setup ***********/

        $map = $this->gmap->create_map(); // This object will render javascript files and map view; you can call JS by $map['js'] and map view by $map['html']

        return view('map', ['map' => $map]);
```

Route Example

```
Route::get('/map', 'MapController@index');

Route::get('/', function(){
    $config = array();
    $config['center'] = 'New York, USA';
    GMaps::initialize($config);
    $map = GMaps::create_map();

    echo $map['js'];
    echo $map['html'];
});
```

View Example

```

        {!! $map['js'] !!}

                This is Left Top Control.

                This is Left Center Control.

                This is Left Bottom Control.

                This is Bottom Right Control.

                This is Bottom Center Control.

                This is Bottom Left Control.

                This is Right Top Control.

                This is Right Center Control.

                This is Right Bottom Control.

                This is Top Left Control.

                This is Top Center Control.

                This is Top Right Control.

            {!! $map['html'] !!}

```

### Geo-fence Example

[](#geo-fence-example)

```
$polygon = array("25.774,-80.190", "18.466,-66.118", "32.321,-64.757", "25.774,-80.190"); //start and end point should be same
$latlngs = array("-12.043333,-77.028333", "-12.043333,-77.028333");

GMaps::isMarkerInsideGeofence($polygon, $latlngs); //both parameters should be in array
//return will also in array with boolean values like: array(true, false)
```

Contribution
============

[](#contribution)

- Proxy feature by @grimseer - Nov 22, 2016
- Fixed to load google api via https by @wissamdagher - Apr 04, 2017
- Map full screen support by @wissamdagher - Jul 02, 2017
- Facade namespace fixed by @drehimself - Aug 03, 2017
- Fixed migration file name by @drehimself - Aug 03, 2017

Thank you for using!
====================

[](#thank-you-for-using)

If you like it then click Fork!

Contact me if any query or suggestion you have in support section.

Credits
=======

[](#credits)

Library initiative: **BioStall**

BioStall developed library for codeigniter originally, which you can found at

Conversion into Laravel from codeigniter by: **GeneaLabs** --  (but it is incomplete)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 86.4% 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 ~77 days

Total

21

Last Release

2123d ago

Major Versions

v1.8.0 → v2.1.12016-07-31

### Community

Maintainers

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

---

Top Contributors

[![farhanwazir](https://avatars.githubusercontent.com/u/241825?v=4)](https://github.com/farhanwazir "farhanwazir (76 commits)")[![drehimself](https://avatars.githubusercontent.com/u/4316355?v=4)](https://github.com/drehimself "drehimself (6 commits)")[![atrian](https://avatars.githubusercontent.com/u/9596824?v=4)](https://github.com/atrian "atrian (3 commits)")[![grimzy](https://avatars.githubusercontent.com/u/1837678?v=4)](https://github.com/grimzy "grimzy (1 commits)")[![rpsimao](https://avatars.githubusercontent.com/u/205846?v=4)](https://github.com/rpsimao "rpsimao (1 commits)")[![wixyskywriter](https://avatars.githubusercontent.com/u/5904398?v=4)](https://github.com/wixyskywriter "wixyskywriter (1 commits)")

---

Tags

laravelgooglemapgooglemapgmap

### Embed Badge

![Health badge](/badges/atrian-laravelgooglemaps/health.svg)

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

###  Alternatives

[farhanwazir/laravelgooglemaps

Laravel Google Map package for 5.x. You can use all google map features in laravel.

15542.0k2](/packages/farhanwazir-laravelgooglemaps)[cornford/googlmapper

An easy way to integrate Google Maps with Laravel.

457447.9k4](/packages/cornford-googlmapper)[kinglozzer/silverstripegmapsobject

Add a Google Map (optionally with Streetview) to a DataObject or Page

168.6k](/packages/kinglozzer-silverstripegmapsobject)

PHPackages © 2026

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