Refresh marker Google maps on Apache server [closed]

I can’t refresh marker only, without refreshing whole Google map. Location is sent every 10 seconds from esp32 to Apache server. The only way to refresh marker position is to refresh whole map0 which is not my goal. I’d like to refresh only markers without reloading whole map or website.

<?php foreach($rows as $row){ ?>


    var location = new google.maps.LatLng(<?php echo $row['lat']; ?>, <?php echo $row['lng']; ?>);
    function refreshMarker(){

// if marker exists and has a .setMap method, hide it
  function SetMarker(location, map) {
    //Remove previous Marker.
    if (marker == null) {
        marker.setMap(null);
    }
}
    //marker.setMap(map);
    var marker = new google.maps.Marker({
        position: location,
        icon: betw,
        title:"<?php echo $row['lat']; ?>, <?php echo $row['lng']; ?> , <?php echo $row['time']; ?> , <?php echo $row['altitude']; ?> m, <?php echo $row['speed']; ?> km/h, <?php echo $row['temperature']; ?> °C",
        map: map
    });
    
 setTimeout(refreshMarker, 1000);}
 refreshMarker();

            
<?php } ?>