I'm having a problem running the standard GOOGLE json file load example from my Ubuntu Apache local host. I saw a similar question with an answer that pertained to IIS (How to open a local file with Javascript FileReader()); however, I'm looking for a solution for Apache on Ubuntu.
The json file loads correctly from the remote URL (see code below) but fails to load from my local URL even though I can view it through my browser. I've tried absolute and relative paths.
Data Layer: Simple html, body { height: 100%; margin: 0; padding: 0; } #map { height: 100%; }
function initMap() { map = new google.maps.Map(document.getElementById('map'), { zoom: 4, center: {lat: -28, lng: 137} }); // This doesn't work even though it works in my FireFox browser map.data.loadGeoJson('localhost/google.json'); //This one works //map.data.loadGeoJson('https://storage.googleapis.com/mapsdevsite/json/google.json'); }
Thank you.