PHPackages                             clear01/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. clear01/maps

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

clear01/maps
============

Map control and gps picker for Nette Framework

0.3.1(1w ago)0219↓79.8%MITPHPPHP ^7.2

Since Sep 30Pushed 5mo agoCompare

[ Source](https://github.com/clear01/maps)[ Packagist](https://packagist.org/packages/clear01/maps)[ RSS](/packages/clear01-maps/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (12)Versions (8)Used By (0)

Clear01 Maps
============

[](#clear01-maps)

Map gps picker, map with marker control and address suggestion for Nette Framework.

Inspired by

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

[](#installation)

```
composer require clear01/maps
```

Install JS file
---------------

[](#install-js-file)

Add assets/maps.js into your js loader

Add selected driver into your js loader

Add Leaflet js and project javascript files to your page heading
----------------------------------------------------------------

[](#add-leaflet-js-and-project-javascript-files-to-your-page-heading)

```

```

Setup config
------------

[](#setup-config)

Register control factory as service in your config.neon register extension add picker to you forms

```
# register method addGpsPicker to your forms
extensions:
  maps: Clear01\Maps\DI\MapsExtension

maps:
  #api key for map based on selected driver
  mapApiKey: "your_api_key" #https://developer.mapy.com/cs/rest-api/jak-zacit/
  #api key for suggestion based on selected driver
  suggestionApiKey: "your_api_key"
```

Usage
-----

[](#usage)

In your presenter

```
use Clear01\Maps\Controls\MapControl\Factories\IMapControlFactory;
use Clear01\Maps\Controls\MapControl;
use Nette\Application\UI\Form;

/**
 * @var IMapControlFactory
 * @inject
 */
public $mapControlFactory;

...

protected function createComponentMap(string $name): MapControl
{
    $control = $this->mapControlFactory->create();
    $control->addMarker(new Marker(50.2, 17.1, 'Titletext'));

    return $control;
}

...

protected function createComponentForm(string $name): Form
{
	$form = new Form();
	$gpsInput = $form->addGpsPicker('gps', 'Select location');
	$form->addAddressSuggestion('street', 'Address');
	$form->addSubmit('send', 'Submit');

	$form->onSuccess[] = function (Form $form, $values) use ($gpsInput) {
		//$gpsInput->getGps() returns GpsCoords or null
		$gpsInput->getGps();
	};
	return $form;
}
```

You must set callback in template for suggestion (event - maps.address.select): Structure for mapy.cz API can be found here:

```
{input street}

    document.querySelector("#" + {$form['street']->getHtmlId()}).addEventListener('maps.address.select', function (e) {
        let origData = e.detail;
        if (origData.regionalStructure) {
            origData.regionalStructure.forEach(function (item) {
                if (item.type === 'regional.address') {
                    document.querySelector('#frm-address-form-houseNo').value = item.name;
                }
                if (item.type === 'regional.street') {
                    document.querySelector('#frm-address-form-street').value = item.name;
                }
                if (item.type === 'regional.municipality') {
                    document.querySelector('#frm-address-form-city').value = item.name;
                }
            })
        }
        if (origData.zip) {
            document.querySelector('#frm-address-form-postcode').value = origData.zip;
        }

    })

```

For suggestion you need to install

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance83

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity25

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.

###  Release Activity

Cadence

Every ~66 days

Total

5

Last Release

11d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4654a37d044029106ae0e3864278dd691d834fb972e693441e35ccae592c2e28?d=identicon)[clear01](/maintainers/clear01)

---

Top Contributors

[![martinknor](https://avatars.githubusercontent.com/u/2004222?v=4)](https://github.com/martinknor "martinknor (2 commits)")

### Embed Badge

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

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

###  Alternatives

[nette/code-checker

✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.

911.7M6](/packages/nette-code-checker)[nette/web-project

Nette: Standard Web Project

10993.3k](/packages/nette-web-project)[dagger/dagger

Dagger PHP SDK

261.1k](/packages/dagger-dagger)

PHPackages © 2026

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