Remove "Map/Satellite" from Home Page Map

This topic contains 4 replies, has 3 voices, and was last updated by  Dylan 8 years, 8 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #46267

    Dylan
    Expired Member
    Post count: 40

    I searched for this but did not find any other posts discussing this.

    I’m trying to remove the “Map/Satellite” map style toggle button within the Google Map at the top of the Home Page. It’s a very simple switch, which only requires changing “mapTypeControl:!0” to “mapTypeControl:!1” on line 8 of “goMap.min.js” which is nested within geodirectory -> geodirectory-assets -> js.

    Is there a simple toggle within the plugin to change this that I missed? If not, how can I modify the javascript, so it won’t be overwritten when the next plugin update is made?

    Thanks ahead of time for your help.

    #46284

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I know for sure there isn’t an option for this.

    I think the only way would be to unenqueue that script and enqueue the modified version from within the theme.

    Not 100% sure this is feasible though, so i need to ask to Stiofan to let us know.

    I’ve flagged this for him.

    Thanks

    #46291

    Dylan
    Expired Member
    Post count: 40

    Paolo,

    Thanks for looking into this.

    It would make a great checkbox option in the settings. We’re removing it as well as the Street View “Orange Man” from the map on our mobile layout, because at that map size, we need as much of the map viewable as possible.

    #46387

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Dylan,

    There is a hook to do this, i have made an example for you here: https://gist.github.com/Stiofan/2ddaebd31553f476bc59

    You would add this code to your theme functions.php file.
    The example removes the map type options but you can also do it for streetview control by adding another option below the current one

    $options['streetViewControl']=false;

    These are per map so you will have to find the ID of the map you want to affect by using the inspection tool or viewing the source code, the example should keep you right.

    Thanks,

    Stiofan

    #47009

    Dylan
    Expired Member
    Post count: 40

    Stiofan,

    You’re awesome. This worked perfectly. Thanks for the quick help on this!

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

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

Open Support Ticket