首页 > 解决方案 > 使用javascript从本地文件向传单添加数据

问题描述

我在互联网上看到了许多建议的解决方案,但没有一个能解决我的问题。

<script>
        var url = "file:///home/myusername/Bureau/metroweb/Metropolis/templates/visualization/Circular City/edges.geojson"

        // Initiate the map
        var map = L.map('mapid').setView([48.832091014134825, 2.355001022600193], 10);

        // This adds the tiles
 
        L.tileLayer('http://{s}.tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png', {
        attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>contributors'
        }).addTo(mymap);

        var myLayer = L.geoJSON().addTo(map);
        myLayer.addData(url);
  
</script>

标签: javascriptjqueryd3.jsleaflet

解决方案


推荐阅读