javascript - 使用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: '© <a href="http://osm.org/copyright">OpenStreetMap</a>contributors'
}).addTo(mymap);
var myLayer = L.geoJSON().addTo(map);
myLayer.addData(url);
</script>
解决方案
推荐阅读
- python - 为什么我的参数没有在 Python 中定义?
- python-3.x - tensorflow 在使用 tf.map_fn 时消耗太多内存
- image - 我需要一个具有准确 Alpha 通道的图像数据集
- html - div 框在彼此下方对齐,而不是彼此相邻
- react-native - Expo人脸检测器不提供设置对象
- c# - 将语句作为 Func 发送的正确方法
- printing - 通过选择预设和格式进行 Applescript 打印
- swiftui - 如何在 fullScreenCover 中为 view.init 传递 var?
- javascript - XLSX.read 不是函数
- javascript - 如何在 Vuejs 中重新排列来自 API 的数组位置?