Delete clustermarker.js

This commit is contained in:
Parry 2020-02-01 19:00:08 +08:00 committed by GitHub
parent a8798ae862
commit be6b65ac83
1 changed files with 0 additions and 44 deletions

View File

@ -1,44 +0,0 @@
import {
Scene,
Marker,
MarkerLayer
} from '@antv/l7';
import {
GaodeMap
} from '@antv/l7-maps';
const scene = new Scene({
id: 'map',
map: new GaodeMap({
style: 'light',
center: [ 105.790327, 36.495636 ],
pitch: 0,
zoom: 4
})
});
addMarkers();
scene.render();
function addMarkers() {
fetch(
'https://gw.alipayobjects.com/os/basement_prod/d3564b06-670f-46ea-8edb-842f7010a7c6.json'
)
.then(res => res.json())
.then(nodes => {
const markerLayer = new MarkerLayer({
cluster: true
});
for (let i = 0; i < nodes.features.length; i++) {
const {
coordinates
} = nodes.features[i].geometry;
const marker = new Marker().setLnglat({
lng: coordinates[0],
lat: coordinates[1]
});
markerLayer.addMarker(marker);
}
scene.addMarkerLayer(markerLayer);
// scene.addMarkerLayer(markerLayer);
});
}