예제 #1
0
    def __init__(self,
                 url,
                 name=None,
                 attr='',
                 overlay=True,
                 control=True,
                 **kwargs):  # noqa
        super(WmsTileLayer, self).__init__(overlay=overlay,
                                           control=control,
                                           name=name)  # noqa
        self.url = url
        # Options.
        options = _parse_wms(**kwargs)
        options.update({'attribution': attr})

        self.options = json.dumps(options, sort_keys=True, indent=2)

        self._template = Template(u"""
        {% macro script(this, kwargs) %}
            var {{this.get_name()}} = L.tileLayer.wms(
                '{{ this.url }}',
                {{ this.options }}
                ).addTo({{this._parent.get_name()}});

        {% endmacro %}
        """)  # noqa
예제 #2
0
    def __init__(self, url, name=None, attr='', overlay=True, control=True,
                 show=True, **kwargs):
        super(WmsTileLayer, self).__init__(overlay=overlay, control=control,
                                           name=name, show=show)
        self.url = url
        # Options.
        options = _parse_wms(**kwargs)
        options.update({'attribution': attr})

        self.options = json.dumps(options, sort_keys=True, indent=2)
예제 #3
0
    def __init__(self, url, name=None, attr='', overlay=True, control=True,
                 show=True, **kwargs):
        super(WmsTileLayer, self).__init__(overlay=overlay, control=control,
                                           name=name, show=show)
        self.url = url
        # Options.
        options = _parse_wms(**kwargs)
        options.update({'attribution': attr})

        self.options = json.dumps(options, sort_keys=True, indent=2)

        self._template = Template(u"""
        {% macro script(this, kwargs) %}
            var {{this.get_name()}} = L.tileLayer.wms(
                '{{ this.url }}',
                {{ this.options }}
                ).addTo({{this._parent.get_name()}});

        {% endmacro %}
        """)  # noqa