Skip to content
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

Add WidgetMarker #728

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

martinRenou
Copy link
Member

@martinRenou martinRenou commented Oct 17, 2020

Fix #717

This requires updating LeafletJS, we need to be extra careful that everything still works as expected after this.

widgetmarker

@martinRenou
Copy link
Member Author

martinRenou commented Oct 17, 2020

  • It still needs some CSS work as well.
  • Needs documentation

Comment on lines +392 to +439
class WidgetMarker(Marker):
_view_name = Unicode('LeafletWidgetMarkerView').tag(sync=True)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs docstring

@deeplook
Copy link
Contributor

Cool! Would like to see some tiny explanation about which point of the rendered widget the specified location will refer to, like lower-left (or rather South-West?), I'd assume.

@martinRenou
Copy link
Member Author

@deeplook I am actually not sure. If you look at the screenshot closely you'll see a small white square at the top-left of the button, I suspect this is the center of the marker but I am really not sure.

Signed-off-by: martinRenou <martin.renou@gmail.com>
Signed-off-by: martinRenou <martin.renou@gmail.com>
@martinRenou
Copy link
Member Author

martinRenou commented Oct 17, 2020

I now position the widget at the center of the marker using CSS

This is what happens if we have a WidgetMarker at the same position as a Marker:
markers

@martinRenou
Copy link
Member Author

I might add a transparent_bg option like you did @omanges

Signed-off-by: martinRenou <martin.renou@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow putting any widget on the map
2 participants