-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Adds an additional zoom visibility property to markers to show/hide b… #208
Conversation
…ased on current zoom level. Signed-off-by: digitaldan <[email protected]>
Hi @ghys was playing around with a way to be able to zoom into a map and display more markers based on the zoom level. Not sure if this is the best way to handle that. or if i even did it right :-) |
Thanks @digitaldan, that's a nice feature! My only (small) concern is that users would need to figure out by themselves what the zoom level is, since it's neither shown anywhere nor retrieved easily, so it's not an option for everyone. Therefore I'd like to suggest making it an "advanced" option, meaning it will only be shown after checking a "show advanced options" box. Doing so is easy, the widgets have the same config parameter description format as other parts in openHAB so you just have to add |
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 - just a few housekeeping remarks.
label: 'Zoom Visibility', | ||
type: 'NUMBER', | ||
description: 'Visible only when zoomed to at least this level (empty by default)' | ||
}, |
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.
Please remove the trailing comma here, and add advanced: true,
above (3rd line or so) as discussed above.
@@ -170,6 +170,14 @@ export default { | |||
zoomControl:false | |||
} : {}) | |||
}, | |||
markers(){ |
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.
Please add spaces before and after the braces.
@digitaldan actually there quite a few linting errors in this and your previous PR (I overlooked it last time) 😅 I have a laxer approach than most of the other openHAB projects when it comes to enforcing them, in that they would not fail the build, but still it would be great if could sort them out while you're at it 😄. If you're using VS Code as your IDE, searching for ESLint in the extension pane and installing Then it should only be a matter of looking for the little lightbulb icons when hovering over code or in the problems window, and selecting 'Fix all auto-fixable problems': Let me know how this works for you so we can eventually add this to the CONTRIBUTING file. |
I was thinking the same thing. I had played with displaying the zoom level when editing, but i think making it an advanced property makes sense. I may still play with displaying something.
I would not mind make making this stricter actually. There is a lot of code, and it really helps to have consistency. I don't mind making sure the code is properly linted before checking in..
Nice, that worked perfectly. I will start paying attention to the "problems" tab now :-) |
…diting. Signed-off-by: digitaldan <[email protected]>
I like it! ;)
Yes, that could be valuable, you could go further and add the |
Signed-off-by: digitaldan <[email protected]>
FYI, there was an issue with markers flickering when zooming, my last push fixes this, but may seem counterintuitive at first glance |
This reverts commit a8a2bdc.
Ignore my last comment and commit, there was something else goofy going on with my browser. |
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 now, thanks!
…ased on current zoom level.
Signed-off-by: digitaldan [email protected]