mapgl antarctida geojson
by Trufi
HTML
<script src="https://mapgl.2gis.com/api/js/v1"></script>
<div id="container"></div>
CSS
html,
body,
#container {
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
JavaScript
const map = new mapgl.Map('container', {
center: [0, -50],
zoom: 2,
key: 'bfd8bbca-8abf-11ea-b033-5fa57aae2de7',
});
map.on('styleload', () => {
map.addLayer({
type: 'polygon',
filter: ['match', ['sourceAttr', 'name'],
['gj-territory-polygons'], true, false
],
minzoom: 0,
maxzoom: 10,
style: {
color: ['match', ['get', 'n'],
[1], '#ff000055',
[2], '#00ff0055',
[3], '#0000ff55',
[4], '#ffff0055',
[5], '#ff00ff55',
[6], '#00ffff55',
[7], '#aaff0055',
[8], '#00ffaa55',
"#00000055"
],
},
})
});
const x = {
type: 'FeatureCollection',
features: [{
type: 'Feature',
id: 'ATA',
properties: {
n: 1
},
geometry: {
type: 'MultiPolygon',
coordinates: [
[
[
[-59.572095, -80.040179],
[-59.865849, -80.549657],
[-60.159656, -81.000327],
[-62.255393, -80.863178],
[-64.488125, -80.921934],
[-65.741666, -80.588827],
[-65.741666, -80.549657],
[-66.290031, -80.255773],
[-64.037688, -80.294944],
[-61.883246, -80.39287],
[-61.138976, -79.981371],
[-60.610119, -79.628679],
[-59.572095, -80.040179],
],
]
],
},
},
{
type: 'Feature',
id: 'ATA',
properties: {
n: 2
},
geometry: {
type: 'MultiPolygon',
coordinates: [
[
[
[-159.208184, -79.497059],
[-161.127601, -79.634209],
[-162.439847, -79.281465],
[-163.027408, -78.928774],
[-163.066604, -78.869966],
[-163.712896, -78.595667],
[-163.105801, -78.223338],
[-161.245113, -78.380176],
[-160.246208, -78.693645],
...