Geolocation Add-On Lat Long Issues [RESOLVED]

In the latest version of Gravity Forms, with the (Geolocation Add-On 1.3.0), both the latitude and longitude values are displaying the same value.

For Example:

        $lat = $entry['1.geolocation_latitude']; // Latitude
        $lng = $entry['1.geolocation_longitude']; // Longitude

Both of these will display:

    [1.geolocation_latitude] => 30.9534351
    [1.geolocation_longitude] => 30.9534351

This was fetching the values correctly before the 1.3.0 update.

This issue was reported to the product team yesterday.

The add-on does include the gform_geolocation_autocomplete_mappings_pre_populate filter for customizing the mappings, so you can use a small JavaScript code snippet to patch the issue until it is fixed e.g.

gform.addFilter( 'gform_geolocation_autocomplete_mappings_pre_populate', function ( mappings, components, place, formId, fieldId ) {
	mappings.longitude.value = place?.geometry?.location?.lng() || '';

	return mappings;
} );

The code snippet can be added via a JS code snippet plugin to the page footer: Where Do I Put This Code? - Gravity Forms Documentation

1 Like

Thanks! Adding this fixed my issue!