WP Geo
Map not showing in theme Elbee Elgee (5 posts)

  1. KeithMitchell
    Posted 3 years ago #

    I tried a couple different themes and map shows perfectly! But when I switch to Elbee Elgee, it should the map box and controls, but no map. Any suggestions?



  2. FranceImage
    Posted 3 years ago #

    It does work (http://franceimage.com/test/elbee-wpgeo/)

    Try with a fresh install with only wp-geo activated

  3. KeithMitchell
    Posted 3 years ago #

    Sorry. I forgot to mention. I am using a mashup to enable the map to show on a Gravity Form

    Map box and controls show, but not the map. Tried different themes and works ok. If you have any suggestions greatly appreciate it. But I do understand its a mashup, so probably not really an issue with the plugin.

    Here is the code:

    add_filter("gform_pre_render", "gravityforms_wpgeo_mashup");
    function gravityforms_wpgeo_mashup($form) {
        //REPLACE 1 with your actual form id
        $my_geo_form = 2;
        if($form["id"] !=$my_geo_form)
            return $form;
        // find IDs of latitude&longitude custom fields
        foreach($form["fields"] as &$field){
                if($field["postCustomFieldName"]=="_wp_geo_longitude") $field_lng = $field["id"];
                if($field["postCustomFieldName"]=="_wp_geo_latitude") $field_lat = $field["id"];
        // show map only if latitude&longitude custom fields exist
        if($field_lng && $field_lat ) :
            // load "WP Geo" plugin
            require_once( WP_PLUGIN_DIR . '/wp-geo/wp-geo.php' );
            global $wpgeo;
            $wpgeo = new WPGeo();
            $zoom = 2;
            $map = $wpgeo->mapScriptsInit( 20, 0,$zoom, true, false );
            $map .='
                <input type="hidden" name="wpgeo_map_settings_zoom" id="wpgeo_map_settings_zoom" value="" />
                <input type="hidden" name="wpgeo_map_settings_type" id="wpgeo_map_settings_type" value="" />
                <input type="hidden" name="wpgeo_map_settings_centre" id="wpgeo_map_settings_centre" value="" />
                <input name="wp_geo_latitude" type="hidden" size="25" id="wp_geo_latitude" value="" />
                <input name="wp_geo_longitude" type="hidden" size="25" id="wp_geo_longitude" value="" />
                <script type="text/javascript">
                    jQuery(document).ready(function() {';
                        $map .='var my_geo_form= '.$my_geo_form.';';
                        $map .='var field_lng= '.$field_lng.';';
                        $map .='var field_lat= '.$field_lat.';';
                        $map .='
                        jQuery("#wp_geo_map").click(function(e) {
                <div id="wp_geo_map" style="width:auto; height:400px"></div>';
            // find ID of section with cssClass "wpgeo" and put the map into description
            foreach($form["fields"] as &$field){
        return $form;
  4. Ben Huson
    Plugin Author

    Posted 3 years ago #

    Hi @KeithMitchell,

    I'm currently working on a proper integration for WP Geo and Gravity Forms.
    Can you let me know are you using the Gravity form to create a new post with a geo location? or just as a contact for to pass through location coordinates to an enquiry/email?

  5. KeithMitchell
    Posted 3 years ago #

    Hi Ben, basically I am creating a form to show a map, allow user to click a position, and have the lat and long populate into fields that will be populated in with my custom post type.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Geo
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.