我在 github 中发布了一个网页https://djouallah.github.io/keplergl/,并且我限制对这些 URL 的访问,(我正在尝试不同的组合)
https://djouallah.github.io/keplergl
https://djouallah.github.io/keplergl/
https://djouallah.github.io/keplergl/index.html
但是 mapbox 不渲染,它可以与我的公共令牌一起使用,我不能使用它,因为我想将其保密。这是html页面的代码
<html>
<head>
<title>deck.gl solar Farm Example</title>
<script src="https://unpkg.com/deck.gl@^7.0.0/dist.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.js"></script>
</head>
<body>
<div id="container"></div>
</body>
<script type="text/javascript">
const {DeckGL, ScatterplotLayer} = deck;
function get_colour( d ) {
if( d === '1-pile' ) {
return [0,128,255]
} else if ( d === '2-Tracker') {
return [255,100,128]
} else if ( d === '3-module') {
return [128, 128, 128]
} else {
return [255, 255, 255]
}
}
new DeckGL({
mapboxApiAccessToken: 'pk.eyJ1IjoibWltNzg3IiwiYSI6ImNrMDFwbnNxajJseG8zY21sY2l0Mmp3MnMifQ.LQMXWc8aDucjeSkqGvRNPw',
mapStyle: 'mapbox://styles/mapbox/satellite-streets-v9',
longitude: 5.21,
latitude: 35.504,
zoom: 15,
minZoom: 5,
maxZoom: 20,
pitch: 40.5,
layers:[
new ScatterplotLayer({
id: 'scatter-plot',
data: 'https://raw.githubusercontent.com/djouallah/interactivie_map/master/data.json',
radiusScale: 3,
radiusMinPixels: 0.25,
getPosition: d => [d[0], d[1], 0],
getFillColor: d => get_colour( d[3] )
})
]
});
</script>
</html>