Home Forums Plugin Support WP User Frontend Pro Google Maps

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Tareq Hasan 6 years, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1519

    ForestNation
    Participant
    Post count: 27

    Hi,

    I need extended map facilities and need to use Pronamic Google Maps plugin.

    How do I make the address and map appear in the front end user pro form?

    #1521

    Tareq Hasan
    Keymaster
    Post count: 2831

    Did you checked the Address Button in the google map custom field? Can you describe what extended facilities do you need?

    #1523

    ForestNation
    Participant
    Post count: 27

    Hi

    I need the user to be able to enter their address  – your plugin allows this.

    Then I want to show a map with the location on the post, in the side bar.  So far all I can see is that your plugin just shows the lat and long coordinates.

    I also need to be able to show one large map with all the posts from selected post types.  Pronamic Google Maps plugin seems to offer me the functionality that I need. Can I do this with your map feature in your plugin? 

    Thanks for answering so quickly

    #1529

    Tareq Hasan
    Keymaster
    Post count: 2831

    You could show the map using shortcode [wpuf-meta name="meta_key_name" type="map"].

    To show the large map from a post type needs some custom work I guess. The way pronamic maps works, it's bit different here. They store the co-ordinates in different meta fields where WP User Frontend stores it in a single meta field. But the principle is the same.

    #1535

    Tareq Hasan
    Keymaster
    Post count: 2831

    This is a solution to that makes compatible with Pronamic Google Map plugin. As WP User Frontend saves the latitude and longitude, where pronamic saves them in two different meta fields, the solution is to split the User Frontends location info to compatible pronamic meta fields.

    You can paste this code into your themes functions.php and need to provide the meta key (e.g: $custom_field = 'address'; ) of the google map field used in the form builder.

    [php]
    function wpuf_pronamic_location( $post_id ) {
    $custom_field = ‘address';

    if ( !class_exists(‘Pronamic_Google_Maps_Post') ) {
    return;
    }

    if ( isset( $_POST[$custom_field] ) ) {
    $address = $_POST[$custom_field];

    list( $def_lat, $def_long ) = explode( ‘,', $address );

    if ( $def_lat ) {
    update_post_meta( $post_id, Pronamic_Google_Maps_Post::META_KEY_LATITUDE, $def_lat );
    }

    if ( $def_long ) {
    update_post_meta( $post_id, Pronamic_Google_Maps_Post::META_KEY_LONGITUDE, $def_long );
    }

    if ( $def_lat && $def_long ) {
    update_post_meta( $post_id, Pronamic_Google_Maps_Post::META_KEY_ACTIVE, true );
    }
    }
    }

    add_action( ‘wpuf_add_post_after_insert', ‘wpuf_pronamic_location' );
    add_action( ‘wpuf_edit_post_after_update', ‘wpuf_pronamic_location' );
    [/php]

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Google Maps’ is closed to new replies.