Conversation
Formatting only, no behaviour change.
Google deprecated the KmlLayer class of the Maps JavaScript API: it becomes unavailable in version 3.66 (August 2026) and stops working entirely in May 2027. This adds a GeoJSON overlay type built on google.maps.Data as the replacement path, along with a command to convert existing KML files. Ivory already ships GeoJsonLayer, so the library needs no changes. It renders map.data.loadGeoJson() and nothing else, though, and unlike KML GeoJSON carries no styling of its own -- a layer loaded that way draws in Google's default blue with no info windows. The frontend script applies both: styling via Data.setStyle(), reading each feature's simplestyle properties with the overlay's configured style as fallback, and info windows built from the remaining properties. Its markup uses BEM classes and ships no presentation, so projects style it themselves. Two things are easy to get wrong here and are worth stating: - The initialization is registered as a map event, because Ivory renders those inside the map's own init callback. The rendered JavaScript block runs before the async API callback assigns the map variable. - The script is registered from the replaceDynamicScriptTags hook. Maps render inside the body, by which point the head has been assembled and a TL_JAVASCRIPT entry added during rendering is dropped without warning. KmlConverter flattens <Style> and <StyleMap> definitions into simplestyle properties, which is what the layer reads back -- the common converters drop them and every route ends up the same colour. It resolves StyleMap indirections via their "normal" branch, converts KML's AABBGGRR colours (alpha first, then reversed RGB; read naively, red and blue swap), closes linear rings as GeoJSON requires, and keeps ExtendedData. Icon URLs can optionally be rewritten to local paths, since KML tends to reference them absolutely and a HTTPS page blocks http:// ones. The KML overlay type is left in place so existing maps keep rendering until they are migrated.
This was referenced Aug 15, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Google deprecated the
KmlLayerclass of the Maps JavaScript API. It becomes unavailable in version 3.66 (August 2026) and stops working entirely in May 2027.This adds a GeoJSON layer overlay type built on
google.maps.Dataas the replacement path, plus a command to convert existing KML files. The KML type is left in place so existing maps keep rendering until they are migrated.What's in it
prepareGeoJsonLayer()using Ivory's existingGeoJsonLayer— the library needs no changeshuh:google-maps:convert-kmlcommand plus a reusableKmlConverterWhy the frontend script is needed
GeoJsonLayerrendersmap.data.loadGeoJson()and nothing else. Unlike KML, GeoJSON carries no styling of its own, so a layer loaded that way draws in Google's default blue with no info windows.The script applies both: styling via
Data.setStyle(), reading each feature's simplestyle properties with the overlay's configured style as fallback, and info windows built from the remaining properties. Its markup uses BEM classes and ships no presentation of its own, so projects style it themselves.Two non-obvious bits
Both look like they could be simplified, and both break silently if they are:
replaceDynamicScriptTagshook. Maps render inside the body, by which point the head has been assembled — aTL_JAVASCRIPTentry added during rendering is dropped without warning.Conversion
The common KML converters drop the styling, since GeoJSON has no place to put
<Style>definitions and every route ends up the same colour.KmlConverterflattens them into simplestyle properties instead, resolves<StyleMap>indirections via theirnormalbranch, converts KML'sAABBGGRRcolours (alpha first, then reversed RGB — read naively, red and blue swap), closes linear rings as GeoJSON requires, and keepsExtendedData. Icon URLs can optionally be rewritten to local paths.Usage is documented in the README.
Notes
kmlColorToHex()and theStyleMapresolution would be the ones worth covering; happy to add them if you want this merged.rectorfails onDoctrineSetList::DOCTRINE_ORM_214, which newerrector-doctrineversions no longer define — it fails to load its config before analysing anything, and does so on the base branch too. Sincecontao/contao-rectoris required asdev-main, this appeared without any code change. Left untouched here as it seems out of scope for this PR.