如何在ngx-leaflet中使用leaflet-extra/leaflet-providers。一个简单的例子会很好。我安装了leaflet、@types/leaflet、ngx-leaflet、leaflet-providers、@types/leaflet-providers,但我想不出如何将ngx-leaflet与tileLayer.providers('ProviderId')链接起来。应该有一个.addTo(???map???)调用。谢谢。
发布于 2018-03-02 06:56:00
如果需要访问地图参考,可以按照此处的说明进行操作:https://github.com/Asymmetrik/ngx-leaflet#getting-a-reference-to-the-map
这里还有一个指南,其中包含一系列如何集成Leaflet插件的示例:https://github.com/Asymmetrik/ngx-leaflet-tutorial-plugins
在这个示例中,您将使用providers插件来创建层,并将这些层添加到提供给leafletLayers输入绑定或leafletLayersControl输入绑定的layers数组中。
您只需要创建层,并将它们添加到适当的数组或对象中。
如果你能提供一些更具体的示例代码,我可以给你更多细节。
https://stackoverflow.com/questions/49059886
复制相似问题