小编use*_*556的帖子

Mapbox.js 不适用于 Angular.js

我一直在尝试在 angularjs 中使用 mapbox.js 地理地图。

地图:http : //bl.ocks.org/wboykinm/c77e7c891bfc52157843#index.html

JSON 数据:http : //bl.ocks.org/wboykinm/raw/c77e7c891bfc52157843/42d7ab5d1a432a88e905bf14705424ac40ba4480/saplaces.geojson

当我尝试在 angularjs 中使用该代码时,页面上看不到任何内容。只是空的。

<!DOCTYPE html>
<html lang="en-us">
<head>
<title>Learn and Understand AngularJS</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta charset="UTF-8">
<!-- load Jquery Style -->

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">

<!-- load bootstrap and fontawesome via CDN -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />

<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.3/mapbox.css' rel='stylesheet' />
<link href='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.css' rel='stylesheet' />
<link href='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.Default.css' rel='stylesheet' />

 <style>
    body {
        padding: 0;
        margin: 0;
    }
    html, body, #map {
        height: 100%;
    }
</style>


<!-- …
Run Code Online (Sandbox Code Playgroud)

geomap angularjs leaflet mapbox

4
推荐指数
1
解决办法
2870
查看次数

标签 统计

angularjs ×1

geomap ×1

leaflet ×1

mapbox ×1