question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] How to load & display KML

See original GitHub issue

I have a KML layer of GPS tracks that I want to load and display on the map, how do I do it the React way with this?

I was able to get it working, but I had to use onGoogleApiLoaded

This is what I did:

onAPILoad({ map, maps }){
    var KML = new maps.KmlLayer({
        url: 'PATH_TO_KML'
    });
    KML.setMap(map);
}

render(){
    return <GoogleMap {...props} onGoogleApiLoaded={this.onAPILoad} />;
}

Is there a proper way to use getMapOptions? I couldn’t find anywhere in the docs/examples. If there isn’t is this a valid feature request?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

14reactions
istarkovcommented, Aug 31, 2016

Sorry I have no idea about what is KML and why do you need getMapOptions 😉 Please see the sources to find the answer you need.

8reactions
istarkovcommented, Oct 6, 2017

I’m not using this library now in any of my work projects, so I’m not interested and have no time to somehow extend this library. I even have no time to support it well. May be in a future (but having that mapbox solutions beats google in every case I feel that such future will never come)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Displaying KML | Maps JavaScript API - Google Developers
This tutorial shows you how to display information of a KML file in a Google map and sidebar. For more information on using...
Read more >
Import KML map data into Google Earth - Computer
Import KML map data into Google Earth · On your computer, open Google Earth. · On the left, click Projects Projects . ·...
Read more >
Displaying local file in Google Maps? - GIS Stack Exchange
Click Choose file , select the KML to upload, and then click Upload from file. My Maps (source: askdavetaylor.com). Create a new map....
Read more >
Google Map won't load/display KML file - Stack Overflow
Don't use relative URLs in the KmlOptions for a KmlLayer. Use the complete absolute URL:
Read more >
What if my KMZ/KML or Shapefile loads but does not display ...
This is because the built-in zip-utility on windows machines do not recognize a KMZ file as a zipped file. The most reliable way...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found