-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop hardcoding the pseudoclasses, cleanup
For recap, these classes are how we adjust the style of features now that we can't use CSS classes to do it. They are strings that are owned by each layer. We created a bunch of them like 'drawing', 'highlight', 'selected', etc. and then at render time we call `syncFeatureClasses` to update each feature with what kind of classes it should have. Working on the streetlevel imagery I realized that I want more pseudo classes to highlight image viewcones, and the list is getting long, so it's time to stop hardcoding these special properties and handle them dynamically. This also gives us an oppotrunity to clean up the ones that were confusing, redundand, or not really used. So here's what has changed: - Removed all the AbstractFeature getter/setters and now have `setClass/unsetClass/hasClass` - AbstractFeature now has a private `_classes` Set<classIDs> - setClass/unsetClass now take care of dirtying the style and label - `feature.highlighted = true` -> `feature.setClass('highlight)` - `feature.drawing = false` -> `feature.unsetClass('drawing')` - etc.. - Perfer shorter names for the classes, e.g. "select" instead of "selected" - Some renames and adjustment of arglists in the PixiScene and AbstractLayer - `classData(dataID, classID)` -> `setClass(classID, dataID)` - `unclassData(dataID, classID)` -> `unsetClass(classID, dataID) - etc.. the class name comes first, like `setClass('hover', 'w123')` - Updated lots of documentation - 'active' was used for interactivity, but it didn't really work, it's removed now - this only really affects `DragBehavior`, when dragging things - We also had `feature.allowInteraction` it does the same thing, we just use that now This paves the way for me to do the thing I want to do with the photo viewcones without adding more hardcoded classes.
- Loading branch information
Showing
19 changed files
with
278 additions
and
333 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.