I can't find a way to change the text below when using Gmap Location.

If you wish to supply your own latitude and longitude, you may enter them above. If you leave these fields blank, the system will attempt to determine a latitude and longitude for you from the entered address. To have the system recalculate your location from the address, for example if you change the address, delete the values for these fields.
You may set the location by clicking on the map, or dragging the location marker. To clear the location and cause it to be recalculated, click on the marker.

The text is located just below the actual map on the node/edit page. I have searched the code and tried using the String Overrides module without luck.

I would appreciate any help you can give me

thanks /ted

Comments

zilla’s picture

not sure where that text is buried, but the magical "formdefaults" module should let you edit it right there on the screen once enabled! (or string overrides module for other minor things as well, but not for this form item as it's not being output as a string like $tid or whatever)

jade_IAAMB’s picture

For anyone else who's searching for this answer, the text is located around line 360 of location/location.module

tedl’s picture

thank you jade_IAAMB
/ted

marcushenningsen’s picture

Status: Active » Fixed
sopia’s picture

Ditto. I had to remove the text from the module. Not the RIGHT way I know, but it was quick. Until the next time I update the module and forget about the tweak ;-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rachelf’s picture

Title: How can I change the text? » How can I change the location picker description text that displays under the map in gmap location?

I know this thread's a bit old, but here's how I did this with a custom module in D6 for the gmap location in a content_type called business:

<?php

/**
* Implementation of hook_form_alter().
*/
function CUSTOMMODULE_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'business_node_form') { // my location map was in a content_type called business
    // Add an after_build function to process when everything's complete.
    $form['#after_build'][] = 'business_node_form_after_build';
  }
}

/**
* Modify form elements on the business form.
*/
function business_node_form_after_build($form, &$form_state) {
  $form['field_bus_loc'][0]['locpick']['map_instructions']['#value'] = 'YOUR TEXT GOES HERE'; //used to say 'If you wish to supply your own latitude and longitude...
  $form['field_bus_loc'][0]['locpick']['instructions']['#value'] = 'YOUR TEXT GOES HERE'; //used to say 'You may set the location by ...
//  return print_rr($form); // use this to examine the array when trying to locate the fields you wish to alter
  return $form;
}

if (!function_exists('print_rr'))
{
    function print_rr($data, $return = FALSE) // handy function to examine arrays
    {
        $output  = '<pre style="background: #fff; border: 1px #333 solid; color: #000; font-size: 16px; font-weight: normal; margin: 10px; padding: 10px; text-align: left;">';
        $output .= print_r($data, TRUE);
        $output .= '</pre>';
       
        if($return)
            return $output;
        else
            print $output;
    }
}

To identify the form_id I edited a business node and then searched in firebug to find the line <input id="edit-business-node-form" type="hidden" value="business_node_form" name="form_id">, which gave me the form_id (n.b. use the value that's in the value="" bit rather than the id="" bit (this confused me for quite a while before I got hook_form_alter to work).

The function print_rr is a handy tip I picked up from someone on Drupal. If you put a return print_rr($form) into your function, and then reload the form, you get to see the whole of the form array, and this helps you find a field that you want to alter.

ressa’s picture

Issue summary: View changes

Thanks for sharing your solution @rachelf. With a few changes, it still works well for the successor to the "Google Maps location" module which is https://www.drupal.org/project/location.

Here's how I used your code to remove the "Re geocode" and "Delete" checkboxes, and update the wording of the "If you wish to supply ... " text (I didn't include the debug part):

/**
 * Implements hook_location_element_alter().
 */
function HOOK_location_element_alter(&$element) {
// Remove "Re geocode - Check this box to re-geocode location."
unset($element['re_geocode_location']);
// Remove "Delete - Check this box to delete this location."
unset($element['delete_location']);
}

/**
* Implementation of hook_form_alter().
*/
function HOOK_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'FORM_ID') {
    // Add an after_build function to process when everything's complete.
    $form['#after_build'][] = 'FORM_ID_after_build';
  }
}

/**
* Modify form elements on the form.
*/
function FORM_ID_after_build($form, &$form_state) {
  $form['locations'][0]['locpick']['instructions']['#markup'] = 'For help with finding Longitude and Latitude, see <a href="https://example.org" target="_blank">more info</a>.'; //used to say 'If you wish to supply your own latitude and longitude ...
  return $form;
}

Replace HOOK with the module name and FORM_ID with the form id.