Class: Glib::JsonUi::ViewBuilder::Fields::Location

Inherits:
AbstractField show all
Defined in:
app/helpers/glib/json_ui/view_builder/fields.rb

Overview

Location/address field with Google Places autocomplete integration.

Integrates with Google Places API to provide address autocomplete and geocoding. Can optionally store latitude, longitude, and zoom level in separate fields.

Examples:

Location field with coordinates and country restriction

form.fields_location \
  name: 'user[address]',
  width: 'matchParent',
  label: 'Type an address',
  value: 'Sydney Harbour Bridge',
  autocompleteOptions: { componentRestrictions: { country: 'au' }, types: ['(cities)'] },
  latitudeField: { view: 'fields/text', name: 'user[latitude]', label: 'Lat', value: -33.8523063, readOnly: true },
  longitudeField: { view: 'fields/text', name: 'user[longitude]', label: 'Long', value: 151.21078710000006, readOnly: true },
  zoomField: { view: 'fields/text', name: 'user[zoom]', label: 'Zoom' }

See Also:

Instance Attribute Summary

Attributes inherited from JsonUiElement

#json, #page

Method Summary

Methods inherited from AbstractField

#autoValidate, #context, #created, #default_url_options, #determine_value, #disableDirtyCheck, #hint, #hint_args, #label, #label_args, #name, #placeholder, #placeholder_args, #prop, #validation, #value

Methods inherited from View

component_name

Methods inherited from JsonUiElement

action, any, array, badgeable, bool, color, component_name, date, date_time, enum, float, hash, icon, #initialize, int, length, menu, panels_builder, #props, required, singleton_array, string, text, url, views

Constructor Details

This class inherits a constructor from Glib::JsonUi::JsonUiElement