PHPackages                             richarddobron/google-maps-data-parameter-parser - 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. richarddobron/google-maps-data-parameter-parser

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

richarddobron/google-maps-data-parameter-parser
===============================================

PHP parser and builder for the "data" parameter (Protocol Buffers) in Google Maps URLs

v1.0.1(1y ago)74.0k1MITPHPPHP ^7.0 || ^8.0CI passing

Since Dec 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/richardDobron/google-maps-data-parameter-parser)[ Packagist](https://packagist.org/packages/richarddobron/google-maps-data-parameter-parser)[ RSS](/packages/richarddobron-google-maps-data-parameter-parser/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

🌍 Google Maps 'data' Parameter Parser and Builder
=================================================

[](#-google-maps-data-parameter-parser-and-builder)

ℹ️ Overview
-----------

[](#ℹ️-overview)

This PHP library provides a convenient way to parse and build the 'data' parameter in Google Maps URLs, specifically the Protocol Buffer implementation. It helps extract meaningful information from the encoded 'data' parameter and allows for the construction of new 'data' parameters for Google Maps URLs.

🔗 Background
------------

[](#-background)

Google Maps directions URLs often contain a 'data' parameter that encodes various details, such as coordinates, waypoints, and travel modes. This library focuses on the extraction and construction of this 'data' parameter, making it easier for developers to work with Google Maps URLs programmatically.

✨ How it Works
--------------

[](#-how-it-works)

The 'data' parameter consists of elements separated by ! marks. Each element includes an integer id, a single character alphabetic type, and a string value. The interpretation of each element depends on its properties and position in the tree structure.

🛠️ Functionality
----------------

[](#️-functionality)

The parser extracts the 'data' parameter and organizes it into a tree of nodes, each representing a specific element in the Protocol Buffer. This structure allows developers to easily navigate and access the encoded information.

📖 Requirements
--------------

[](#-requirements)

PHP 7.0 or higher

📦 Installing
------------

[](#-installing)

```
$ composer require richarddobron/google-maps-data-parameter-parser
```

⚡️ Usage
--------

[](#️-usage)

### Parser

[](#parser)

```
$data = \dobron\GoogleMapsQueryArgs::decode('!3m1!4b1!4m13!4m12!1m5!1m1!1s0x47bee19f7ccbda49:0x86dbf8c6685c9617!2m2!1d7.0982068!2d50.73743!1m5!1m1!1s0x47a84e373f035901:0x42120465b5e3b70!2m2!1d13.404954!2d52.5200066');
```

### Example Output

[](#example-output)

```
{
    "3": {
        "4": "b1"
    },
    "4": {
        "4": {
            "1": [
                {
                    "1": {
                        "1": "s0x47bee19f7ccbda49:0x86dbf8c6685c9617"
                    },
                    "2": {
                        "1": "d7.0982068",
                        "2": "d50.73743"
                    }
                },
                {
                    "1": {
                        "1": "s0x47a84e373f035901:0x42120465b5e3b70"
                    },
                    "2": {
                        "1": "d13.404954",
                        "2": "d52.5200066"
                    }
                }
            ]
        }
    }
}
```

### Builder

[](#builder)

```
$protocolBuffer = \dobron\GoogleMapsQueryArgs::encode($data);
```

🧪 Testing
---------

[](#-testing)

```
$ composer tests
```

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! If you'd like to help improve this project, feel free to open an issue or submit a pull request.

📜 License
---------

[](#-license)

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

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance40

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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 ~381 days

Total

2

Last Release

582d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/82453617?v=4)[dobron](/maintainers/dobron)[@DOBRON](https://github.com/DOBRON)

---

Top Contributors

[![richardDobron](https://avatars.githubusercontent.com/u/33115305?v=4)](https://github.com/richardDobron "richardDobron (3 commits)")

---

Tags

google-mapsweb-scraper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/richarddobron-google-maps-data-parameter-parser/health.svg)

```
[![Health](https://phpackages.com/badges/richarddobron-google-maps-data-parameter-parser/health.svg)](https://phpackages.com/packages/richarddobron-google-maps-data-parameter-parser)
```

###  Alternatives

[lstrojny/functional-php

Functional primitives for PHP

2.0k7.6M51](/packages/lstrojny-functional-php)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k8.9M97](/packages/stevebauman-location)[symfony/ldap

Provides a LDAP client for PHP on top of PHP's ldap extension

1408.3M62](/packages/symfony-ldap)[ondrejmirtes/better-reflection

Better Reflection - an improved code reflection API

137.9M5](/packages/ondrejmirtes-better-reflection)[avram/vokativ

Library used to convert first names from Serbian language into their vocative case.

1319.9k](/packages/avram-vokativ)

PHPackages © 2026

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