Ejemplo n.º 1
0
    def __init__(self, locations, popup=None, tooltip=None, **kwargs):
        super(AntPath, self).__init__(
            locations,
            popup=popup,
            tooltip=tooltip,
        )

        self._name = 'AntPath'
        # Polyline + AntPath defaults.
        self.options = path_options(line=True, **kwargs)
        self.options.update({
            'paused':
            kwargs.pop('paused', False),
            'reverse':
            kwargs.pop('reverse', False),
            'hardwareAcceleration':
            kwargs.pop('hardware_acceleration', False),
            'delay':
            kwargs.pop('delay', 400),
            'dashArray':
            kwargs.pop('dash_array', [10, 20]),
            'weight':
            kwargs.pop('weight', 5),
            'opacity':
            kwargs.pop('opacity', 0.5),
            'color':
            kwargs.pop('color', '#0000FF'),
            'pulseColor':
            kwargs.pop('pulse_color', '#FFFFFF'),
        })
    def __init__(self,
                 location,
                 radius,
                 direction=None,
                 arc=None,
                 start_angle=None,
                 stop_angle=None,
                 popup=None,
                 tooltip=None,
                 **kwargs):
        super(SemiCircle, self).__init__(location,
                                         popup=popup,
                                         tooltip=tooltip)
        self._name = 'SemiCircle'
        self.direction = (
            direction,
            arc) if direction is not None and arc is not None else None
        self.options = path_options(line=False, radius=radius, **kwargs)
        self.options.update(
            parse_options(
                start_angle=start_angle,
                stop_angle=stop_angle,
            ))

        if not ((direction is None and arc is None) and
                (start_angle is not None and stop_angle is not None) or
                (direction is not None and arc is not None) and
                (start_angle is None and stop_angle is None)):
            raise ValueError(
                "Invalid arguments. Either provide direction and arc OR start_angle and stop_angle"
            )
Ejemplo n.º 3
0
    def __init__(self, locations, popup=None, tooltip=None, **kwargs):
        super(AntPath, self).__init__(
            locations,
            popup=popup,
            tooltip=tooltip,
        )

        self._name = 'AntPath'
        # Polyline + AntPath defaults.
        self.options = path_options(line=True, **kwargs)
        self.options.update({
            'paused': kwargs.pop('paused', False),
            'reverse': kwargs.pop('reverse', False),
            'hardwareAcceleration': kwargs.pop('hardware_acceleration', False),
            'delay': kwargs.pop('delay', 400),
            'dashArray': kwargs.pop('dash_array', [10, 20]),
            'weight': kwargs.pop('weight', 5),
            'opacity': kwargs.pop('opacity', 0.5),
            'color': kwargs.pop('color', '#0000FF'),
            'pulseColor': kwargs.pop('pulse_color', '#FFFFFF'),
        })