1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
from .layer import Layer
class imageOverlay(Layer):
def __init__(self, imageURL, bounds, options=None):
super().__init__()
self.imageURL = imageURL
self.bounds = bounds
self.options = options
if self._map:
self._initJs()
def _initJs(self):
leafletJsObject = 'L.imageOverlay("{imageURL}",{bounds}'.format(imageURL=self.imageURL,bounds=self.bounds)
if self.options:
leafletJsObject += ', {options}'.format(options=self.options)
leafletJsObject += ')'
self._createJsObject(leafletJsObject, self._map.mapWidgetIndex)
|