deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Add a purejs iTowns example

Open aakaydin opened this issue 4 years ago • 1 comments

Referencing issue #6093

Change List

  • Added an example using iTowns to examples/get-started/pure-js

For the moment the background map doesn't have the same projections as DeckGL and the two maps seem to 'slide' while panning, the airports dont stay on the same place as we move the map.

aakaydin avatar Aug 12 '21 08:08 aakaydin

Thanks for the submission. If you test against the master branch (yarn start-local) you can use an externally constructed projection matrix:

onViewStateChange: ({viewState}) => {
  ...
  viewState.projectionMatrix = getProjectionMatrix(view);
  return viewState;
}

It may be easier to use your base map's controller instead:

const deck = new Deck({
  controller: false
  style: {pointerEvents: 'none'},
  viewState: INITIAL_VIEW_STATE
});

// pseudo code
view.on('change', () => {
  const deckViewState = getDeckViewState(view);
  deck.setProps({viewState: deckViewState}));
});

Pessimistress avatar Aug 12 '21 18:08 Pessimistress