I have an API that generates information in XML form, I have tried using a foreach loop,
<script>
<?php
$xml = simplexml_load_file("https://www.simbrief.com/api/xml.fetcher.php?username=bateseyplayz");
foreach ($xml->navlog->fix as $fix){
echo 'L.marker([$fix->pos_lat, $fix->pos_long]).addTo(mymap)';
}
?>
</script>
This breaks my leaflet map probably because of how I am trying to echo the code to make a marker, I have other markers on my map from using this API but they have different names so I don't have to loop to get the coordinates for these points
If anyone has any better solutions would be greatly appreciated
The API should work if you just copy into a browser
Many Thanks