I am working on a project where an import of content (using WP All Import) that has two fields in it. Lat and Long, and I needed to generate a Google map from it.
This setup uses ACF (Advanced Custom Fields) and MapPress. While you will not be creating maps individually as you normally would with MapPress you will need to install the plugin.
Here’s the code.
<?php $location1 = get_field('Address'); ?> <?php $location2 = get_field('Lat'); ?> <?php $location3 = get_field('Long'); ?> <?php $mymap = new Mappress_Map(array("width" => 650)); ?> <?php $mypoi_1 = new Mappress_Poi(array("title" => "", "body" => $location1, "point" => array("lat" => $location2, "lng" => $location3))); ?> <?php $mymap->pois = array($mypoi_1);?> <?php echo $mymap->display(array("directions"=>"none"));?>