Passer la navigation

[Résolu] Let user add a pin to the map in Toolset Forms

This support ticket is created Il y a 4 years, 11 months. 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.

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

Dernière mise à jour par martinH-10 Il y a 4 years, 11 months.

Auteur
Publications
#2084449

Tell us what you are trying to do? I am trying to create Form for adding new posts, where user can click to the location in map and add it as a marker.

Is there any documentation that you are following? Nope.

Is there a similar example that we can see? lien caché

Thanks for any advice

#2084643

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+01:00)

Sorry, that's not possible, it is only possible to add addresses by typing an address in the address field, or entering latitude and longitude coordinates directly.

If you wanted to try a custom implementation it may be possible to write JavaScript that reponds to the action of a click on the map, retrieving the coordinates, and then updating the address field with those coordinates, but you would need to consult the Google Maps API documentation to understand what's involved (assuming you are using Google rather than Azure).

You may find the following snippet helpful as an example of how to get the map object once the map has been rendered so that you can then work with:

jQuery(document).ready(function ($) {

    $(document).on('js_event_wpv_addon_maps_init_map_completed', function (event, event_settings) {

        // Get the map using our .get_map() method...
        var mapid = 'map-1';
        var myMap = WPViews.view_addon_maps.get_map(mapid);

    });
});

Get started with the Google Maps API here: lien caché

#2096713

My issue is resolved now. Thank you!