PHPackages                             mastani/laravel-google-static-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. mastani/laravel-google-static-map

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

mastani/laravel-google-static-map
=================================

Laravel Google Static Map Generator

v2.6(2mo ago)481.7M↓40.9%17[1 issues](https://github.com/mastani/laravel-google-static-map/issues)8MITPHP

Since Jul 12Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/mastani/laravel-google-static-map)[ Packagist](https://packagist.org/packages/mastani/laravel-google-static-map)[ Docs](https://github.com/mastani/laravel-google-static-map)[ RSS](/packages/mastani-laravel-google-static-map/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (4)Versions (15)Used By (8)

Google Static Map Generator
===========================

[](#google-static-map-generator)

Generate static map using Google Map API in Laravel.

[![Total Downloads](https://camo.githubusercontent.com/0c8381830cc9a6e53f3312ac57173a050a77a134fae1e36fadd57085a015f02a/68747470733a2f2f706f7365722e707567782e6f72672f6d617374616e692f6c61726176656c2d676f6f676c652d7374617469632d6d61702f646f776e6c6f616473)](https://packagist.org/packages/mastani/laravel-google-static-map)[![Latest Stable Version](https://camo.githubusercontent.com/86728c310dc59d26786c0369866fe60c82adf103c8b1913b3fc7ef44c027e137/68747470733a2f2f706f7365722e707567782e6f72672f6d617374616e692f6c61726176656c2d676f6f676c652d7374617469632d6d61702f762f737461626c65)](https://packagist.org/packages/mastani/laravel-google-static-map)[![Latest Unstable Version](https://camo.githubusercontent.com/e6fee9986df043e5f1c295232ad6e0e019f625c1f9ea50527b2cd6d74d99c001/68747470733a2f2f706f7365722e707567782e6f72672f6d617374616e692f6c61726176656c2d676f6f676c652d7374617469632d6d61702f762f756e737461626c65)](https://packagist.org/packages/mastani/laravel-google-static-map)[![License](https://camo.githubusercontent.com/1ef47409c63729d5979a9f85f30d4051ea1dcaff850bf894ce5d57b40effb63e/68747470733a2f2f706f7365722e707567782e6f72672f6d617374616e692f6c61726176656c2d676f6f676c652d7374617469632d6d61702f6c6963656e7365)](https://packagist.org/packages/mastani/laravel-google-static-map)

### Installation in Laravel 5.5 and up

[](#installation-in-laravel-55-and-up)

```
$ composer require mastani/laravel-google-static-map
```

The package will automatically register itself.

### Installation in Laravel 5.4

[](#installation-in-laravel-54)

```
$ composer require mastani/laravel-google-static-map
```

Next up, the service provider must be registered:

```
// config/app.php

'providers' => [
    ...
    Mastani\GoogleStaticMap\GoogleStaticMapServiceProvider::class,
];
```

### Installation without Laravel

[](#installation-without-laravel)

Another way is install the component through [composer](https://getcomposer.org/download/).

Either run

```
$ composer require mastani/laravel-google-static-map
```

or add

```
"mastani/laravel-google-static-map": "dev-master"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

```
$map = new \Mastani\GoogleStaticMap\GoogleStaticMap('Place google map API key or leave it empty');
$url = $map->setCenter('Tehran')
           ->setMapType(\Mastani\GoogleStaticMap\MapType::RoadMap)
           ->setZoom(14)
           ->setSize(600, 600)
           ->setFormat(\Mastani\GoogleStaticMap\Format::JPG)
           ->addMarker('Tehran', '1', 'red', \Mastani\GoogleStaticMap\Size::Small)
           ->addMarkerLatLng(35.6907488, 51.3919293, '1', 'red', \Mastani\GoogleStaticMap\Size::Small)
           ->make(); // Return url contain map address.
           // or
           ->download($path); // Download map image
```

Function
--------

[](#function)

FunctionDescriptionsetSecret(secret)Set signing secret key.setCenter(location)Set map center with address.setCenterLatLng(latitude, longitude)Set map center with latitude and longitude.setZoom(zoom)Set map zoom.setScale(scale)Set map scale.setSize(width, height)Set map size.setMapType(type as MapType)Set map type.setMapId(id)Set a map ID previously created in Cloud Console.setFormat(format as Format)Set map format.addMarker(center, label, color, size)Add marker to map.addMarkerLatLng(latitude, longitude, label, color, size)Add marker to map with latitude and longitude.addMarkerWithIcon(center, icon, shadow)Add custom marker to map.addMarkerLatLngWithIcon(latitude, longitude, icon, shadow)Add marker to map with latitude and longitude.make()Make url string.download($path = 'current path', $name\_length = 10)Download map image in provided path.License
-------

[](#license)

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

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance84

Actively maintained with recent releases

Popularity54

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 59% 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 ~218 days

Recently: every ~289 days

Total

14

Last Release

77d ago

Major Versions

v1.5 → 2.02020-11-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7414851?v=4)[Amin Mastani](/maintainers/mastani)[@mastani](https://github.com/mastani)

---

Top Contributors

[![mastani](https://avatars.githubusercontent.com/u/7414851?v=4)](https://github.com/mastani "mastani (23 commits)")[![cyrillkalita](https://avatars.githubusercontent.com/u/2401848?v=4)](https://github.com/cyrillkalita "cyrillkalita (6 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (3 commits)")[![xewl](https://avatars.githubusercontent.com/u/245041?v=4)](https://github.com/xewl "xewl (2 commits)")[![josefbehr](https://avatars.githubusercontent.com/u/4368880?v=4)](https://github.com/josefbehr "josefbehr (1 commits)")[![michaeldyrynda](https://avatars.githubusercontent.com/u/558441?v=4)](https://github.com/michaeldyrynda "michaeldyrynda (1 commits)")[![mwasper](https://avatars.githubusercontent.com/u/44566296?v=4)](https://github.com/mwasper "mwasper (1 commits)")[![mattreesjenkins](https://avatars.githubusercontent.com/u/1914498?v=4)](https://github.com/mattreesjenkins "mattreesjenkins (1 commits)")[![madbob](https://avatars.githubusercontent.com/u/166089?v=4)](https://github.com/madbob "madbob (1 commits)")

---

Tags

google-maplaravellaravelgooglegeneratorstatic maps

### Embed Badge

![Health badge](/badges/mastani-laravel-google-static-map/health.svg)

```
[![Health](https://phpackages.com/badges/mastani-laravel-google-static-map/health.svg)](https://phpackages.com/packages/mastani-laravel-google-static-map)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M200](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k95](/packages/nativephp-mobile)

PHPackages © 2026

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