import { Layer } from "./layer" ; import { Graphic } from "../element/graphic" ; import { Projection } from "../projection/projection" ; import { WebMercator } from "../projection/web-mercator" ; import { Bound } from "../util/bound" ; export class GraphicLayer extends Layer { private _graphics : Graphic [ ] = [ ] ; add ( graphic ) { this . _graphics . push ( graphic ) ; } draw ( ctx , projection = new WebMercator ( ) , extent = projection . bound ) { if ( this . visible ) { this . _graphics . forEach ( ( graphic ) => { graphic . draw ( ctx , projection , extent ) ; } ) ; } } }