Skip to content

Commit

Permalink
Merge pull request #17 from jtmiclat/fix/tooltip
Browse files Browse the repository at this point in the history
Fix Tooltip
  • Loading branch information
jtmiclat authored Dec 20, 2023
2 parents 61da614 + 687a437 commit 4bf1fb5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
6 changes: 4 additions & 2 deletions folium_pmtiles/vector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from branca.element import MacroElement
from folium.elements import JSCSSMixin
from folium.map import Layer
from jinja2 import Template
Expand Down Expand Up @@ -102,7 +103,7 @@ def __init__(self, url, layer_name=None, style=None, tooltip=None, **kwargs):
self.style = {}


class PMTilesMapLibreTooltip(JSCSSMixin, Layer):
class PMTilesMapLibreTooltip(JSCSSMixin, MacroElement):
_template = Template(
"""
{% macro header(this, kwargs) %}
Expand Down Expand Up @@ -162,4 +163,5 @@ class PMTilesMapLibreTooltip(JSCSSMixin, Layer):
)

def __init__(self, name=None, **kwargs):
super().__init__(name=name if name else "PMTilesTooltip", **kwargs)
super().__init__(**kwargs)
self._name = name if name else "PMTilesTooltip"
18 changes: 15 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4bf1fb5

Please sign in to comment.