Skip to content

Commit

Permalink
Add schema support to GroundOverlay
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Nov 12, 2022
1 parent 3638904 commit 99ec005
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/kml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export function kmlWithFolders(node: Document): Root {
switch (node.tagName) {
case "GroundOverlay": {
placemarks.push(node);
const placemark = getGroundOverlay(node, styleMap);
const placemark = getGroundOverlay(node, styleMap, schema);
if (placemark) {
pointer.children.push(placemark);
}
Expand Down Expand Up @@ -221,7 +221,7 @@ export function* kmlGen(node: Document): Generator<F> {
if (feature) yield feature;
}
for (const groundOverlay of $(node, "GroundOverlay")) {
const feature = getGroundOverlay(groundOverlay, styleMap);
const feature = getGroundOverlay(groundOverlay, styleMap, schema);
if (feature) yield feature;
}
}
Expand Down
6 changes: 4 additions & 2 deletions lib/kml/ground_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
extractTimeSpan,
extractTimeStamp,
getMaybeHTMLDescription,
Schema,
} from "./shared";
import { extractIconHref, extractStyle } from "./extractStyle";
import { coord, fixRing, getCoordinates } from "./geometry";
Expand Down Expand Up @@ -91,7 +92,8 @@ function getLatLonBox(node: Element): Polygon | null {

export function getGroundOverlay(
node: Element,
styleMap: StyleMap
styleMap: StyleMap,
schema: Schema
): Feature<Polygon | null> {
const geometry = getGroundOverlayBox(node);

Expand All @@ -116,7 +118,7 @@ export function getGroundOverlay(
extractCascadedStyle(node, styleMap),
extractStyle(node),
extractIconHref(node),
extractExtendedData(node),
extractExtendedData(node, schema),
extractTimeSpan(node),
extractTimeStamp(node)
),
Expand Down

0 comments on commit 99ec005

Please sign in to comment.