• Thanks so much for the map helper function… all works well except that the the marker doesn’t show up in the front end.

    All is fine in the post screen (including marker), and the map displays perfectly on the site, except for the missing marker.

    Any suggestions for debugging?

    (The marker argument is of course set to true)

    https://ww.wp.xz.cn/plugins/meta-box/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter cfgmiller

    (@cfgmiller)

    I ran console.log(marker) in the helper function:

    http://gyazo.com/54377083556c9e23ce70e4804e8ec442

    Not sure if there are any clues there, but the position is correct…

    (Let me know if you need me to expand anything there.)

    So weird!

    Plugin Author Anh Tran

    (@rilwis)

    The info in console looks like a google maps object and it doesn’t show error.

    May I ask how do you display map in the frontend? Do you use rwmb_meta function (as shown in this documentation) or you write your custom code?

    Thread Starter cfgmiller

    (@cfgmiller)

    Thanks, yes I use your function. And as you can see, the arguments are as you indicate (I haven’t changed the info window yet, as it’s not showing up!).

    <?php $args = array(
    'type' => 'map',
    'width'=> '100%', // Map width, default is 640px. You can use '%' or 'px'
    'height' => '300px', // Map height, default is 480px. You can use '%' or 'px'
    'zoom' => 14,  // Map zoom, default is the value set in admin, and if it's omitted - 14
    'marker'  => true, // Display marker? Default is 'true',
    'marker_title' => 'hello', // Marker title when hover
    'info_window'  => '<h3>Info Window Title</h3>Info window content. HTML <strong>allowed</strong>', // Info window content, can be anything. HTML allowed.
    );
    echo rwmb_meta( 'CTL_loc', $args );
    ?>
    Thread Starter cfgmiller

    (@cfgmiller)

    Here is the script running on the site:

    http://gyazo.com/53e16b9e12d6647aebb8eb1e20f2b374

    Plugin Author Anh Tran

    (@rilwis)

    Hmm, the code looks fine, Javascript code seems also fine. I’m not sure why it happens. Maybe you can try with custom JS code? It’s not the best solution, and I guess the code will be similar to what outputted by the plugin, but maybe it works for you.

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

The topic ‘Map marker missing’ is closed to new replies.