Skip Navigation

[Résolu] Customize Maps on Forms

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
How to use only either of the Address inputs in Forms?

Solution:
https://toolset.com/forums/topic/maps-preview-on-cred-forms/#post-1070024

This support ticket is created Il y a 6 années et 4 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Ce sujet contient 6 réponses, a 2 voix.

Dernière mise à jour par julieP Il y a 6 années et 4 mois.

Assisté par: Beda.

Auteur
Publications
#1066845

A request please for more & better control over the use of class toolset-google-map-inputs-container. The costs involved with maps now means we need to be able to decide whether the 'show/hide coordinates, use my location and map preview' are displayed in cred forms or not.

It's not possible to target these elements with css alone. Please see this ticket for further details:-

https://toolset.com/forums/topic/customising-toolset-google-map-container-class-on-post-forms/#post-1066424

Thanks

#1069152

If I understand correctly you want to be able in removing the Map and Lat/Long from the native Toolset Address Field input and show only the Text (Google AutoSuggest Populated) field of the address, when you use this in a form or even backend (we try to keep thins "unison")

I think this is not impossible, but I miss the point of it.
I suspected according your comments that this is related to the costs Google added on the back of the users.
However, I doubt not showing the map will at all affect those costs.

I think, but am totally not sure, Google counts by request, and that would be when you use the Text Input as well (it actually uses the suggestions of Google, so I bet there is a count on that as well)

Is this the only reason you want just the address field?

==> I see as well a reason of pure design concerns.
Maybe my site should be of a certain look and hence use only lat/long, of whatever I choose (drag and drop the pin on the map only, for example.
This is not possible right now and makes sense to add if developers agree.
I see a possible solution in splitting the ShortCode "[cred_field field='address-field' value='' urlparam='' class='form-control' output='bootstrap']" into some more /lat and long/map/text field as standalone.
This could also help to place the items in different places on the form.

I'll forward this and consider the issue handled, unless I misunderstood or you would have some feedback on above message.
==> Do you know of the azure maps integration already?

#1069250
cred form map.JPG

I guess we could debate all day about the cost implications and we will have to agree to disagree about whether it will make any difference!

Yes, you have understood correctly but I also would like to be able to remove the two bits that appear above the map (shown ringed in red on the uploaded image) and actually I don't really want the autocomplete function to run either! Not on the cred forms anyway - in searches that's fine.

The reason is that I want to display the value of that 'address' field elsewhere on the site and visitors will expect to see a postcode in the format AA11 1AA (99% of the time anyway; there are a few exceptions). However, if I enter the postcode DN11 6UN into the address field, the autocomplete function translates it into Healaugh, Richmond DL11 6UN, UK which is nonsense in the context of where I'm displaying that value via a CT.

yes, I am aware of Microsoft Azure Maps integration; are you saying the elements I'd like more control over don't appear when using an Azure maps key?

#1070024
Bildschirmfoto 2018-08-01 um 14.38.27.png

Well, but then I do not suggest to use an address field.

That Field is made on purpose like that (with autosuggest) and if you do not use it, the address will be wrong either way later, as Google will guess them, unless you enter them (as existing) precisely.
And this, can be done in a simple text field, and that can be used as a input later, if you need it to be displayed on a map.
The map markers can take data from several things, not only native Address Fields.

But as said, that is the purpose of the field - we cannot change that.

What we eventually can, is split it in 3 sections as said:
- Text
- Lat/Long
- Map (with the drag and drop pin)

That does not mean that the fields will not get populated BTW, as they must be populated to work.
But, it would mean they more controllable, and you can insert where/which you want.

That solves no cost aspect, as that is not an opinion question, it depends on what Google charges, and they do charge by amount of requests - hence, to avoid that, you need to not use an Address Field.

You can save addresses in native Single Line Fields and used them on maps later.
It's the same process as With address fields, you just choose the other input in the Map shortcodes (see screenshot)

Of course, that field must hold a valid address (which is done for you automatically if using the Toolset Address field) and it then will of course produce a call to Google when displayed, on a map.

But at least with this you would avoid the MAP API being used (requested) on the Forms.

Is that a possible solution for you?

#1070102

Aha! Now that is VERY interesting 🙂

I had it in my head that in order to display on map with markers, the data HAD to come from an address field. I've just tested it and you're right, it doesn't!! That fits my requirements (for this project) much better, thank you.

I can see different scenarios though where having the text, Lat/Long and Map in 3 different sections for more control would be ideal. Christian has helped me find a solution to hide these elements using CSS in the meantime but, of course, it's always better if unwanted content doesn't load in the first place.

Are you happy to submit the idea to the developers for consideration (then I'll close ticket)??

#1070107

Thanks for confirming the instructions do work as stated.

Yes, sure, that request is still filed here with me, and the Developers will evaluate it.

I see the usage cases as well. I just wanted to clarify that it wont save Google data, and that if this is your concern, the above solution may help better 🙂

Thanks!

#1070133

Awesome Beda, thanks for your help 🙂