-
Notifications
You must be signed in to change notification settings - Fork 14
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
Rebase deck gl poc on main #1027
Open
kaligrafy
wants to merge
28
commits into
chairemobilite:main
Choose a base branch
from
kaligrafy:rebaseDeckGlPocOnMain
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Working layers using geojson data, events and custom shader Co-authored-by: Wassim27 <[email protected]> Co-authored-by: Gabriel Bruno <[email protected]> Co-authored-by: Florence Lauer <[email protected]> Co-authored-by: MohamedAli-M <[email protected]> Co-authored-by: mahdiguermache <[email protected]> Co-authored-by: nik498 <[email protected]>
Current state: no background, simple geometries are displayed. All enabled layers are displayed, with proper color if that color is in the properties, otherwise, it is a default color. There is no interaction with the layers and the circles are very small when zoomed out. The selected shaders do not work. The original layer descriptions in the layers.config.ts file have not been changed or updated yet. The information they contain may be useful for the Deck.gl data, but we'll need to take each field and see how to define/type it for best Deck.gl support
For now, only three styles are available: OSM, positron and dark matter from CartoDB. Eventually, we can extend to also use MapTiler's tiles, but his requires an API key.
READMEs remain to be updated
The type is named `MapLayer` and another type `LayerConfiguration` is used to configure the layer by the application. The configuration is meant to be fixed by the application and does not change, except through Preferences, if necessary.
Performance could be improved, but it works sufficiently well for now
TripsLayer is for animating a fading path, but we don't need that for general transit lines.
* Change the API of the event handlers * Drop support of mapbox types in event handling * Change the events to use the new API * mouseDown/Move/Up are now onDrag and onDragEnd events, which happen only with a specific feature, these are easier * There are simple tooltip events, which simplify popup management when only a simple text is required * The `click` event is separate in `leftClick` and `rightClick` TODO: The `path.hoverNode` and `path.unhoverNode` are not yet functional, as they programatically need to create a popup or menu at a specific location. TODO2: Aesthetic changes are not taken into account, as zoom events (and other layout events) are not yet properly handled TODO3: Not all layers are refreshed, even though the collection they display has elements that have changed. For example, saving a path does not show the updated path. Deck.GL does a shallow comparison to determine if the layer needs to be refreshed and probably the shallow comparison does not show any change if the coordinates changed.
Deck gl does a shallow comparison of the data to determine if the layer needs to be updated. So the data is not refreshed by default if one of the features in the collection changed position. We could add a `dataComparator` function, but this will be executed for every re-render of the map. We instead use an updateCount to save the number of times a layer has been updated throught the `map.updateLayer[s]` event. This will cause the data to be refreshed whenever the count is incremented.
Bring back all mapbox styles for circle-type layers. Type the layer description for circle layers, with fields being either a number/color, a function receiving the feature in parameter, or a property getter to retrieve the value from a geojson property.
Bring back most of mapbox styles for line-type layers. The highlight uses autoHighlight instead of changing the line width. The 'animatedArrowPath' also share a good part of the configuration and re-use the same logic for the PathLayer's data.
Bring back the mapbox styles for the polygon layers. With the lineColor and fillColor, it is not necessary to have both a polygon and a stroke layer, one layer does them all.
Deck.gl is now implemented in mainline Transition and the poc is not necessary anymore.
Add the `featureMinZoom` property, which can be a function that takes the feature in parameter and return the minimum zoom at which this feature should be displayed. Use this property for the transitPaths layer to recover the functionality previously handled by the defaultFilter of mapbox.
Add the `canFilter` layer property. Because we need to know from the start the number of filters to enable for a layer, as it is sent to the shader and not updatable, even with the updateTrigger, this property allows to set a placeholder filter for all features when no other filter is set. See if this can be prevented somehow. The PathMapLayerManager is renamed to TransitPathFilterManager because it does not involve layers, but manages the filters. This class emits the filter update events. The event is caught by the map, which updates the layer accordingly.
What remains that still depended on mapbox are the popup manager, which tracks which popup are currently opened and where, and the polygon draw tool, which is a little known feature of transition and only used for node selection. Some code was commented, other removed, but those features are expected to come back soon, tuned for deck.gl.
Defaults to `true`, but can be set in the user preferences. Layers can then use the `map.enableMapAnimations` preferences value to disable animations.
Add a prop to disable animation on the `AnimatedArrowPathLayer`. This deactivates the animated frame request and arrow path time step, thus saving the GPU from calculations. The previous speed divider of 0 also had the effect of making the path not move, but the layer was still refreshed for every frame, impacting GPU performances.
fixes chairemobilite#974 The `maxRadiusPixels` and `minRadiusPixels` can be set in the layer description to prevent the points from getting too big/small when zooming in/out. If the property is a number, the lineWidth min/max pixels are also set to 1/3 of the corresponding radius.
fixes chairemobilite#966 This moves all map related preferences to a separate section in the preferences edit form. Add a preference called `mapTileLayerOpacity`, which is a value between 0 and 1 representing the percentage opacity of the xyz tile layer. Extract the tile layer getter in the `TransitionMainMap` so it can be reset when the layer opacity is changed. If the opacity is 0 (invisible), the layer is not present.
Pas besoin de PR pour ça, fait juste un rebase de la branche sur |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.