Complex map field for Advanced Custom Fields.
Supports
$value = get_field('mapmore_field');
switch ( $value['type'] ) {
case 'rectangle':
?>
<script>
new google.maps.Rectangle({
bounds: <?php echo json_encode($value['bounds']) ?>,
map: map
});
</script>
<?php
break;
case 'polyline':
?>
<script>
new google.maps.Polyline({
path: <?php echo json_encode($value['path']) ?>],
map: map,
});
</script>
<?php
break;
case 'polygon':
?>
<script>
new google.maps.Polygon({
path: <?php echo json_encode($value['path']) ?>],
map: map
});
</script>
<?php
break;
case 'circle':
?>
<script>
new google.maps.Circle({
center: {lat: <?php echo $value['lat'] ?>], lng: <?php echo $value['lng'] ?>},
radius: <?php echo $value['radius'] ?>,
map: map
});
</script>
<?php
break;
case 'marker':
?>
<script>
new google.maps.Marker({
position: {lat: <?php echo $value['lat'] ?>], lng: <?php echo $value['lng'] ?>},
map: map,
animation: google.maps.Animation.DROP
});
</script>
<?php
break;
}
Add any *.svg files to images/icons
they will be automatically available as Marker icons
Add this to your theme's functions.php
function mapmore_acf_google_map_api() {
acf_append_setting('mapmore_google_api_key', 'YOUR_GOOGLE_API_KEY');
}
add_filter('init', 'mapmore_acf_google_map_api');
EXTENDED_DESCRIPTION
This ACF field type is compatible with:
acf-mapmore
folder into your wp-content/plugins
foldercomposer run-script test
With local setup
composer run-script test:wordpress
Using docker
docker-compose run phpunit
composer install
composer:test:wordpress
Please see readme.txt
for changelog