Download the PHP package lukyrys/nette-forms-gpspicker without Composer
On this page you can find all versions of the php package lukyrys/nette-forms-gpspicker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nette-forms-gpspicker
For Nette Framework
GPS coordinates picker. Try it now!
Drivers
- Google Maps API v3
- Mapy.cz API v4
- Nokia Maps API v2
- OpenStreetMap (using Google Maps API v3)
License
New BSD
Dependencies
Nette 2.4.x
Demo
http://vojtechdobes.com/gpspicker/
Installation
- Get the source code from Github or via Composer (
vojtech-dobes/nette-forms-gpspicker
). - Register
VojtechDobes\NetteForms\GpsPickerExtension
as extension. - Link appropriate maps API SDK and
client/nette.gpsPicker.js
inapp/templates/@layout.latte
.
In Nette 2.0, registration is done in
app/bootstrap.php
:
(for example when using Google Maps API v3)
Usage
You can add some options (every option has also some like setter thing):
If you prefer manual rendering, caption can be omitted:
Returned value is instance of GpsPoint
with lat
and lng
properties. It inherits from Nette\Object
.
You can set value (respectively default value) like this:
Validation
Now you can easily add various constraints on desired GPS:
First four rules will be also validated client-side.
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.
Search by address
Enabled by default, GpsPicker supports searching map by typing the address. Extra <input>
element will be prepended to map,
enhanced by Google Places Autocomplete service.
If you like to render it manually, use search
key:
You can disable/enable search feature with enableSearch
/disableSearch
pair of methods:
Or in constructor:
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:
Available providers are:
Feature | Value |
---|---|
Usage | default (manually by calling ->setDriver(GpsPicker::DRIVER_GOOGLE) ) |
Search by address | yes |
Supported types | GpsPicker::TYPE_ROADMAP , GpsPicker::TYPE_SATELLITE , GpsPicker::TYPE_HYBRID , GpsPicker::TYPE_TERRAIN |
Nokia
Feature | Value |
---|---|
Usage | ->setDriver(GpsPicker::DRIVER_NOKIA) |
Search by address | no |
Supported types | GpsPicker::TYPE_NORMAL , GpsPicker::TYPE_SATELLITE , GpsPicker::TYPE_TERRAIN |
OpenStreetMap
Feature | Value |
---|---|
Usage | ->setDriver(GpsPicker::DRIVER_OPENSTREETMAP) |
Search by address | no |
Supported types | GpsPicker::TYPE_ROADMAP , GpsPicker::TYPE_SATELLITE , GpsPicker::TYPE_HYBRID , GpsPicker::TYPE_TERRAIN |
Seznam (Mapy.cz)
Feature | Value |
---|---|
Usage | ->setDriver(GpsPicker::DRIVER_SEZNAM) |
Search by address | no |
Supported types | GpsPicker::TYPE_BASE , GpsPicker::TYPE_BIKE , GpsPicker::TYPE_HISTORIC , GpsPicker::TYPE_HYBRID ,GpsPicker::TYPE_OPHOTO , GpsPicker::TYPE_TRAIL , GpsPicker::TYPE_TURIST |
All versions of nette-forms-gpspicker with dependencies
latte/latte Version ^2.4
nette/di Version ^2.4
nette/forms Version ^2.4
nette/utils Version ^2.4