PHP code example of lukyrys / nette-forms-gpspicker
1. Go to this page and download the library: Download lukyrys/nette-forms-gpspicker library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lukyrys / nette-forms-gpspicker example snippets
$configurator->onCompile[] = function ($configurator, $compiler) {
$compiler->addExtension('gpspicker', new VojtechDobes\NetteForms\GpsPickerExtension);
};
$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,
)));