Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #479881

    Hi,

    I have multiple worldwide locations on a Google map and would like to display the map so that it shows the full map of the world with all of the locations in view. I have played around with the different Zoom Levels and feel that I need something between 2 and 3. Is is possible to customise this somehow? Zoom level 2 repeats the map of the world and Zoom 3 doesn’t show all of the locations.

    Can anyone help?

    http://www.nanolia.com/www/eco3/distributors/

    #480534

    Hi lol4000,

    I’ve never tried anything like that myself but maybe something like this could help? http://stackoverflow.com/questions/12458456/how-to-change-the-zoom-level-of-google-maps-programmatically

    Cheers!
    Rikard

    #480639

    Yes that should work, can you tell me which file I can find the code for Google maps so that I can edit? Im not brilliant with Jquery but should hopefully be able to suss this out.

    many thanks

    #480839

    Hey!

    Please go to Enfold/config-templatebuilder/avia-shortcodes and edit google_maps.php file

    Best regards,
    Yigit

    #480969

    Thanks for that however, I thought the Google API was configured using Jquery? The code in the php file looks like its for the admin side of things.

    #480997

    Hi!

    You should be able to target the map through a header.php snippet and change the zoom from there.

    Regards,
    Basilis

    #482410

    OK, so I have added the below code to the header.php file:

    <script>
    var mapOptions = {
      zoom: 8,
    };
    map.setOptions(mapOptions);
    </script>

    I get an error in the javascript console: Uncaught reference error: Google is not defined.

    • This reply was modified 9 years, 4 months ago by lol4000.
    #482840

    Hi!

    I don’t think it’s the correct way of adding the script. Anyway, it will actually do the same thing as the Zoom Level settings if you manage to make it work. I tried to find the closest zoom level to show the whole world map on my installation and I found out that zoom level 3 and a Map height of 700px is the closest option.

    Cheers!
    Ismael

    #482864

    The script has already been added hasn’t it? I simply want to overwrite the settings and what I have above should do that according to the documentation. I wanted to customise the Pan also which isn’t an option within the Enfold map settings.

    #483435

    Hi!

    Perhaps what your wanting to do is something like this, http://stackoverflow.com/questions/15719951/google-maps-api-v3-auto-center-map-with-multiple-markers. It’s kind of bordering on custom work though. I think your best bet is to play around with the zoom setting until they are all in view.

    Regards,
    Elliott

    #483448

    That would be great, however, I get an JS error message whenever I try adding custom code in the header.php file as suggested.

    I have given up with this now, thanks anyway.

    #483712

    Hi,

    Sorry we couldn’t be of more help, please let us know if you should have any more questions on the topic.

    Thanks,
    Rikard

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.