PHPackages                             lukyrys/nette-forms-gpspicker - 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. lukyrys/nette-forms-gpspicker

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

lukyrys/nette-forms-gpspicker
=============================

Google Maps based picker of coordinates for Nette Framework.

v1.5.2(8y ago)05.7kNew BSDPHPPHP &gt;=5.3.2

Since Aug 26Pushed 4y agoCompare

[ Source](https://github.com/lukyrys/nette-forms-gpspicker)[ Packagist](https://packagist.org/packages/lukyrys/nette-forms-gpspicker)[ Docs](http://github.com/vojtech-dobes/nette-forms-gpspicker)[ RSS](/packages/lukyrys-nette-forms-gpspicker/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (18)Used By (0)

For Nette Framework
-------------------

[](#for-nette-framework)

GPS coordinates picker. [Try it now!](http://vojtechdobes.com/gpspicker/)

##### Drivers

[](#drivers)

- Google Maps API v3
- Mapy.cz API v4
- Nokia Maps API v2
- OpenStreetMap (using Google Maps API v3)

##### License

[](#license)

New BSD

##### Dependencies

[](#dependencies)

Nette 2.4.x

##### Demo

[](#demo)

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

[](#installation)

1. Get the source code from Github or via Composer (`vojtech-dobes/nette-forms-gpspicker`).
2. Register `VojtechDobes\NetteForms\GpsPickerExtension` as extension.
3. Link appropriate maps API SDK and `client/nette.gpsPicker.js` in `app/templates/@layout.latte`.

```
extensions:
	gpspicker: VojtechDobes\NetteForms\GpsPickerExtension
```

> In Nette 2.0, registration is done in `app/bootstrap.php`:

```
$configurator->onCompile[] = function ($configurator, $compiler) {
	$compiler->addExtension('gpspicker', new VojtechDobes\NetteForms\GpsPickerExtension);
};
```

```

```

*(for example when using Google Maps API v3)*

Usage
-----

[](#usage)

```
$form->addGpsPicker('coords', 'Coordinates:');
```

You can add some options (every option has also some like setter thing):

```
$form->addGpsPicker('coords', 'Coordinates:', array(
	'type' => VojtechDobes\NetteForms\GpsPicker::TYPE_SATELLITE,
	'zoom' => 1, // something like whole planet I guess
	'size' => array(
		'x' => 411,
		'y' => 376,
	),
));
```

If you prefer manual rendering, caption can be omitted:

```
$form->addGpsPicker('coords', array(
	'type' => ...
	...
));
```

Returned value is instance of `GpsPoint` with `lat` and `lng` properties. It inherits from `Nette\Object`.

```
$lat = $form->values->coords->lat;
$lng = $form->values->coords->lng;
```

You can set value (respectively default value) like this:

```
$form['coords']->setDefaultValue(array(
	'lat' => 50.103245,
	'lng' => 14.474691,
));
```

### Validation

[](#validation)

```
use VojtechDobes\NetteForms\GpsPicker as Gps;
```

Now you can easily add various constraints on desired GPS:

```
$form->addGpsPicker('coords')
	->addRule(Gps::MIN_LAT, 'Minimal latitude must be %f.', 20)
	->addRule(Gps::MIN_LNG, 'Minimal longitude must be %f.', 40)
	->addRule(Gps::MAX_LAT, 'Maximum latitude must be %f.', 20)
	->addRule(Gps::MAX_LNG, 'Maximum longitude must be %f.', 40)
	->addRule(Gps::MIN_DISTANCE_FROM, 'Minimal distance from Prague must be %d m.', array(15000, array(
		'lat' => 50.083,
		'lng' => 14.423,
	)));
	->addRule(Gps::MAX_DISTANCE_FROM, 'Maximum distance from Prague must be %d m.', array(100000, array(
		'lat' => 50.083,
		'lng' => 14.423,
	)));
```

First four rules will be also validated client-side.

### Manual rendering

[](#manual-rendering)

If the user doesn't support Javascript or gets offline, picker provides several inputs for setting coordinates manually. You can easily render them manually as well as whole complete element.

```
{form formName}
	...

	{gpspicker coords}
		{gpspicker:label lat}Latitude:{/gpspicker:label} {gpspicker:input lat}
		{gpspicker:label lng}Longitude:{/gpspicker:label} {gpspicker:input lng}
	{/gpspicker}
{/form}
```

### Search by address

[](#search-by-address)

Enabled by default, GpsPicker supports searching map by typing the address. Extra `` element will be prepended to map, enhanced by Google Places Autocomplete service.

If you like to render it manually, use `search` key:

```
{gpspicker coords}
	{gpspicker:label search /} {gpspicker:input search}
{/gpspicker}
```

You can disable/enable search feature with `enableSearch`/`disableSearch` pair of methods:

```
$form->addGpsPicker('coords', 'Coordinates:')
	->disableSearch();
```

Or in constructor:

```
$form->addGpsPicker('coords', 'Coordinates:', array(
	'search' => FALSE,
));
```

### Providers

[](#providers)

If you are afraid of exhausting API rate limit of Google Maps, you can use alternative provider as well. All you have to do is to link their appropriate API SDK and set the driver:

```
$form->addGpsPicker('coords', 'Coordinates:')
	->setDriver(GpsPicker::DRIVER_SEZNAM);
```

Available providers are:

#### Google

[](#google)

FeatureValueUsagedefault (manually by calling `->setDriver(GpsPicker::DRIVER_GOOGLE)`)Search by addressyesSupported types`GpsPicker::TYPE_ROADMAP`, `GpsPicker::TYPE_SATELLITE`, `GpsPicker::TYPE_HYBRID`, `GpsPicker::TYPE_TERRAIN````

```

#### Nokia

[](#nokia)

FeatureValueUsage`->setDriver(GpsPicker::DRIVER_NOKIA)`Search by addressnoSupported types`GpsPicker::TYPE_NORMAL`, `GpsPicker::TYPE_SATELLITE`, `GpsPicker::TYPE_TERRAIN````

	nokia.Settings.set('appId', 'XXX');
	nokia.Settings.set('authenticationToken', 'XXX');

```

#### OpenStreetMap

[](#openstreetmap)

FeatureValueUsage`->setDriver(GpsPicker::DRIVER_OPENSTREETMAP)`Search by addressnoSupported types`GpsPicker::TYPE_ROADMAP`, `GpsPicker::TYPE_SATELLITE`, `GpsPicker::TYPE_HYBRID`, `GpsPicker::TYPE_TERRAIN````

```

#### Seznam (Mapy.cz)

[](#seznam-mapycz)

FeatureValueUsage`->setDriver(GpsPicker::DRIVER_SEZNAM)`Search by addressnoSupported types`GpsPicker::TYPE_BASE`, `GpsPicker::TYPE_BIKE`, `GpsPicker::TYPE_HISTORIC`, `GpsPicker::TYPE_HYBRID`,
`GpsPicker::TYPE_OPHOTO`, `GpsPicker::TYPE_TRAIL`, `GpsPicker::TYPE_TURIST````

Loader.load()
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 70.9% 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 ~126 days

Recently: every ~276 days

Total

17

Last Release

2986d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/01e4841749ee2b4cf7211d784b093bf67523ed6489c6931401211b130df13884?d=identicon)[lukyrys](/maintainers/lukyrys)

---

Top Contributors

[![vojtech-dobes](https://avatars.githubusercontent.com/u/415925?v=4)](https://github.com/vojtech-dobes "vojtech-dobes (56 commits)")[![tomaskavalek](https://avatars.githubusercontent.com/u/210119?v=4)](https://github.com/tomaskavalek "tomaskavalek (12 commits)")[![blondak](https://avatars.githubusercontent.com/u/125672?v=4)](https://github.com/blondak "blondak (5 commits)")[![marian-r](https://avatars.githubusercontent.com/u/4215517?v=4)](https://github.com/marian-r "marian-r (3 commits)")[![bazo](https://avatars.githubusercontent.com/u/181588?v=4)](https://github.com/bazo "bazo (2 commits)")[![lukyrys](https://avatars.githubusercontent.com/u/2318346?v=4)](https://github.com/lukyrys "lukyrys (1 commits)")

---

Tags

nettemapsFormsgps

### Embed Badge

![Health badge](/badges/lukyrys-nette-forms-gpspicker/health.svg)

```
[![Health](https://phpackages.com/badges/lukyrys-nette-forms-gpspicker/health.svg)](https://phpackages.com/packages/lukyrys-nette-forms-gpspicker)
```

###  Alternatives

[vojtech-dobes/nette-forms-gpspicker

Google Maps based picker of coordinates for Nette Framework.

2456.6k](/packages/vojtech-dobes-nette-forms-gpspicker)[nette/code-checker

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

881.7M6](/packages/nette-code-checker)[kdyby/forms-replicator

Nette forms container replicator aka addDynamic

32997.7k6](/packages/kdyby-forms-replicator)[contributte/forms-multiplier

Multiplier for nette forms

281.4M3](/packages/contributte-forms-multiplier)[contributte/forms-wizard

Wizard component for nette/forms

15783.7k](/packages/contributte-forms-wizard)[webchemistry/forms-multiplier

Multiplier for nette forms

2860.9k](/packages/webchemistry-forms-multiplier)

PHPackages © 2026

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