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

Support gx:CascadingStyle #311

Open
OxygenCobalt opened this issue Mar 22, 2024 · 3 comments
Open

Support gx:CascadingStyle #311

OxygenCobalt opened this issue Mar 22, 2024 · 3 comments

Comments

@OxygenCobalt
Copy link

OxygenCobalt commented Mar 22, 2024

Hello,

We've ran into an issue on our end where we cannot extract Polygon colors from the Google Earth KML files we exported on our end, as they are contained within a gx:CascadingStyle extension element that is not read. At minimum it would be useful for fastkml to read this element when it is referenced by styleUrl and then apply the relevant styles to the object being read.

Thanks.

@cleder
Copy link
Owner

cleder commented Mar 24, 2024

I cannot find documentation about gx:CascadingStyle

@OxygenCobalt
Copy link
Author

OxygenCobalt commented Mar 24, 2024

From what I see it's basically like any other Style element but presumably cascades some inherited style like CSS. I'm not too well-versed on KML though. All I want is for fastkml to recognize it as a Style and use it, the actual functionality isn't needed.

Here's a CascadingStyle from our KML file:

<gx:CascadingStyle kml:id="__managed_style_881999257A2F4EDCAD33">
	<styleUrl>https://earth.google.com/balloon_components/base/1.0.26.0/card_template.kml#main</styleUrl>
	<Style>
		<IconStyle>
			<scale>1.2</scale>
			<Icon>
				<href>https://earth.google.com/earth/rpc/cc/icon?color=1976d2&amp;id=2000&amp;scale=4</href>
			</Icon>
			<hotSpot x="64" y="128" xunits="pixels" yunits="insetPixels"/>
		</IconStyle>
		<LabelStyle>
		</LabelStyle>
		<LineStyle>
			<color>ff2846cc</color>
			<width>3</width>
		</LineStyle>
		<PolyStyle>
			<color>40ffffff</color>
		</PolyStyle>
		<BalloonStyle>
		</BalloonStyle>
	</Style>
</gx:CascadingStyle>

Hope this helps @cleder

@cleder
Copy link
Owner

cleder commented Apr 7, 2024

The architecture has changed a lot from fastkml 0.x to 1.x.

One of the advantages of these changes is that you can define and add new behaviour at runtime through the registry.
What is still missing to be able to add arbitrary XML structures is that **kwargs should be added to the base._XMLObject and propagated through the inheritance chain. This way, the integration of things like gx:CascadingStyle can be implemented by the end user without patching the underlying fastkml library.

Ping me if you are interested in helping to implement this.

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