-
Notifications
You must be signed in to change notification settings - Fork 78
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
Standardize Layer code in the LEL repository #198
Comments
@sagarpreet-chadha , while some layers have very similar code (almost same ) I noticed there are a few eg fractrackermobile layer, wisconsin layer etc whose functions are pretty different. |
@sagarpreet-chadha I guess one kind of custom code can be used for layers of a similar kind ie Mapknitter Layer SkyTruth Layer PurpleLayer Layer Toxic Layer etc, where we can have one function to add layer that takes its URL as a parameter ? Let me know if there are better ways to implement this. I feel this enhancement will take me a while , so I want to get started with it as soon as possible. |
@sagarpreet-chadha ,do you have any ideas/ guidelines in mind for the standardization ? |
Let's start the discussion keeping Jeff's idea here 👍 #168 (comment) in mind . One possible approach is to make one custom class/function and pass parameters like URL , API parsing info. to it and call it for each layer ? So let's get started by first making this custom class (leaving the layers that have different code) . What do you think ? |
As we are extending Leaflet class to make layer currently , right? Let's implement this custom class by putting it inside a function which will recieve various parameters (as described in above) . |
makes sense. |
Yes that is correct 😄 |
This sounds SUPER |
Reopening because other layers are yet to be standardized. |
Hey @sagarpreet-chadha @rexagod @jywarren we now have 2 standardized file
I noticed that some more layers for example
can be standardized with the same file used to standardize these : mapknitter, skytruth, odorreport and fractracker. Shall I go ahead with this, or will it make that one file too complicated ? |
Hi @ananyaarun , If we try to understand the things that are unique in all these layers are :
right? Can we make one file that accepts these 3 things as arguments ? Thanks! |
Hey @sagarpreet-chadha , true this can be done and this was my initial idea as well.
|
I was thinking of like extending my previous PR for standardization to the similar remaining layers as well. Let me know what would be better 😃 |
@ananyaarun Would that solve your problem? Loving the fact that you're considering making things dynamic, very cool! Let me know any specifics you'd like me to look at, though, I guess you've already got this figured. Also, whenever in doubt about how to code things, feel free to refer this, I find this suprisingly comprehensive yet brief (The Zen of Python by Tim Peters, in case you're wondering). Happy coding! 👍 Beautiful is better than ugly. |
This is super cool ❤️ ! |
Thanks @rexagod !! |
Description
LEL is a growing library with a set of layers. Currently the process of adding new layers is not easily described and repo contains redundant code for different layers.
What can be done
(common function which could be used to reduce redundant code in layers)
The text was updated successfully, but these errors were encountered: