-
Notifications
You must be signed in to change notification settings - Fork 67
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
Create view for geoprocessing input information #2
Comments
This is looking great! |
whoohooo! |
Thanks! It's all a bit hacky right now, and I'd like some feedback on the |
Here's a template for adding a new operation to .addChild(new L.DNC.TurfOperation('buffer', {
maxFeatures: 1,
additionalArgs: 0.1,
description: 'DESCRIPTION.',
parameters: [
// PARAMETER 1 OBJECT
{
name: 'PARAMETER 1',
description: 'PARAMETER 1 DESCRIPTION',
type: 'number',
default: 10
},
// PARAMETER 2 OBJECT
{
name: 'PARAMETER 2',
type: 'select',
description: 'PARAMETER 2 DESCRIPTION',
options: ['OPTION 1', 'OPTION 2', 'OPTION 3', 'OPTION 4'],
default: 'OPTION 3'
}
]
})) |
The template looks good. I'm starting to worry that putting all this implementation within these lines is making the app difficult to test. I've been looking through some integration test tools lately hoping that one of those could solve this problem.
Yeah, there seems like there should be an easier way to do that part. The objects should have |
I wonder if the // create geoprocessing menu with whatever turf operations we want
this.menu.geoprocessing = new L.DNC.MenuBar( /* options */ );
// create new way to access turf operations, which can be run after
// the event fires with a string like 'buffer'
this.operations.turf = new L.DNC.Operation( /* options, which could be specified in unique files i.e. buffer.js */ );
// now we can execute these operations when an item is clicked
this.menu.geoprocessing.on('clicked', this.operations.turf( /* operation id */ ); |
Yeah, I think you're spot on about the problem relating to With that said, I think you're right with the idea of breaking out operations into their own files. I wanted to avoid that initially but now I'm thinking that it could improve testability. When I originally commented, I thought this was a PR. Is this all related to #63? |
Mostly! This conversation is a result of #63, but maybe not directly related since it involves some refactoring. I'm going to turn that PR into a larger refactor, though. Is that okay with you?
I'm kinda confusing myself as well. 😜 When you say "breaking out operations into their own files" is what I was imagining when putting that together. They are going to rely on each other, that's for sure, but I think they can all be their own individual Classes without getting spaghetti'd together. I'm going to play around with some hypothetical ways to break apart the different operations into their own classes and see what happens. I'll share some results later this evening! Going to continue working on #63 and turn it into a larger refactor since I want to keep the |
For example, when someone clicks "buffer" they get a screen asking for specific geometries. I'm unsure how to build this one right now. I wonder what the best way to do it is?
The text was updated successfully, but these errors were encountered: