It's common to use a multi-line text field to format addresses, and a multi-line address looks much nicer when displayed on its own.

It seems that this module could implement a formatter for multi-line text fields as well. Any text can be one line after you run strip_tags and regex away the newlines :)

CommentFileSizeAuthor
#6 simple_gmap-textarea-1606756-6.patch488 bytesdrupov
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Status: Active » Closed (duplicate)
Allie Micka’s picture

Status: Closed (duplicate) » Active

I understand your interest in limiting scope for this module, but it seems dirty to mandate 2 fields when 1 will do, while imposing formatter-specific requirements on your field data.

What I'm asking for is the ability to create a field that contains information that is meaningful on its own and can be used in a variety of displays. And then I'm asking for this module to add value to that data by allowing administrators to present it as a map. This is much more in keeping with the philosophy behind fields, widgets and formatters than creating a field that is only useful for one formatter.

Would you reject a patch that consolidates a multi-line field lines and nominates this formatter for those field types?

jhodgdon’s picture

I'd probably accept such a patch. :)

GemVinny’s picture

Is there any progress with this? Or does it still need doing?

Multiple pins would be great too :)

jhodgdon’s picture

I have no immediate plans to add the multi-line feature, so yes, if someone wants it to be done, it still needs to be done.

Regarding multiple pins, I do not think that is possible within the scope of how this module works, and in any case it would be a separate issue (and maybe a duplicate of one already filed and marked "won't fix"? you could try a search).

drupov’s picture

Issue summary: View changes
FileSize
488 bytes

Modifying the 'field_types' key in the 'simple_gmap' array in hook_field_formatter_info should be enough?

I made a patch for that. This works for me. Please review.

Ah, and don't forget to clear cache after applying the patch.

jhodgdon’s picture

Status: Active » Needs work

No, that would only *maybe* work if the multi-line field was plain text, but both text_long and text_with_summary can be HTML-formatted. This formatter will not work properly with those fields. It also probably needs to do something sensible with line breaks, when it forms the URLs for maps and iframes.

-Mania-’s picture

In case anyone else is looking for something similar I found a pretty neat way of using your own fields without touching the Google Maps field.

I'm using the Address Field module to gather address details but you could use your own custom fields too. I then use Rules to populate the Simple Google Maps field with all the relevant address information whenever the node is saved. Afterwards you can hide the Google Maps field (CSS or with permissions) as it's not really needed anymore. This way you have full control and don't have to copy-paste address details around.

Thanks for the super awesome module! I get so excited when I find a simple Drupal module that just works.

jhodgdon’s picture

Title: Work with a multi-line text field » Add support for long text fields (7.x)

Related issue was filed for 7.x so I am changing the title so they are the same.