-
Notifications
You must be signed in to change notification settings - Fork 13
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
Migrate the main map to Deck.gl #773
base: main
Are you sure you want to change the base?
Commits on May 24, 2024
-
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]>
Configuration menu - View commit details
-
Copy full SHA for b361dac - Browse repository at this point
Copy the full SHA b361dacView commit details -
Replace main map with a Deck.gl layer
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
Configuration menu - View commit details
-
Copy full SHA for cab1aef - Browse repository at this point
Copy the full SHA cab1aefView commit details -
Configuration menu - View commit details
-
Copy full SHA for fdae15d - Browse repository at this point
Copy the full SHA fdae15dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f6d94d - Browse repository at this point
Copy the full SHA 8f6d94dView commit details -
Allow changing map background via the preferences
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.
Configuration menu - View commit details
-
Copy full SHA for e0fb537 - Browse repository at this point
Copy the full SHA e0fb537View commit details -
Remove references to mapbox in .env file
READMEs remain to be updated
Configuration menu - View commit details
-
Copy full SHA for c82a285 - Browse repository at this point
Copy the full SHA c82a285View commit details -
deck.gl: Change types of the map layer
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.
Configuration menu - View commit details
-
Copy full SHA for 55c230e - Browse repository at this point
Copy the full SHA 55c230eView commit details -
Make AnimatedArrowPathLayer work
Performance could be improved, but it works sufficiently well for now
Configuration menu - View commit details
-
Copy full SHA for 2cc3086 - Browse repository at this point
Copy the full SHA 2cc3086View commit details -
LineLayer's should just be PathLayer, not TripsLayer
TripsLayer is for animating a fading path, but we don't need that for general transit lines.
Configuration menu - View commit details
-
Copy full SHA for adc0f5b - Browse repository at this point
Copy the full SHA adc0f5bView commit details -
deck.gl: Support events on map and map layers
* 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.
Configuration menu - View commit details
-
Copy full SHA for d3320ac - Browse repository at this point
Copy the full SHA d3320acView commit details -
Configuration menu - View commit details
-
Copy full SHA for 09371d3 - Browse repository at this point
Copy the full SHA 09371d3View commit details -
deck.gl: Add an updateCount to trigger map updates on layers
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.
Configuration menu - View commit details
-
Copy full SHA for 21eeb0a - Browse repository at this point
Copy the full SHA 21eeb0aView commit details -
deck.gl: Set styles for circle layers
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.
Configuration menu - View commit details
-
Copy full SHA for 1ca5d7c - Browse repository at this point
Copy the full SHA 1ca5d7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for fa2fca6 - Browse repository at this point
Copy the full SHA fa2fca6View commit details -
deck.gl: Set styles for line layers
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.
Configuration menu - View commit details
-
Copy full SHA for 7a27614 - Browse repository at this point
Copy the full SHA 7a27614View commit details -
deck.gl: Set styles for polygon layers
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.
Configuration menu - View commit details
-
Copy full SHA for 31b7eb9 - Browse repository at this point
Copy the full SHA 31b7eb9View commit details -
deck.gl: Remove the original proof of concept
Deck.gl is now implemented in mainline Transition and the poc is not necessary anymore.
Configuration menu - View commit details
-
Copy full SHA for bac4147 - Browse repository at this point
Copy the full SHA bac4147View commit details -
Configuration menu - View commit details
-
Copy full SHA for a9762e4 - Browse repository at this point
Copy the full SHA a9762e4View commit details -
deck.gl: Support filtering of features based on zoom
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.
Configuration menu - View commit details
-
Copy full SHA for 9d8bdfe - Browse repository at this point
Copy the full SHA 9d8bdfeView commit details -
deck.gl: Support filtering lines and agencies
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.
Configuration menu - View commit details
-
Copy full SHA for 073b7bb - Browse repository at this point
Copy the full SHA 073b7bbView commit details -
deck.gl: Remove dependencies to mapbox
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.
Configuration menu - View commit details
-
Copy full SHA for 65b9bba - Browse repository at this point
Copy the full SHA 65b9bbaView commit details -
preferences: Add an option to enable map animations
Defaults to `true`, but can be set in the user preferences. Layers can then use the `map.enableMapAnimations` preferences value to disable animations.
Configuration menu - View commit details
-
Copy full SHA for e451f59 - Browse repository at this point
Copy the full SHA e451f59View commit details -
animated path: Allow to disable animations for the layer
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.
Configuration menu - View commit details
-
Copy full SHA for 3a8bd2b - Browse repository at this point
Copy the full SHA 3a8bd2bView commit details