PHP code example of specialist / nova-map-address

1. Go to this page and download the library: Download specialist/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/ */

    

specialist / nova-map-address example snippets



use Specialist\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'),
    
    // You can also set the map zoom level. By default (4)
     MapAddress::make('address')
        ->initLocation(38.261842, -0.6868031)
        ->zoom(12),
]