Viewing 13 replies - 16 through 28 (of 28 total)
  • Plugin Author Ben Huson

    (@husobj)

    Hi Roni,

    Thanks for all your feedback on the dev version – really helpful.
    I’ll try to find time to look into all these issues soon.

    The Gravity Forms integration is a bit of a tricky one as the admin-type map required the loading of lots of things that weren’t required just to show maps on the front end, so I re-factored a lot of it to only load in admin.

    I agree, there should be some sort of function so you can load manually when needed.

    Thanks

    Ben

    Ok, posting solutions in case someone gets in same trouble ??

    Issue #2 solved using do shortcode in template, also in WP Geo settings, checkbox to show maps on custom post types:
    echo do_shortcode('[wpgeo_map]');

    Issue #3 solved (at least until you include that option in the plugin itself):
    a. WP Geo settings checkbox to include maps on all pages
    b. create a page with mash-up map with template (or you can use shortcode directly in that page) and placing code

    echo get_wpgeo_map( array(
    		'post_type' => 'YOUR_CUSTOM_POST_SLUG',
    		'posts_per_page' => -1
    		) );

    c. put this chunk of code in functions.php to prevent WP Geo producing scripts and includes in all pages…

    add_action('get_header', 'remove_wpgeo_scripts');
    function remove_wpgeo_scripts() {
    	if ('YOUR_CUSTOM_POST_SLUG' == get_post_type() || is_front_page()){ // include WP Geo code on custom posts where I need to show map and on front page of the site where I display map
    		return;
    	} else if ( !is_page( 'ID_OR_SLUG_OF_YOUR_MASH_UP_PAGE' ) ) { // remove WP Geo code from all except my mash-up page
    		global $wpgeo;
    		remove_action( 'wp_enqueue_scripts', array( $wpgeo, 'includeGoogleMapsJavaScriptAPI' ) );
    		remove_action( 'wp_head', array( $wpgeo, 'wp_head' ) );
    		remove_action( 'wp_footer', array( $this, 'wp_footer' ) );
    		remove_action( 'admin_footer', array( $wpgeo, 'wp_footer' ) );
    		remove_action( 'wp_enqueue_scripts', array( $wpgeo, 'enqueue_scripts' ) );
    	}
    }

    So, only issue #1 remains unsolved ??

    Plugin Author Ben Huson

    (@husobj)

    Roni, For issue #2 the ‘wpgeo_map’ shortcode essentially just calls the template function get_wpgeo_post_map() so you should be able to use:

    <?php echo get_wpgeo_post_map(); ?>

    or

    <?php echo wpgeo_post_map(); ?>

    Yes, that works too now ??

    Plugin Author Ben Huson

    (@husobj)

    Consider the GitHub URl to current up to date development version:
    https://github.com/benhuson/WP-Geo/tree/3.2.dev

    I’ll be moving it away from Google code over time as I have had much more useful input from people since I have hosted it on GitHub.

    Installed that version (3.2dev) and it worked with V3, contrary to non-beta version with V2.
    Found two bugs so far:
    1. It nags me to update it.
    2. When I do <div id="map" style='display:none;'><?php if ( function_exists( 'wpgeo_post_map' ) ) wpgeo_post_map(); ?></div> and make the div appear, the map doesn’t appear. When I remove the display:none I can toggle it just fine (make it appear and disappear).

    Plugin Author Ben Huson

    (@husobj)

    @qbart I think this is an issue whereby the Google Map is not created properly if it is initially hidden from view.

    You could try triggering a JavaScript map resize event after you show the map where ‘mapname’ is the Javascript ID of the map to see if that forces the map to redraw itself:

    google.maps.event.trigger(mapname, 'resize')

    Thanks for the tip, I think I’ll get that to work eventually indeed.
    Nothing on WP GEO’s end, that is sure.

    WP GEO has stopped to work, and I get the error:
    The Google Maps API server rejected your request. The “sensor” parameter specified in the request must be set to either “true” or “false”.

    Maybe it is because of something I’ve done, but I’ve changed themes and disabled all other plugins, so maybe not.
    I’ll continue to try to fix.

    Aaand it’s gone.
    Don’t know what that was.

    Have you guys got it to work on the frontend yet ?
    I dont use gravity forms but a theme build post form.
    Any idea ?

    Plugin Author Ben Huson

    (@husobj)

    WP Geo 3.3 now release.
    Please post any new issues as a new thread.

    For Gravity Forms, I’ve hacked out the code below based on the previous technique to add a map to a form. This bit doesn’t actually use WP-Geo methods, but does rely on WP-Geo having correctly sorted out Google Maps API access. The result is correctly stored as a GForms entry, and as a post if you add in the required custom fields.

    This is not recommended for production sites, though, and it would probably be better to do it as enqueued javascript. But it works on my machine(tm).

    https://pastebin.com/hzfEGUke

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘WP Geo with Google Maps v3 – Please help by testing…’ is closed to new replies.