-1

I am using Maps module of Divi theme and i would like the info window on this map to stay open by default, instead of onclick.

http://www.wilsonhrm.nl/contact-us/

How can I achieve that?

  • If DIvi provides such option only then you can do it, else you have to create manually. You will find lots of examples on google to display map with custom marker and infowindow. – Rishabh Apr 26 '17 at 6:05
  • Please note that this is not a Divi support forum - instead visit elegant themes to get help with module configuration. If you have a code question then please include the relevant code, so people can tell you what to change. – Philipp Apr 26 '17 at 10:10
  • I tried there, They have no idea about it. – Loudframe Apr 26 '17 at 12:33
-1

Divi don't have a option to pop up marker on load, but you can do it this way:

Open file divi\includes\builder\scripts\frontend-builder-scripts.js

find this:

google.maps.event.addListener(marker, 'click', function() {
                                if( infowindow_active ) {
                                    infowindow_active.close();
                                }
                                infowindow_active = infowindow;

                                infowindow.open( $this_map_container.data('map'), marker );
                            });
                        }
                    });
                }

and replace with this:

google.maps.event.addListener(marker, 'click', function() {
                                if( infowindow_active ) {
                                    infowindow_active.close();
                                }
                                infowindow_active = infowindow;

                                infowindow.open( $this_map_container.data('map'), marker );
                            });
                infowindow.open( $this_map_container.data('map'), marker );
                        }
                    });
                }

now the map pin will be loaded open.

Just remember that this is core modification and you need to keep in mind when you update theme.

|improve this answer|||||
  • no answer should suggest changes to core, plugin or theme files. If such changes are required than the answer is "it is impossible to do" – Mark Kaplun Apr 26 '17 at 7:29
  • I use this "hack" on 20+ sites, I just want to help, that's all. – David Klhufek Apr 26 '17 at 7:39
  • this is a fork of the theme that requires setting up git and knowing how to merge the changes when upgrades happen. It is totally cool that you know how to do it, but for people that come here and just copy and paste code from answers it is just an invitation to future problems. Unless you volunteer to help all those people in the future, you are doing them very little good. – Mark Kaplun Apr 26 '17 at 7:45
  • ..understand, you are right, I will keep in mind for future answers. – David Klhufek Apr 26 '17 at 7:53
  • Dear David, Thanks a ton! this is exactly what I needed. I wasn't able to figure out where to put the script. however, unfortunately it didn't work. Am I missing any steps? Please do not worry about core modification, i will be extra careful and make backups to rollback to. Thanks once again. – Loudframe Apr 26 '17 at 8:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.