zoom control on google maps

This topic contains 8 replies, has 4 voices, and was last updated by  Stiofan O’Connor 6 years, 8 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #423681

    Tilen
    Expired Member
    Post count: 120

    Hello,

    I want to set zoom control on right on home page map:

    I was try:

    
    
    
    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']          = 'RIGHT_CENTER'; // Zoom control
        return $map_options;
    }
    add_filter( 'geodir_map_options_geodir_map_v3_listing_map_6', 'geodirectory_position_map_control_options', 100, 1 );
    
    

    I was also try to add position of zoom control to snazzy maps code and import in GD custom google maps and position doesn’t change (at bottom)

    
    
    
    [
        {
            "featureType": "landscape.man_made",
            "elementType": "geometry",
            "stylers": [
                {
                    "color": "#f7f1df"
                }
            ]
        },
        {
            "featureType": "landscape.natural",
            "elementType": "geometry",
            "stylers": [
                {
                    "color": "#d0e3b4"
                }
            ]
        },
        {
            "featureType": "landscape.natural.terrain",
            "elementType": "geometry",
            "stylers": [
                {
                    "visibility": "off"
                }
            ]
        },
        {
            "featureType": "poi",
            "elementType": "labels",
            "stylers": [
                {
                    "visibility": "off"
                }
            ]
        },
        {
            "featureType": "poi.business",
            "elementType": "all",
            "stylers": [
                {
                    "visibility": "off"
                }
            ]
        },
        {
            "featureType": "poi.medical",
            "elementType": "geometry",
            "stylers": [
                {
                    "color": "#fbd3da"
                }
            ]
        },
        {
            "featureType": "poi.park",
            "elementType": "geometry",
            "stylers": [
                {
                    "color": "#bde6ab"
                }
            ]
        },
        {
            "featureType": "road",
            "elementType": "geometry.stroke",
            "stylers": [
                {
                    "visibility": "off"
                }
            ]
        },
        {
            "featureType": "road",
            "elementType": "labels",
            "stylers": [
                {
                    "visibility": "off"
                }
            ]
        },
        {
            "featureType": "road.highway",
            "elementType": "geometry.fill",
            "stylers": [
                {
                    "color": "#ffe15f"
                }
            ]
        },
        {
            "featureType": "road.highway",
            "elementType": "geometry.stroke",
            "stylers": [
                {
                    "color": "#efd151"
                }
            ]
        },
        {
            "featureType": "road.arterial",
            "elementType": "geometry.fill",
            "stylers": [
                {
                    "color": "#ffffff"
                }
            ]
        },
        {
            "featureType": "road.local",
            "elementType": "geometry.fill",
            "stylers": [
                {
                    "color": "black"
                }
            ]
        },
        {
            "featureType": "transit.station.airport",
            "elementType": "geometry.fill",
            "stylers": [
                {
                    "color": "#cfb2db"
                }
            ]
        },
        {
            "featureType": "water",
            "elementType": "geometry",
            "stylers": [
                {
                    "color": "#a2daf2"
                }
            ]
        },
        {
    
        "zoomControl": "true",
              "zoomControlOptions": 
               {
                 "position": "google.maps.ControlPosition.RIGHT_CENTER" }
              }
                
    
    ]
    
    

    Thanks for help,

    T

    #423764

    Kor
    Moderator
    Post count: 16516

    Hi there,

    Could you check out this post and see if it helps? https://wpgeodirectory.com/support/topic/map-controls/#post-246964

    Thanks!

    #423779

    Tilen
    Expired Member
    Post count: 120

    Hello

    I saw this post and try to use but doesn’t work (first post). I assume problem is in filter because I don’t know which filter I must use if I want to change zoom positon only on homepage map.

    I was also try with:

    add_filter( 'geodir_map_options_geodir_map_v3_home_map', 'geodirectory_position_map_control_options', 100, 1 );

    For displaying home map I use shortcode:

    [gd_homepage_map]

    in geodir-home.php

    Thanks for help,

    T

    #423854

    Alex Rollin
    Moderator
    Post count: 27815

    I will flag this for the developers to see if there is a filter you can use.

    #423988

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    The filter is map specific, i would need to view your page to see the ID used for the map. Can you provide a link please.

    Thanks,

    Stiofan

    #424021

    Tilen
    Expired Member
    Post count: 120
    This reply has been marked as private.
    #424151

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Try this (remember to include the function also)

    add_filter( 'geodir_map_options_gd_home_map', 'geodirectory_position_map_control_options', 100, 1 );

    Thanks,

    Stiofan

    P.S. i like what you have done with the map 🙂

    #424197

    Tilen
    Expired Member
    Post count: 120

    Thanks for help, it works!

    and thanks:)

    T

    #424212

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Great! You are welcome! 🙂

Viewing 9 posts - 1 through 9 (of 9 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