meteor-autoform-map icon indicating copy to clipboard operation
meteor-autoform-map copied to clipboard

[enhancement] address field

Open sakulstra opened this issue 10 years ago • 5 comments

Is it somehow possible to additionally save the address from the search box?

With the current solution we only save lat,lng which is pretty much perfect when displaying a map, but when using different views (text vs map) the lat,lng attributes are kind of useless - an option to save both would be awesome.

My current workaroud would be to have a submit callback which reads the inputfield and saves the data to an additional field.

Regards, lukas

sakulstra avatar Oct 11 '15 23:10 sakulstra

i hacked around with my non existent coffeescript knowledge and came up with this:

    saveAddress: true

AutoForm.addInputType 'map',
    template: 'afMap'
    valueOut: ->
        node = $(@context)

        lat = node.find('.js-lat').val()
        lng = node.find('.js-lng').val()
        address = node.find('.js-search').val()

        if lat.length > 0 and lng.length > 0
            lat: lat
            lng: lng
            address: address

Something like this would be nice ;) Additionally, i wanted to forbid marking on the map via click to force the user to enter a address. Therefore I comented out:

google.maps.event.addListener @map, 'click', (e) =>
            @setMarker @map, e.latLng

Would be nice to have a flag for this :) Regards, Thx for this package! Lukas

sakulstra avatar Oct 20 '15 18:10 sakulstra

+1

xpluscal avatar Feb 11 '16 09:02 xpluscal

+1, much needed

consciousweb avatar Mar 07 '16 07:03 consciousweb

+1

taorg avatar Apr 26 '16 23:04 taorg

+1 Hi, any progress on this side ? would be really useful

steven-tib avatar Sep 23 '16 14:09 steven-tib