This topic contains 4 reply and 2 voices, and was last updated by Tareq Hasan 6 years, 6 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
March 26, 2013 at 10:41 am 1519
Tareq Hasan 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?
March 26, 2013 at 11:02 am 1521
Tareq Hasan Tareq Hasan

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

March 26, 2013 at 11:09 am 1523
ForestNation ForestNation

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

March 26, 2013 at 1:02 pm 1529
Tareq Hasan Tareq Hasan

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.

March 26, 2013 at 2:45 pm 1535
Tareq Hasan Tareq Hasan

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 4 Posts - 1 through 4 (of 4 total)