Jump to content

Feature Request: Add Location form helper


KT Walrus

Recommended Posts

Posted

Small feature request...

I need a Location form field helper based on something like this:

https://github.com/stephjang/placecomplete

Live Demo here:

https://rawgit.com/stchangg/placecomplete/master/example.html

It would also geocode the lat/long like the Address form field helper.

I need a single Location auto-complete input field in several forms on my site (including, but not limited to, the profile and registration forms).

I'm pretty sure that many other IPS4 sites could use this feature too built into IPS4 Core...

Posted

Since Google seems to return a link to a nice Google maps page for the location, it would be nice to store save this URL in the form value so it might be used later on pages that display the location text.

For example, this Google Map of Bally, PA, US:

https://maps.google.com/?q=Bally,+PA,+USA&ftid=0x89c429b97ce53b47:0x231cbe6c3ce99fed

is a rather useful link if you want to see where Bally is and get more details about the location.

Posted
11 hours ago, Mark said:

Address forms already do that. Make sure you have the Google API configured.

@Mark, How do I limit the Address input to a single field with auto-complete for City, State, Country like the Live Demo does?

That is, how can I make the Address form helper work like a Location form helper instead of auto-complete only on the Street Address?

Posted

Assuming you mean in your own code, there's a "minimize" option.

new \IPS\Helpers\Form\Address( 'my_address_field', NULL, FALSE, array( 'minimize' => TRUE ) );

There's also a "requireFullAddress" option you may also want to use.

	/**
	 * @brief	Default Options
	 * @code
	 	$defaultOptions = array(
			'minimize'			=> FALSE,			// Minimize the address field until the user focuses?
			'requireFullAddress'=> TRUE,			// Does this have to be a full address? Default is TRUE, may set to FALSE if a more generic location is acceptable
	 	);
	 * @endcode
	 */

 

Posted
12 hours ago, Mark said:

Assuming you mean in your own code, there's a "minimize" option.


new \IPS\Helpers\Form\Address( 'my_address_field', NULL, FALSE, array( 'minimize' => TRUE ) );

There's also a "requireFullAddress" option you may also want to use.

I've tried these two options and neither implement an auto-complete Location field. The Location field should be a single input form field with auto-complete when you start typing a City name, just like this one:

https://rawgit.com/stchangg/placecomplete/master/example.html

Please try the Address field yourself with "minimize" and "requireFullAddress" and tell me how this acts as a Location field. I think these are two different field types and you shouldn't try to use Address as a "poor man's" Location. Rather, IPS4 should add a "first class" Location field that uses Google Maps for auto-completion.

Posted
12 hours ago, Mark said:

Assuming you mean in your own code, there's a "minimize" option.

Minimize will display the field... minimized. As soon as you click on it, all other fields will appear. That's not what the field in the link does. 

Posted

I found this Location plugin in the Marketplace:

that implements Location input. I'll be using it until IPS adds a Location input built into IPS4.

Now that I have a proper Location input, I need a helper to enter Place Names which auto-complete on the place name with an adjacent Location input field.

It would be nice if IPS4 also added a Place Names helper.

I want to have the following optional Place Names in my member profiles:

  1. Schools Attended
  2. Current Church/Place of Worship
  3. Current Employer
  4. Home Neighborhood

These Place Names all need to have Locations (not Addresses) included so a Place Name is shown like this:

Mt. Zion Baptist Church
Franklin, WV, United States

So, my feature request now is for two form helpers:

  1. Location
  2. Place

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...