Support

Account

Home Forums Front-end Issues The Location Plugin Reply To: The Location Plugin

  • This code worked a bit better for me than Giu Tae Kim’s

    <div id="contact-map-canvas"></div>
    
        <script>
            function initialize() {
              var myLatlng = new google.maps.LatLng(<?php the_field('locations');?>);
              var mapOptions = {
                zoom: 4,
                center: myLatlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
              }
              var map = new google.maps.Map(document.getElementById('contact-map-canvas'), mapOptions);
    
              var marker = new google.maps.Marker({
                  position: myLatlng,
                  map: map,
                  title: 'Hello World!'
              });
            }
    
            google.maps.event.addDomListener(window, 'load', initialize);
    
        </script>