django -传单-设置动态图层



我想设置DynamicMapLayer到我的django-传单模板。也许有人知道怎么做?

我更喜欢L.esri.dynamicMapLayer,也许esri-leaflet.js插件中的L.esri.featureLayer

我解决了这个问题。我在settings.py中忘记了'PLUGINS'

'PLUGINS': {
    'esri-leaflet': {
        'css': '',
        'js': 'libs/esri-leaflet/dist/esri-leaflet.js',
        'auto-include': True,
    }
},

然后添加到模板:

<head>
    ...
    {% leaflet_js plugins="ALL" %}
    {% leaflet_css plugins="ALL" %}
</head>
<body>
    ....
    L.esri.dynamicMapLayer({
        url: 'http://mytilesURL',
        ...
    }).addTo(map);
    ....
</body>

来源:django-传单文档

最新更新