### [wpforms_geolocation_map_default_location](https://wpforms.com/developers/wpforms_geolocation_map_default_location/)

**Published:** March 12, 2021
**Author:** Editorial Team

**Excerpt:** The WPForms wpforms_geolocation_map_default_location filter can be used to change the default location of the map pin using Longitude and Latitude.

**Content:**

## Description

The `wpforms_geolocation_map_default_location` filter fires when the single entry is loaded on the Entries screen and when the form loads when enabled using the **WPForms Geolocation addon**.

## Parameters

This action does not accept any parameters.

## More Information

This filter is used to set the default longitude and latitude coordinates for the map used with the **Geolocation addon**. The map is viewed on the entries and on the forms.

## Source

`wpforms-geolocation/src/Map.php`

## Examples

To find the latitude and longitude coordinates, [please see this reference from Google](https://support.google.com/maps/answer/18539?co=GENIE.Platform%3DDesktop&hl=en "Find or enter latitude & longitude").

```

/**
 * Set the default lat and lng for the map.
 *
 * @link   https://wpforms.com/developers/wpforms_geolocation_map_default_location/
 * return  array
 */

function wpf_wpforms_geolocation_map_default_location() {
   
    return [
            'lat' => 51.5207,
            'lng' => -0.1550,
        ];
}
add_filter( 'wpforms_geolocation_map_default_location', 'wpf_wpforms_geolocation_map_default_location', 10 );
```

## Related

Documentation Reference: [How to Change Default Location for Geolocation Addon](https://wpforms.com/developers/how-to-change-default-location-for-geolocation-addon/ "How to Change Default Location for Geolocation Addon")

**Categories:** Filters Hooks

**Tags:** PHP

---

