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. clear01/maps

ActiveLibrary

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

Map control and gps picker for Nette Framework

0.1.0(7mo ago)0148↓50%MITPHPPHP ^7.2

Since Sep 30Pushed 3mo agoCompare

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

READMEChangelogDependencies (6)Versions (5)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

30

—

LowBetter than 64% of packages

Maintenance72

Regular maintenance activity

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity23

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

Total

2

Last Release

214d 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/nette

👪 Nette Framework - innovative framework for fast and easy development of secured web applications in PHP (metapackage)

1.6k2.8M335](/packages/nette-nette)[nette/web-project

Nette: Standard Web Project

10991.8k](/packages/nette-web-project)[nasext/dependent-select-box

Dependent Select Box for Nette Framework.

21262.8k2](/packages/nasext-dependent-select-box)[jzechy/jquery-fileupload

Nette UploadControl rozšířené o blueimp jQuery FileUpload.

2723.5k](/packages/jzechy-jquery-fileupload)

PHPackages © 2026

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