PHPackages                             sparkscoding/static-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. [API Development](/categories/api)
4. /
5. sparkscoding/static-maps

ActiveLibrary[API Development](/categories/api)

sparkscoding/static-maps
========================

A PHP library to make working with the Google Static Maps API a little more friendly.

v1.1.0-beta(8y ago)810.3k↓34%6MITPHP

Since Jul 4Pushed 8y ago2 watchersCompare

[ Source](https://github.com/mattsparks/StaticMaps)[ Packagist](https://packagist.org/packages/sparkscoding/static-maps)[ RSS](/packages/sparkscoding-static-maps/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Static Maps
===========

[](#static-maps)

A PHP library to make working with the Google Static Maps API (and, eventually, others) a little more friendly.

**Note:** This library is in active development. Refactoring needs to be done, features need added, and the API needs finalized. While the code *should* be relatively stable, you're cautioned against using this in a production environment.

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

[](#installation)

Composer is the recommended method of installation.

```
composer require sparkscoding/static-maps

```

Quick Example
-------------

[](#quick-example)

```
use SparksCoding\StaticMaps\StaticMap;
use SparksCoding\StaticMaps\Components\Map;
use SparksCoding\StaticMaps\Components\Marker;
use SparksCoding\StaticMaps\Components\Feature;
use SparksCoding\StaticMaps\Components\Element;
use SparksCoding\StaticMaps\Components\Path;

// Initialize the map by adding your API key
$staticMap = StaticMap::key('123yOUrAPIkeYGoeSHerE123');

// Set the builder
$staticMap->setBuilder(
    '\SparksCoding\StaticMaps\Builders\GoogleStaticMapBuilder'
);

// Add a map
$staticMap->setMap(
    Map::create()->center('New York, NY')->zoom(10)
);

// Add a couple markers
$staticMap->addMarkers(
    Marker::location('New York, NY'),
    Marker::location('Brooklyn, NY')
);

// Style the roads
$staticMap->addStyles(
    Feature::name('road')->elements(
        Element::name('geometry')->color('blue')
    )
);

// Add a path
$staticMap->addPath(
  Path::points([
      'Empire State Building',
      'Webster Hall',
      'The Spotted Pig',
      'The High Line',
      'Empire State Building',
  ])->color('0x000000ff')->fillcolor('0xFFFF0033')->weight(2)
);

echo '';
```

Output:

[![NY Static Map](assets/ny_example.png "NY Static Map")](assets/ny_example.png)

Documentation
-------------

[](#documentation)

Documentation, including installation instructions and examples, can be found on the [Wiki](https://github.com/mattsparks/StaticMaps/wiki).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

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

Every ~2 days

Total

2

Last Release

3238d ago

### Community

Maintainers

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

---

Top Contributors

[![mattsparks](https://avatars.githubusercontent.com/u/1678388?v=4)](https://github.com/mattsparks "mattsparks (9 commits)")

---

Tags

google-mapsgoogle-static-maps-apilibraryphpstatic-mapsstatic-maps-apimapmapsstatic mapsgoogle mapsGoogle Static Map API

### Embed Badge

![Health badge](/badges/sparkscoding-static-maps/health.svg)

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

###  Alternatives

[dantsu/php-osm-static-api

PHP library to easily get static image from OpenStreetMap (OSM), add markers and draw lines.

97141.0k1](/packages/dantsu-php-osm-static-api)[yidas/google-maps-services

PHP client library(SDK) for Google Maps API Web Services

721.3M](/packages/yidas-google-maps-services)[yandex/geo

PHP-library for interactions with geo-coding Yandex.Maps

117309.0k3](/packages/yandex-geo)[jeroendesloovere/geolocation-php-api

This Geolocation PHP class connects to Google Maps API to find latitude/longitude or address.

75316.8k4](/packages/jeroendesloovere-geolocation-php-api)[ivory/google-map

Google Map API v3 integration for PHP ^8.1

14363.2k4](/packages/ivory-google-map)[codewithdennis/filament-simple-map

This package offers a straightforward and easy-to-use map action component for your Filament application.

365.8k](/packages/codewithdennis-filament-simple-map)

PHPackages © 2026

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