Closed PaulioRandall closed 9 months ago
The Map
component takes an object of options as a prop.
Since the style
attribute must be specified for anything to be rendered, it is required rather than optional and I don't think it belongs in an options
object: either it should be a separate prop, or a default value should be used if options.style
is undefined.
The
Map
component takes an object of options as a prop.Since the
style
attribute must be specified for anything to be rendered, it is required rather than optional and I don't think it belongs in anoptions
object: either it should be a separate prop, or a default value should be used ifoptions.style
is undefined.
While you're technically correct on the required/optional note, I crafted the <Map>
component API so it's consistent with the maplibre_gl.Map
class constructor API. I think this is the most readable and flexible approach. I 'm trying to deviate as little as possible to avoid confusion. It also allows us to reuse MapLibre documentation with the only exception being the container
prop being set internally.
While you're technically correct on the required/optional note, I crafted the
<Map>
component API so it's consistent with themaplibre_gl.Map
class constructor API. I think this is the most readable and flexible approach. I 'm trying to deviate as little as possible to avoid confusion. It also allows us to reuse MapLibre documentation with the only exception being thecontainer
prop being set internally.
That is reasonable, but could we use os_light_vts
as the default if style
isn't specified?
What does this change?
Adds a lightweight
<Map>
component for creating MapLibre maps.Why?
So I can build maps.
How?
Two new components:
Map
that simplifies the creation an initialization of a MapLibre map using Svelte.MapApp
that wrapsMap
and provides page layout for full page maps.Related issues:
None.
Does this introduce new dependencies?
None.
How is it tested?
In storybook.
How is it documented?
In storybook.
Are light and dark themes considered?
Nope.
Is it complete?
index.js
?