html - 试图将数据添加到我的 Leaflet web 地图中的另一个“选项卡”?
问题描述
我似乎无法弄清楚如何离开我的“主页”并在另一个页面上插入新数据。
下面是我到目前为止开发的 HTML!我试过弄乱几个不同的部分,但我似乎无法进入我的新闻页面!
</head>
<body>
<!-- Header Section -->
<header>
<div class="head1">Turkey, Through The Ages</div>
<div class="head2">An educational and interactive experience</div>
</header>
<!-- Menu Navigation Bar -->
<div class="menu">
<a href="#home">HOME</a>
<a href="#news">NEWS</a>
<a href="#notification">NOTIFICATIONS</a>
<div class="menu-log">
<a href="#login">LOGIN</a>
</div>
</div>
<!-- Body section -->
<div class = "body_sec">
<section id="Content">
<h3>Interactive Map</h3>
</section>
</div>
<head>
<title>Turkey, Through the Ages</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<style>
#my-map {
width:2000px;
height:1000px;
}
</style>
</head>
<body>
<div id="my-map"></div>
<script>
window.onload = function () {
var basemap = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
});
$.getJSON("turk.geojson", function(data) {
var geojson = L.geoJson(data, {
onEachFeature: function (feature, layer) {
layer.bindPopup(feature.properties.Area_Name);
}
});
解决方案
推荐阅读
- ruby-on-rails - Rails 5.2 简单更新方法的语法错误
- windows - 静态构建中缺少 Qt 应用程序资源
- php - 在 wp_query 中分别列出每个自定义帖子类型,而不重复循环
- javascript - 如何防止内容在初始页面加载时被移动浏览器的状态栏向上推送和隐藏?
- python - 如何从字典列表转换为字典?
- .net - OleDB 将 .NET 2.0 更改为 4.6.1 返回记录集
- apache-spark - 读取流时使用 withColumn() 出现问题
- reactjs - 如何使用调度程序结合 react-native-router-flux 修复 RN 应用程序在 StateContext 更改时重置
- javascript - KineticJS:多边形上的 .SetFill 更新填充属性,但不填充颜色
- java - 如何修复“Codility FrogJump”算法?