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>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.