Skip to content

Commit

Permalink
fix(Marker): HtmlIcon children nodes issue
Browse files Browse the repository at this point in the history
* set default icon if marker no has children node
  • Loading branch information
Dongkyuuuu committed Sep 27, 2022
1 parent cf344d3 commit a971d6b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/composables/useMarkerSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ export interface HtmlIcon {
anchor?: naver.maps.Point | naver.maps.PointLiteral | naver.maps.Position;
}

export const getIcon = (
icon?: string | HTMLElement,
iconOptions?: HtmlIcon
) => {
if (!icon) return undefined; // default marker icon
export const getIcon = (icon?: HTMLElement, iconOptions?: HtmlIcon) => {
if (!icon?.childElementCount) return undefined; // default marker icon
return Object.assign({ content: icon }, iconOptions ?? {});
};

0 comments on commit a971d6b

Please sign in to comment.