Googlmapper icon indicating copy to clipboard operation
Googlmapper copied to clipboard

Display KML/KMZ

Open poxin13 opened this issue 4 years ago • 3 comments

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

poxin13 avatar Feb 05 '21 18:02 poxin13

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 avatar Apr 09 '21 17:04 poxin13

Unfortunately cluster doesn't seem to work using this.

poxin13 avatar Apr 09 '21 18:04 poxin13

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.

bradcornford avatar Jul 19 '21 08:07 bradcornford