Map Controls

This topic contains 2 replies, has 2 voices, and was last updated by  Elad 8 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #246910

    Elad
    Buyer
    Post count: 92

    Is it possible to target zoom, street view and map/satellite button with css to move the position of these controls.

    #246964

    Kiran
    Moderator
    Post count: 7069

    Hi Elad,

    It is hard to target the map controls element on Google map. But you can achieve this by using map options filter.
    You can use this filter https://wpgeodirectory.com/codex/codex/geodirectory_filters/geodir_map_options_-map_canvas_name/ to achieve it.

    Here is sample code snippet how to use to change the position of map controls.

    
    
    // Change the position of map controls.
    function geodirectory_position_map_control_options( $map_options ) {    
        // Position should be one of TOP, TOP_LEFT, TOP_RIGHT, BOTTOM, BOTTOM_LEFT, BOTTOM_RIGHT, LEFT, RIGHT 
        
        $map_options['zoomControlOptions']['position']          = 'LEFT_BOTTOM'; // Zoom control
        $map_options['mapTypeControlOptions']['position']       = 'LEFT_BOTTOM'; // Map Type control
        $map_options['navigationControlOptions']['position']    = 'LEFT_BOTTOM'; // Navigation control
        $map_options['streetViewControlOptions']['position']    = 'LEFT_CENTER'; // Street view control
    
        return $map_options;
    }
    add_filter( 'geodir_map_options_geodir_map_v3_home_map_2', 'geodirectory_position_map_control_options', 100, 1 );

    Let us know.

    Thanks

    #247001

    Elad
    Buyer
    Post count: 92

    I was afraid of that. All my attempts so far breaks things. Thanks for your tips. I will get back to you. 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount