title: PHP Show XML coordinates on Google Maps
body: <p>I have a page in my CodeIgniter project that shows a google maps api, and I want it to show coordinates from an XML file I created at the root of my project.  I've tested it with a .xml file provided from a server on a tutorial I followed and it worked. I'm trying to make it work with my own XML file but it seems like the file can't be found. Here is the code for the function that makes the coordinates appear on the map:</p>
  
  <pre><code>function initMap() {
  
      var map = new google.maps.Map(document.getElementById('map'), {
          center: new google.maps.LatLng(46.837049838196, -71.094652204138),
          zoom: 12
      });
      var infoWindow = new google.maps.InfoWindow;
  
     // this is the URL that should be pointing to an XML file I have stored at the root of my CodeIgniter project.
  
      downloadUrl('http://127.0.0.1/BD3_TP1/xml/mapmarkers2.xml', function(data) {
          var xml = data.responseXML;
          var markers = xml.documentElement.getElementsByTagName('marker');
          Array.prototype.forEach.call(markers, function(markerElem) {
              var id = markerElem.getAttribute('id');
              var name = markerElem.getAttribute('name');
              var address = markerElem.getAttribute('address');
              var type = markerElem.getAttribute('type');
              var point = new google.maps.LatLng(
              parseFloat(markerElem.getAttribute('lat')),
              parseFloat(markerElem.getAttribute('lng')));
              var infowincontent = document.createElement('div');
              var strong = document.createElement('strong');
              //   strong.textContent = name
              infowincontent.appendChild(strong);
              infowincontent.appendChild(document.createElement('br'));
  
              var text = document.createElement('text');
              text.textContent = address
              infowincontent.appendChild(text);
              var icon = customLabel[type] || {};
              var marker = new google.maps.Marker({
                  map: map,
                  position: point,
                  label: icon.label
              });
              marker.addListener('click', function() {
                  infoWindow.setContent(infowincontent);
                  infoWindow.open(map, marker);
              });
          });
      });
  }
  </code></pre>
  
  <p>I even copied the tutorial xml file's content and replicated it. When I put the original URL(<a href="https://storage.googleapis.com/mapsdevsite/json/mapmarkers2.xml" rel="nofollow noreferrer">https://storage.googleapis.com/mapsdevsite/json/mapmarkers2.xml</a>) in the downloadUrl function seen previously, it works. The error is the URL I wrote, which points to my stored xml file. It won't find the file, so the coordinates don't appear. What should I do?</p>