from .path import Path


class CircleMarker(Path):
    def __init__(self, latLng, options=None):
        super().__init__()
        self.latLng = latLng
        self.options = options
        if self._map:
            self._initJs()

    def _initJs(self):
        leafletJsObject = 'L.circleMarker({latLng}'.format(latLng=self.latLng)
        if self.options:
            leafletJsObject += ', {options}'.format(options=self.options)
        leafletJsObject += ')'
        self._createJsObject(leafletJsObject, self._map.mapWidgetIndex)

