-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor to simplify Map #2741
Comments
The core mbgl native equivalent is The difficulty of pushing the setters down to below the map level is how do you trigger the subsequent style recalculations? When I was first implementing
In the end none of these seemed worthwhile when compared to the simplicity of |
It was like that before, why did we move it upstream in the first place? I don't remember exactly but there must have been a reason. |
@mourner |
Looks like this is the route native is going to go, with style sources and layers being the lowest level of observable object, which isn't too cumbersome. |
I addressed the first part of the original issue in #7060, but the issue of changing the API to call methods on layer instances directly is still open, so maybe let's make a new issue or reopen/edit this one. |
Map
is 1342 lines of code and exposes about a hundred methods, properties, and events. We should simplifyMap
's interface and implementation by moving as much logic downstream as possible and maybe moving some interface components downstream.moving as much logic downstream as possible
Having many methods, properties, and events on
Map
would be more manageable ifMap
did not have any logic or state of its own.For example, we should endevour to rewrite
setMaxBounds
such that it reads a little more like
(maybe) moving some interface components downstream
i.e. change the public interface from
map.setPaintProperty(...)
tomap.style.setPaintProperty(...)
(ormap.style.paint['circle-color'].set(...)
)The text was updated successfully, but these errors were encountered: