-
Notifications
You must be signed in to change notification settings - Fork 46
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
Update MMGIS API vector layer functions #123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and thanks for the changes!
@tariqksoliman @jtroberts I updated the pull request to add additional functions. |
This removes the
keepN
parameter from themmgisAPI.updateVectorLayer
and creates 4 helper functions for removing existing features on vector layers. Splitting the trim functionality into separate functions solves the issue of whether or not we should include new input data when removing features.The
trimVectorLayerKeepAfterTime
function removes features on a specified layer before a specified time:window.mmgisAPI.trimVectorLayerKeepAfterTime(layerName, keepAfterTime, timePropPath)
The
trimVectorLayerKeepBeforeTime
function removes features on a specified layer after a specified time (i.e. this function does the opposite oftrimVectorLayerKeepAfterTime
:window.mmgisAPI.trimVectorLayerKeepBeforeTime(layerName, keepAfterTime, timePropPath)
The
keepLastN
function retains the same functionality as the originalkeepN
parameter in themmgisAPI.updateVectorLayer
function (i.e. removes features on a specified layer to keep the specified number of existing features):window.mmgisAPI.keepLastN(layerName, keepLastN)
The
keepLastN
function is unaware of time so it will remove features based on the order the features were added to the specified vector layer.The
keepFirstN
, the opposite of thekeepLastN
function, will remove features on a specified layer, with features removed starting from the tail end of the features list.