Disable Map Controls

This topic contains 9 replies, has 3 voices, and was last updated by  Ardin Beech 10 years, 8 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #6924

    Is there a way to disable the map controls in the google maps? i’ve tried zoomcontrol=”false” etc in the shortcode but nothing. Do i need to put the commands in the plugin php itself somewhere?

    Ardin Beech
    #6925

    I’d like to hide all of them, if possible.

    Ardin Beech
    #6926

    You can just add it straight into the shortcode, but get rid of the quotes ie use zoomcontrol=false

    See this page of the documentation for all the options.

    Dario
    #6929

    It should also work with the double quotes. The following turns pretty much everything off:

    [eo_venue_map venue="fountain-park" height="500px" zoomcontrol="false" streetviewcontrol="false" overviewmapcontrol="false" rotatecontrol="false" overviewmapcontrol="false" maptypecontrol="false" pancontrol="false"]
    

    Note if you are using shortcodes in the visual editor, be sure that the attribute names are not in bold/italic as this does seem to cause problems.

    Stephen Harris
    #6933

    I’m adding to code straight to the header with the php echo do_shortcode command. none of the map commands seem to work, however event commands (event_start_before=”next monday”) and width/height etc do.

    Basically, i want to use the event map to replace the standard image slider on the site.

    • This reply was modified 10 years, 8 months ago by  Ardin Beech.
    Ardin Beech
    #6936

    That also works for me:

     <?php echo do_shortcode( '[eo_venue_map ... ]' );?>
    

    But there’s a better (more effecient) way of displaying a map in the template pages: http://codex.wp-event-organiser.com/function-eo_get_venue_map.html

    E.g.

     <?php echo eo_get_venue_map(
          array( 'london-eye', 'edinburgh-castle' ),
          array(
            'zoomcontrol' => false, 
            'streetviewcontrol' => false,
            'height' => "500px"
           )
     ); ?>
    

    So when you try do_shortcode() /eo_get_venue_map() – what happens? Does the map appear, but the options do not take effect? Does the map not apear? How / where are you using those functions?

    Stephen Harris
    #6945

    I’m editing the header file in the wordpress editor, and pasting this in, so it replaces the image slider:

    <?php echo do_shortcode(‘[event_map event_start_before=”next monday” showpastevents=”false” zoomcontrol=false streetviewcontrol=”false” overviewmapcontrol=”false” rotatecontrol=”false” overviewmapcontrol=”false” maptypecontrol=”false” pancontrol=”false” width=”100%” height=”300px”]’); ?>

    Map displays fine, but so do all the controls. It’s not the end of the world if they can’t be disabled. Just thought it would look cleaner.

    Ardin Beech
    #6946

    Removing all the quotes makes no difference.

    • This reply was modified 10 years, 8 months ago by  Ardin Beech.
    Ardin Beech
    #6948

    Ah, you’re using the event map. Just found that there is a bug with using the (boolean) map properties with that shortcode. I’ll release an update shortly, but the fix is fairly simple. In includes/shortcodes.php near the top of the function _eventorganiser_event_map_shortcode_handler(), (line 318), add the following:

    //Cast options as boolean:
    $bool_options = array('tooltip','scrollwheel','zoomcontrol','rotatecontrol','pancontrol',
           'overviewmapcontrol','streetviewcontrol','draggable','maptypecontrol');
    foreach( $bool_options as $option  ){
        if( isset( $atts[$option] ) )
            $atts[$option] = ( $atts[$option] == 'false' ? false : true );
    }
    

    Those attributes should then work for you.

    Stephen Harris
    #6963

    Yes! You’re amazing! Thanks.

    Ardin Beech
Viewing 10 posts - 1 through 10 (of 10 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.