Update MarkerExtension.php
Add conditional logic to MarkerExtension - display coordinates or MapBox
This commit is contained in:
parent
a40520d3c6
commit
5bae62a619
|
@ -4,6 +4,7 @@
|
|||
namespace A2nt\SilverStripeMapboxField;
|
||||
|
||||
use SilverStripe\Forms\CheckboxField;
|
||||
use SilverStripe\Forms\TextField;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use Symbiote\Addressable\Geocodable;
|
||||
use Symbiote\Addressable\Addressable;
|
||||
|
@ -37,6 +38,7 @@ class MarkerExtension extends Geocodable
|
|||
CheckboxField::create('LatLngOverride', 'Override Latitude and Longitude?')
|
||||
->setDescription('Check this box and save to be able to set the latitude and longitude manually.'),
|
||||
]);
|
||||
|
||||
#Show map, or coordinates if override is ticked.
|
||||
if ($record->LatLngOverride) {
|
||||
$fields->addFieldsToTab('Root.Map', [
|
||||
|
|
Loading…
Reference in New Issue