Skip to content

Is it possible to initialize svg-icons in typescript? #108

Description

@usamauzi

Hi, I am trying to initialize this in a typescript file using document.createElement to display in a map webapp as an overlay (openlayers).

let jtiImageElement = document.createElement('svg-icon'); jtiImageElement.setAttribute('src', 'assets/icons/jtis/1A.svg'); //jtiImageElement.setAttribute([stretch],"true"); //jtiImageElement['src'] =assets/icons/jtis/1A.svg; jtiImageElement['[svgStyle]'] = "{width.px:'100', height.px:'100'}";

ive tried initializing it this way, there is a svg-icon in the DOM but there is no image and the dimensions are 0x0. the url of the svg is also working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions