Skip to content

Instantly share code, notes, and snippets.

@rafaehlers
Created August 11, 2017 16:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafaehlers/95b2fc194473a7c9b343420af00626f3 to your computer and use it in GitHub Desktop.
Save rafaehlers/95b2fc194473a7c9b343420af00626f3 to your computer and use it in GitHub Desktop.
Use the cordinates (Latitude and Longitude) instead of the address to position the markers over the Maps
<?php
/**
* Use the cordinates (Latitude and Longitude) instead of the address to position the markers over the Maps
* Replace 'MY_LATITUDE_FIELD_ID' and 'MY_LONGITUDE_FIELD_ID' by the form field ids containing the latitude and longitude
* @param array $fields Gravity Forms fields IDs containing the latitude and longitude
* @param GravityView_View object $view Current View object
*/
function my_gv_maps_lat_long_fields( $fields, $view ) {
return array( 'MY_LATITUDE_FIELD_ID', 'MY_LONGITUDE_FIELD_ID' );
}
add_filter( 'gravityview/maps/markers/lat_long/fields_id', 'my_gv_maps_lat_long_fields', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment