-1

Hy guys, I'm trying to load a KML file in path : "/var/www/laravel/public/kml/doc.kml" , but i can't. The code of import is:

var ctaLayer = new google.maps.KmlLayer({
      url: '/var/www/laravel/public/kml/doc.kml',
      map: map
    });

What I missed?

therock24
  • 305
  • 4
  • 13

1 Answers1

0

loading KML formats are loaded like this (begins with http://):

url: 'http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/placemark.kml',

like

var kmlLayer = new google.maps.KmlLayer({
     url: 'http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/placemark.kml',
     suppressInfoWindows: true,
     map: map
});

Your URL seems to be invalid: /var/www/laravel/public/kml/doc.kml

However, if you're running this map on a localhost, make sure you start your local server first.

Community
  • 1
  • 1
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56