Googlmapper
Googlmapper copied to clipboard
Display KML/KMZ
Hello, is there a way to display KML/KMZ? https://developers.google.com/maps/documentation/javascript/kml
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.
Unfortunately cluster doesn't seem to work using this.
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.