I've got a geofield and an address field on my content type, there is a geocoder module which can hide geofield and set it's value based on the addressfield value when the entity is saved.

what I want is to show the map to user and when he/she sets the marker on the map the city and state name on the address field being filled automatically.

somehow the opposite feature which the gocoder module provides.

I tried to use hook_form_alter to add #ajax property to my map field widget but that seems not working.

$form['field_source_map']['#ajax'] = array(
  'wrapper' => 'field-source-address-add-more-wrapper',
  'callback' => 'geofield_leafletwidg_address_set_city',

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.