Thanks a lot, that gave me some ideas.
I have added this function to my themes functions.php file:
function addBGMPOffsetOnDuplicates( $placemarks )
// Todo: store the coordinates in an array and search through that. Tried it, didn't work, the search came up empty every time.
$newPlacemarks = array();
$doneCoordinates = ""; //Store coordinates we have checked out
foreach( $placemarks as $placemark )
$coordinates = $placemark['latitude'] . $placemark['longitude']; //Get the coordinates x and y set
while (substr_count($doneCoordinates, $coordinates) > 0) // Do these coords exist in our buffer?
$longitude = (double)$placemark['longitude'];
$longitude -= 0.0000030; //Add offset
$placemark['longitude'] = strval($longitude);
$latitude = (double)$placemark['latitude'];
$latitude -= 0.0000030; //Add offset
$placemark['latitude'] = strval($latitude);
$coordinates = $placemark['latitude'] . $placemark['longitude']; //Get the coordinates x and y set again, the correct location might exist as well
$doneCoordinates .= $coordinates; //Add the processed coordinates to our buffer
$newPlacemarks = $placemark; //Add the corrected placemark to the output array
add_filter( 'bgmp_get-map-placemarks-return', 'addBGMPOffsetOnDuplicates' );
While it works, it still leaves a lot to be desired, but I can't seem to get it working with array_search or something similar. So now quick and dirty.
Also I noticed if I have a
- in my placemark title it gets replaced with & #8211;. This happened since I added my functions, but it might also be a result of installing version 1.10 of the BGMP addon (used to work with 1.9rc).