如何在stackblitz中包含javascript url依赖项?
我正试图在stackblitz中运行类似的东西 代码(不是我的,但类似于我试图实现的)运行在您可以从github将依赖项作为url包含的地方,但在stackblitz项目中尝试相同的操作时,代码不起作用 我尝试在index.html中包含依赖项,如下所示:如何在stackblitz中包含javascript url依赖项?,javascript,web-applications,stackblitz,Javascript,Web Applications,Stackblitz,我正试图在stackblitz中运行类似的东西 代码(不是我的,但类似于我试图实现的)运行在您可以从github将依赖项作为url包含的地方,但在stackblitz项目中尝试相同的操作时,代码不起作用 我尝试在index.html中包含依赖项,如下所示: <script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script> <script src="https://kartena.githu
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/lib/proj4-compressed.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/src/proj4leaflet.js"></script>
<script src="https://cdn.rawgit.com/MrMufflon/Leaflet.Coordinates/master/dist/Leaflet.Coordinates-0.1.5.min.js"></script>
我也尝试过一些动态加载代码片段,但最后总是
L没有定义
在页面
标记中添加脚本标记
<head>
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/lib/proj4-compressed.js"></script>
<script src="https://kartena.github.io/Proj4Leaflet/src/proj4leaflet.js"></script>
<script src="https://cdn.rawgit.com/MrMufflon/Leaflet.Coordinates/master/dist/Leaflet.Coordinates-0.1.5.min.js"></script>
</head>
<div id="app"></div>
<div id="map"></div>
有任何请求错误吗,cors?@madalinivascu问题是,我不能包含这些依赖项,这是编辑器:现在:无法读取未定义的属性“CRS”。L.Proj.CRS是在中定义的。你检查过演示了吗?我在我提供的stackbiz中没有看到这个错误。对不起,我刚刚在internet explorer中尝试过,它在那里工作,然后是chrome。谢谢你的帮助,我正在使用chrome,它工作得很好,你可能会有一些chrome插件干扰页面