Skip to content

Commit

Permalink
Merge pull request #9 from 2gis/TILES-4778-update-deck-version
Browse files Browse the repository at this point in the history
TILES-4778
  • Loading branch information
Kuznecoff authored Nov 21, 2022
2 parents a98910b + c11b148 commit c453a2a
Show file tree
Hide file tree
Showing 9 changed files with 9,787 additions and 825 deletions.
16 changes: 6 additions & 10 deletions demo/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Deck2gisLayer } from '../src';
import { HeatmapLayer, HexagonLayer } from '@deck.gl/aggregation-layers';
import { Deck, RGBAColor } from '@deck.gl/core';
import { HeatmapLayer, HexagonLayer } from '@deck.gl/aggregation-layers/typed';
import { Color, Deck } from '@deck.gl/core/typed';
import { data } from './data';
import { initDeck2gisProps } from '../src/utils';

Expand All @@ -27,7 +27,7 @@ function initDeckGL() {
map.addLayer(deckLayer3);
}

const COLOR_RANGE: RGBAColor[] = [
const COLOR_RANGE: Color[] = [
[1, 152, 189],
[73, 227, 206],
[216, 254, 181],
Expand All @@ -37,7 +37,7 @@ const COLOR_RANGE: RGBAColor[] = [
];

function createHeatmapLayer(data) {
const layer = new Deck2gisLayer<HeatmapLayer<any>>({
const layer = new Deck2gisLayer<HeatmapLayer>({
id: 'deckgl-HeatmapLayer',
deck,
colorRange: COLOR_RANGE,
Expand All @@ -48,12 +48,10 @@ function createHeatmapLayer(data) {
getPosition: (d) => [d.point.lon, d.point.lat],
});

layer.onAdd();

return layer;
}
function createHexagonLayer(data) {
const layer = new Deck2gisLayer<HexagonLayer<any>>({
const layer = new Deck2gisLayer<HexagonLayer>({
id: 'deckgl-HexagonLayer',
deck,
colorRange: COLOR_RANGE,
Expand All @@ -68,12 +66,11 @@ function createHexagonLayer(data) {
antialiasing: true,
});

layer.onAdd();
return layer;
}

function createHexagonLayer2(data) {
const layer = new Deck2gisLayer<HexagonLayer<any>>({
const layer = new Deck2gisLayer<HexagonLayer>({
id: 'deckgl-HexagonLayer2',
deck,
colorRange: COLOR_RANGE,
Expand All @@ -87,7 +84,6 @@ function createHexagonLayer2(data) {
extruded: true,
});

layer.onAdd();
return layer;
}

Expand Down
Loading

0 comments on commit c453a2a

Please sign in to comment.