-1

I want to provide KMZ file link from dropbox/google drive on my google map so Google map can parse it as KMZ file needs to be parsed from public hosted domain but I am unable to find a way:

<script>
var map;
var src = 'https://drive.google.com/file/d/0B-_cUzmUSQEoYUNlSzN5cVNmd0k/view';//link of google drive but its saying invalid document

function initMap() {
    map = new google.maps.Map(document.getElementById('map'), {
        center: new google.maps.LatLng(-19.257753, 146.823688),
        zoom: 2,
        mapTypeId: 'terrain'
    });

    var kmlLayer = new google.maps.KmlLayer((src), {
        suppressInfoWindows: true,
        preserveViewport: false,
        map: map
    });
    console.log(kmlLayer)
    kmlLayer.addListener('click', function(event) {
        var content = event.featureData.infoWindowHtml;
        var testimonial = document.getElementById('capture');
        testimonial.innerHTML = content;
    });
}

Kumail Hussain
  • 869
  • 2
  • 26
  • 49
  • 1
    if the dropbox / google drive are not directly accessible (without password or access control) you can't the kmlLayer (as all the google maps feature) work only for fully accessible link – ScaisEdge Aug 24 '17 at 06:49
  • how can i create a fully accessible link – Kumail Hussain Aug 24 '17 at 06:50

1 Answers1

0

if (as is) the dropbox / google drive are not directly accessible (without password or access control) you can't the kmlLayer (as all the google maps feature) work only for fully accessible link

for this don't use dropbox or google drive but a host you kmz on a hosting service .. there a lot of free hosting service on internet ..where you can store you files with ftp features and accessing by a normal url (without password controll access)

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107