PHP code example of i-saad-salman / nova-map-address
1. Go to this page and download the library: Download i-saad-salman/nova-map-address 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/ */
i-saad-salman / nova-map-address example snippets
use iSaadSalman\MapAddress\MapAddress;
[
MapAddress::make('address'),
// You can set the initial map location. By default (Spain)
MapAddress::make('address')
->initLocation(38.261842, -0.6868031),
// You can set the location from the model
MapAddress::make('address')
->setLocation($this->latitude, $this->longitude),
// You can select the name of lat/lng fields. By default is lat/lng
MapAddress::make('address')
->setLatitudeField('latitude')
->setLongitudeField('longitude'),
// You can select what is the first result set in address field
MapAddress::make('address')
->setGoogleResultType('street_address'),
// Enable Drag for the markers
MapAddress::make('address')
->initLocation(38.261842, -0.6868031)
->enableDrag(true),
// Enable auto complete for address field
MapAddress::make('address')
->initLocation(38.261842, -0.6868031)
->enableAutocomplete(true),
// You can also set the map zoom level. By default (4)
MapAddress::make('address')
->initLocation(38.261842, -0.6868031)
->zoom(12),
]