Okay
  Public Ticket #542089
Google Map in Tab
Closed

Comments

  • Brittany started the conversation

    Hi, I am trying to put a Google map in a tabbed section, you can see it here: http://farmsteadtx.org/#location

    I have set up the map in the tab, however nothing will show up. Is there any custom CSS I can place in the General Settings of the Salient theme to fix this?

  •  8,996
    Tahir replied

    Hey ,

    No i am afraid tabs dont allow dynamic content in it.

    Thanks


    ThemeNectar Support Team 

  •  2
    Ben replied

    I'm needing to insert a Google map inside a tabbed section as well. Are you saying this cannot be done at all, or are you guys just aren't willing to provide a fix? Here is a link to the page where I'm trying to implement this:

    http://synergydandc.com/newsite/contact/

    It would be greatly appreciated if you could provide a solution. Thanks in advance.

  •  8,996
    Tahir replied

    Hey Ben,

    Try to add this:

    window.dispatchEvent(new Event('resize'));
    

    into this section of the init.js file located in the js folder

    $('body').on('click','.tabbed > ul li a',function(){
    

    right before the return false;


    Thanks 



    ThemeNectar Support Team 

  •  2
    Ben replied

    Yes, that fixed it! Thanks so much!

    Btw, why don't you guys just include this line of code in the theme's 'init.js' so I don't have to manually add it every time there is a theme update? Otherwise, it will just get overwritten each time I update, which will be very inconvenient.

    Is this something that can be included for future releases?

  •  2
    Ben replied

    Actually, there is still an issue with this. It does show the map, but not centering on the lat/long points I've entered by default. It looks like it's making the 'center' to the top left instead, because when I drag the map over to the right and down, I see my map marker.

    http://synergydandc.com/newsite/contact/ (click the 'Find us on the map' tab to replicate)

  •  8,996
    Tahir replied

    Hey Again,

    Please adjust the zoom level . The code earlier provided only works when you click a tab and there is no change in the marker position if you switch btw tabs. 

    Thanks 


    ThemeNectar Support Team 

  •  2
    Ben replied

    Adjusting zoom level does not resolve the issue, but offsetting the lat/long center points works as a hack. Not ideal, but I guess this will be good enough to get me by for the time being. 

    Circling back on my question regarding fixing this for the next release, is this something that can be done? Seems like a simple option that should be available (to have a map inside a tabbed section), and it's a shame that it doesn't work right out of the box.

    Thanks in advance! Salient is the best theme I've ever used and just want to help make it even better. :-)

  •  8,996
    Tahir replied

    Sure, Will add it to the Wishlist. 

    Cheers


    ThemeNectar Support Team