Mapbox:无法在本地服务器上显示我的地图?

时间:2019-08-28 14:08:19

标签: mapbox mapbox-gl-js

我尝试在本地服务器AMPPS中创建一个交互式地图:

(index.html):https://pastebin.com/7TzJFyPj

<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Demo Map</title>
  <link rel="icon" type="image/png" href="img/favicon.png">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <link rel="stylesheet" href="css/style.css">
  <link href='https://api.mapbox.com/mapbox-gl-js/v1.2.0/mapbox-gl.css' rel='stylesheet' />
  <script type="text/javascript" src="js/script.js"></script>
  <script src='https://api.mapbox.com/mapbox-gl-js/v1.2.0/mapbox-gl.js'></script>
</head>
<body>
  <div class="container">
    <section class="row">
      <div class="col-sm-12 col-md-12 col-lg-12 text-center">
        <h1>DEMO: Interactive Map</h1>
      </div>
      <div id='map-rse' class="col-sm-12 col-md-12 col-lg-12"></div>
    </section>
  </div>
  <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.0.0/mapbox-gl.js'></script>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>

(style.css):https://pastebin.com/phd7eNQ6

(script.js):https://pastebin.com/uT5Qayuw

但是我的页面上什么都没有显示。

如何解决此问题?查看其他链接以了解更多信息 关于我的工作。

最诚挚的问候,

Lordaker。

0 个答案:

没有答案