diff --git a/docs/working_with_kml.rst b/docs/working_with_kml.rst index 8cda819a..ab630a61 100644 --- a/docs/working_with_kml.rst +++ b/docs/working_with_kml.rst @@ -164,6 +164,8 @@ Now we can create a new KML object and confirm that the new element is parsed co To be able to open the KML file in Google Earth Pro, we need to transform the CascadingStyle element into a supported Style element. +To achieve this we copy the styles into the document styles and adjust their id +to match the id of the CascadingStyle. .. code-block:: pycon @@ -173,6 +175,11 @@ CascadingStyle element into a supported Style element. ... kml_style.id = cascading_style.id ... document.styles.append(kml_style) ... + +Now we can remove the CascadingStyle from the document and have a look at the result. + +.. code-block:: pycon + >>> document.gx_cascading_style = [] >>> print(document.to_string(prettyprint=True)) @@ -222,7 +229,7 @@ CascadingStyle element into a supported Style element. 80000000 - + Ort1 10.06256752902339 diff --git a/fastkml/styles.py b/fastkml/styles.py index c70de2c7..ebd9a1ff 100644 --- a/fastkml/styles.py +++ b/fastkml/styles.py @@ -62,7 +62,7 @@ logger = logging.getLogger(__name__) -class StyleUrl(_BaseObject): +class StyleUrl(_XMLObject): """ URL of a