You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow initialization of Canvas source from an HTML canvas element, the same way that a mapboxgl map object can be bound directly to an HTML element https://www.mapbox.com/mapbox-gl-js/api/#map.
Use case
Canvas elements in an application framework do not have an HTML id element. Adding HTML unique ids to each Canvas element would add complexity to the application, instead of just creating the canvas element and passing to the Canvas source.
This is definitely feasible. It would mainly entail:
Changing CanvasSource so that it can optionally read directly from the element if options.canvas is an HTMLCanvasElement
Modifying the CanvasSource#canvas specification to accept either a string or HTMLCanvasElement. Currently there are no other union types in the spec — all type values are either a single string-represented type or an enum type represented by an object — so we'd need to determine the best way to represent a union type and validate it
mapbox-gl-js version: 0.44.1
Background
The Canvas source type supports initialization from a canvas HTML element
id
only. https://www.mapbox.com/mapbox-gl-js/style-spec#sources-canvas-canvasFeature Request
Allow initialization of Canvas source from an HTML canvas element, the same way that a mapboxgl map object can be bound directly to an HTML element https://www.mapbox.com/mapbox-gl-js/api/#map.
Use case
Canvas elements in an application framework do not have an HTML
id
element. Adding HTML uniqueid
s to each Canvas element would add complexity to the application, instead of just creating the canvas element and passing to the Canvas source.cc @lbud
The text was updated successfully, but these errors were encountered: