Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display KML/KMZ #375

Open
poxin13 opened this issue Feb 5, 2021 · 3 comments
Open

Display KML/KMZ #375

poxin13 opened this issue Feb 5, 2021 · 3 comments

Comments

@poxin13
Copy link

poxin13 commented Feb 5, 2021

Hello, is there a way to display KML/KMZ? https://developers.google.com/maps/documentation/javascript/kml

@poxin13
Copy link
Author

poxin13 commented Apr 9, 2021

Mapper::map(0, -0, ['zoom' => 7, 'center' => true, 'marker' => false, 'eventBeforeLoad' => 'kmlLayers(map_0);']);

    <script type="text/javascript">
        function kmlLayers(map)
        {
            const kmlLayer = new google.maps.KmlLayer({
                url: "https://example.com/layer.kmz",
                map: map,
            });
        }
    </script>

Looks like something along these lines works.

@poxin13 poxin13 closed this as completed Apr 9, 2021
@poxin13
Copy link
Author

poxin13 commented Apr 9, 2021

Unfortunately cluster doesn't seem to work using this.

@bradcornford
Copy link
Owner

Hi,

This package doesn't natively support KML layers, however your event based callback would be what i suggest you do to achieve it. You may want to move it to the eventAfterLoad instead, to allow the cluster option to initialise before overwriting the KML layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants