PHPackages                             arraypress/mapkit - 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. arraypress/mapkit

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

arraypress/mapkit
=================

A PHP library for generating map URLs for various services including Google Maps, Apple Maps, Bing Maps, OpenStreetMap, Waze, and Yandex Maps, with support for coordinates, directions, and search functionality.

024PHP

Since Jan 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/arraypress/mapkit)[ Packagist](https://packagist.org/packages/arraypress/mapkit)[ RSS](/packages/arraypress-mapkit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MapKit Library for PHP
======================

[](#mapkit-library-for-php)

A comprehensive PHP library for generating URLs and embeds for various map services including Google Maps, Bing Maps, and Apple Maps. Provides a fluent interface for building map URLs with support for coordinates, search, directions, custom views, and more.

Features
--------

[](#features)

- 🗺️ **Multi-Service Support**: Generate URLs for Google Maps, Bing Maps, and Apple Maps
- 📍 **Location Handling**: Coordinate-based locations and place searches
- 🚗 **Direction Support**: Complex routing with waypoints and travel modes
- 🎨 **View Customization**: Multiple map types and layer options
- 🌍 **Street View**: Support for Google Street View and Bing Bird's Eye view
- 📱 **Embed Generation**: Create embeddable map iframes
- 🌐 **Internationalization**: Language and region preferences
- 🚦 **Traffic &amp; Transit**: Real-time traffic and public transportation overlays
- 📊 **Collections**: Support for multiple location markers and points of interest

Requirements
------------

[](#requirements)

- PHP 7.4 or later
- WordPress 6.7.1 or later

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

[](#installation)

Install via Composer:

```
composer require arraypress/mapkit
```

Basic Usage
-----------

[](#basic-usage)

```
use ArrayPress\MapKit\Client;

// Initialize client
$mapkit = new Client();

// Generate URLs for all services at once
$urls = $mapkit->get_all_urls( 40.7484, -73.9857, 15 ); // Empire State Building

// Or use specific services
$google_url = $mapkit->google()
    ->coordinates( 40.7484, -73.9857 )
    ->zoom( 15 )
    ->get_url();

$bing_url = $mapkit->bing()
    ->coordinates( 40.7484, -73.9857 )
    ->zoom( 15 )
    ->get_url();

$apple_url = $mapkit->apple()
    ->coordinates( 40.7484, -73.9857 )
    ->zoom( 15 )
    ->get_url();
```

Google Maps Features
--------------------

[](#google-maps-features)

### Basic Maps

[](#basic-maps)

```
$google = $mapkit->google();

// Simple map view
$url = $google->coordinates( 40.7484, -73.9857 )
    ->zoom( 15 )
    ->get_url();

// Satellite view
$url = $google->coordinates( 40.7484, -73.9857)
    ->zoom( 18 )
    ->basemap( 'satellite' )
    ->get_url();

// Show traffic
$url = $google->coordinates( 40.7484, -73.9857 )
    ->layer( 'traffic' )
    ->get_url();
```

### Search

[](#search)

```
// Basic search
$url = $google->search( 'Empire State Building' )
    ->get_url();

// Search with Place ID
$url = $google->search( 'Empire State Building', 'ChIJaXQRs6lZwokRY6EFpJnhNNE' )
    ->get_url();

// Localized search
$url = $google->search( 'Empire State Building' )
    ->language( 'es' )
    ->region( 'US' )
    ->get_url();
```

### Directions

[](#directions)

```
// Basic directions
$url = $google->from( 'Times Square' )
    ->to( 'Empire State Building' )
    ->get_url();

// Complex routing
$url = $google->from( 'Times Square' )
    ->to( 'Empire State Building' )
    ->waypoints( [ 'Madison Square Garden'] )
    ->travel_mode( 'walking' )
    ->avoid( [ 'highways', 'tolls' ] )
    ->get_url();

// Transit directions
$url = $google->from( 'Grand Central' )
    ->to( 'Central Park' )
    ->travel_mode( 'transit' )
    ->get_url();
```

### Street View

[](#street-view)

```
// Basic Street View
$url = $google->coordinates( 40.7484, -73.9857 )
    ->street_view()
    ->get_url();

// Customized view
$url = $google->coordinates( 40.7484, -73.9857 )
    ->street_view( null, 180, 20, 90 ) // heading, pitch, FOV
    ->get_url();
```

### Embedded Maps

[](#embedded-maps)

```
// Basic embed
$embed = $google->coordinates( 40.7484, -73.9857 )
    ->zoom( 15 )
    ->as_embed()
    ->get_embed();

// Custom size embed
$embed = $google->coordinates( 40.7484, -73.9857 )
    ->zoom( 15 )
    ->as_embed( 800, 600 )
    ->get_embed();
```

Bing Maps Features
------------------

[](#bing-maps-features)

### Basic Maps

[](#basic-maps-1)

```
$bing = $mapkit->bing();

// Road view
$url = $bing->coordinates( 40.7484, -73.9857 )
    ->style( 'road' )
    ->get_url();

// Aerial view
$url = $bing->coordinates( 40.7484, -73.9857 )
    ->style( 'satellite' )
    ->get_url();

// Bird's eye view
$url = $bing->coordinates( 40.7484, -73.9857 )
    ->style( 'birds-eye' )
    ->birds_eye( null, 180 )
    ->get_url();
```

### Search

[](#search-1)

```
// Location search
$url = $bing->search( 'Empire State Building' )
    ->get_url();

// Business search
$url = $bing->business_search( 'restaurants near Times Square' )
    ->get_url();

// Sorted business search
$url = $bing->business_search( 'restaurants', 2 ) // Sort by rating
    ->get_url();
```

### Directions

[](#directions-1)

```
// Basic directions
$url = $bing->from( 'Times Square' )
    ->to( 'Empire State Building' )
    ->get_url();

// Transit directions with timing
$url = $bing->from( 'Grand Central' )
    ->to( 'Central Park' )
    ->travel_mode( 'transit' )
    ->transit_time( 'depart', '202403151430' )
    ->get_url();

// Route with traffic
$url = $bing->from( 'Times Square' )
    ->to( 'Empire State Building' )
    ->route_options( false, true ) // Show traffic
    ->get_url();
```

### Collections

[](#collections)

```
// Single point
$url = $bing->add_point(
    40.7484,
    -73.9857,
    'Empire State Building',
    'Iconic NYC landmark'
)->get_url();

// Multiple points
$url = $bing->add_point( 40.7484, -73.9857, 'Empire State Building' )
    ->add_point( 40.7580, -73.9855, 'Times Square' )
    ->get_url();
```

Apple Maps Features
-------------------

[](#apple-maps-features)

### Basic Maps

[](#basic-maps-2)

```
$apple = $mapkit->apple();

// Standard view
$url = $apple->coordinates( 40.7484, -73.9857 )
    ->map_type( 'standard' )
    ->get_url();

// Satellite view
$url = $apple->coordinates( 40.7484, -73.9857 )
    ->map_type( 'satellite' )
    ->get_url();

// Hybrid view
$url = $apple->coordinates( 40.7484, -73.9857 )
    ->map_type( 'hybrid' )
    ->get_url();
```

### Search and Directions

[](#search-and-directions)

```
// Search
$url = $apple->search( 'Empire State Building' )
    ->get_url();

// Directions
$url = $apple->from( 'Times Square' )
    ->to( 'Empire State Building' )
    ->transport_type( 'walking' )
    ->get_url();
```

### Additional Features

[](#additional-features)

```
// Add pin
$url = $apple->coordinates( 40.7484, -73.9857 )
    ->add_pin( 40.7484, -73.9857)
    ->get_url();

// Set locale
$url = $apple->coordinates( 40.7484, -73.9857 )
    ->language( 'es' )
    ->region( 'US' )
    ->get_url();
```

Advanced Usage
--------------

[](#advanced-usage)

### Method Chaining

[](#method-chaining)

All service builders support method chaining for a fluent interface:

```
$url = $mapkit->google()
    ->coordinates( 40.7484, -73.9857 )
    ->zoom( 15 )
    ->basemap( 'satellite' )
    ->layer( 'traffic' )
    ->language( 'en' )
    ->region( 'US' )
    ->get_url();
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

License
-------

[](#license)

Licensed under the GPLv2 or later license.

Support
-------

[](#support)

For more information and support:

- [Issue Tracker](https://github.com/arraypress/mapkit/issues)

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![arraypress](https://avatars.githubusercontent.com/u/22668877?v=4)](https://github.com/arraypress "arraypress (29 commits)")

### Embed Badge

![Health badge](/badges/arraypress-mapkit/health.svg)

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

###  Alternatives

[gerenuk/filament-banhammer

This package adds model banning functionality to filament

122.5k](/packages/gerenuk-filament-banhammer)

PHPackages © 2026

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