Skip to content

Commit

Permalink
initial S2 layer (#378)
Browse files Browse the repository at this point in the history
* Add S2Layer

* Fix sample-layers build
  • Loading branch information
urosi2453 authored and ibgreen committed Mar 1, 2017
1 parent c3eae5b commit 321f3b0
Show file tree
Hide file tree
Showing 11 changed files with 762 additions and 14 deletions.
10 changes: 7 additions & 3 deletions examples/main/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"scripts": {
"start": "webpack-dev-server --progress --hot --open",
"start-local": "webpack-dev-server --env.local --progress --hot --open"
"start-local": "webpack-dev-server --env.local --progress --hot --open",
"build": "webpack app bundle.js --env.local --display-error-details"
},
"dependencies": {
"deck.gl": "^4.0.0-beta.1",
"deck.gl": "^4.0.0-beta.3",
"extrude-polyline": "^1.0.6",
"immutable": "^3.8.1",
"luma.gl": "3.0.0-beta.9",
"react": "^15.4.1",
"react-autobind": "^1.0.6",
"react-dom": "^15.4.1",
"react-map-gl": "1.7.2",
"react-stats": "^0.0.5"
"react-stats": "^0.0.5",
"s2-geometry": "^1.2.9"
},
"devDependencies": {
"buble-loader": "^0.4.0",
Expand Down
3 changes: 2 additions & 1 deletion examples/main/src/app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* global window, document */
import DeckGL, {autobind} from 'deck.gl/react';
import DeckGL from 'deck.gl';
import {experimental} from 'deck.gl';
const {ReflectionEffect} = experimental;

import React, {PureComponent} from 'react';
import ReactDOM from 'react-dom';
import autobind from 'react-autobind';
import MapboxGLMap from 'react-map-gl';
import {FPSStats} from 'react-stats';

Expand Down
32 changes: 25 additions & 7 deletions examples/main/src/layer-examples/sample-layers.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
EnhancedChoroplethLayer,
TripsLayer
} from '../../../sample-layers';
/* eslint-disable max-len */
import * as mainDataSamples from '../data-samples';
import * as extraDataSamples from '../../../sample-layers/data';
const dataSamples = Object.assign({}, mainDataSamples, extraDataSamples);

import * as dataSamples from '../data-samples';
import EnhancedChoroplethLayer from '../../../sample-layers/enhanced-choropleth-layer/enhanced-choropleth-layer';

const EnhancedChoroplethLayerExample = {
layer: EnhancedChoroplethLayer,
Expand All @@ -15,10 +15,12 @@ const EnhancedChoroplethLayerExample = {
}
};

import TripsLayer from '../../../sample-layers/trips-layer/trips-layer';

const TripsLayerExample = {
layer: TripsLayer,
props: {
id: 'trips-layer',
id: 'trips-layer ',
data: dataSamples.trips,
getPath: trip => trip.map(d => [
d.begin_shape[0],
Expand All @@ -32,10 +34,26 @@ const TripsLayerExample = {
}
};

import S2Layer from '../../../sample-layers/s2-layer/s2-layer';

const S2LayerExample = {
layer: S2Layer,
props: {
data: dataSamples.s2cells,
opacity: 0.6,
getS2Token: f => f.token,
getPath: f => f.path,
getFillColor: f => [f.value * 256, (1 - f.value) * 256, (1 - f.value) * 128],
getStrokeWidth: f => 10,
pickable: true
}
};

/* eslint-disable quote-props */
export default {
'Sample Layers': {
'EnhancedChoroplethLayer': EnhancedChoroplethLayerExample,
'TripsLayer': TripsLayerExample
'TripsLayer': TripsLayerExample,
'S2Layer': S2LayerExample
}
};
3 changes: 3 additions & 0 deletions examples/main/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ module.exports = {
devtool: 'inline-source-map',

resolve: {
// Make src files outside of this dir resolve modules in our node_modules folder
modules: [resolve(__dirname, '.'), resolve(__dirname, 'node_modules'), 'node_modules'],

alias: {
// From mapbox-gl-js README. Required for non-browserify bundlers (e.g. webpack):
'mapbox-gl$': resolve('./node_modules/mapbox-gl/dist/mapbox-gl.js')
Expand Down
47 changes: 44 additions & 3 deletions examples/main/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ arrify@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"

as-number@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/as-number/-/as-number-1.0.0.tgz#acb27e34f8f9d8ab0da9e376f3b8959860f80a66"

asap@~2.0.3:
version "2.0.5"
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.5.tgz#522765b50c3510490e52d7dcfe085ef9ba96958f"
Expand Down Expand Up @@ -644,6 +648,10 @@ d3-geo@^1.2.4:
dependencies:
d3-array "1"

d3-hexbin@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/d3-hexbin/-/d3-hexbin-0.2.1.tgz#24459c47c933b67ed38aecde43d9248f6e3e2001"

d3-interpolate@1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-1.1.3.tgz#e119c91b6be4941e581675ca3e1279bb92bd2c9b"
Expand Down Expand Up @@ -696,10 +704,11 @@ decamelize@^1.0.0, decamelize@^1.1.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"

deck.gl@^4.0.0-beta.1:
version "4.0.0-beta.1"
resolved "https://registry.yarnpkg.com/deck.gl/-/deck.gl-4.0.0-beta.1.tgz#e40e026b1849ead970e5ec15d5294773b689c0ad"
deck.gl@^4.0.0-beta.3:
version "4.0.0-beta.3"
resolved "https://registry.yarnpkg.com/deck.gl/-/deck.gl-4.0.0-beta.3.tgz#571e5f63ccb645fd0ea299d4ee8b2f85b2a5a854"
dependencies:
d3-hexbin "^0.2.1"
earcut "^2.0.6"
file-loader "^0.9.0"
gl-matrix "^2.3.2"
Expand Down Expand Up @@ -979,6 +988,14 @@ extglob@^0.3.1:
dependencies:
is-extglob "^1.0.0"

extrude-polyline@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/extrude-polyline/-/extrude-polyline-1.0.6.tgz#7e6afe1f349a4182fa3f61a00d93979b95f18b20"
dependencies:
as-number "^1.0.0"
gl-vec2 "^1.0.0"
polyline-miter-util "^1.0.1"

extsprintf@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
Expand Down Expand Up @@ -1186,6 +1203,10 @@ gl-matrix@^2.3.1, gl-matrix@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/gl-matrix/-/gl-matrix-2.3.2.tgz#aac808c74af7d5db05fe04cb60ca1a0fcb174d74"

gl-vec2@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/gl-vec2/-/gl-vec2-1.0.0.tgz#77fce6ae9612856d6c8b621cd261cd8281b9c637"

glob-base@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
Expand Down Expand Up @@ -1681,6 +1702,10 @@ lodash@^4.14.0, lodash@^4.17.2:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"

long@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b"

longest@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
Expand Down Expand Up @@ -2148,6 +2173,12 @@ point-geometry@0.0.0, point-geometry@^0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/point-geometry/-/point-geometry-0.0.0.tgz#6fcbcad7a803b6418247dd6e49c2853c584daff7"

polyline-miter-util@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/polyline-miter-util/-/polyline-miter-util-1.0.1.tgz#b693f2389ea0ded36a6bcf5ecd2ece4b6917d957"
dependencies:
gl-vec2 "^1.0.0"

portfinder@^1.0.9:
version "1.0.13"
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.13.tgz#bb32ecd87c27104ae6ee44b5a3ccbf0ebb1aede9"
Expand Down Expand Up @@ -2284,6 +2315,10 @@ rc@~1.1.6:
minimist "^1.2.0"
strip-json-comments "~1.0.4"

react-autobind@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/react-autobind/-/react-autobind-1.0.6.tgz#936bb58edf6b89b619c50f82f0e617159fdfd4f1"

react-dom@^15.4.1:
version "15.4.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.4.2.tgz#015363f05b0a1fd52ae9efdd3a0060d90695208f"
Expand Down Expand Up @@ -2471,6 +2506,12 @@ rw@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/rw/-/rw-0.1.4.tgz#4903cbd80248ae0ede685bf58fd236a7a9b29a3e"

s2-geometry@^1.2.9:
version "1.2.9"
resolved "https://registry.yarnpkg.com/s2-geometry/-/s2-geometry-1.2.9.tgz#20c2eadc621322c0f5ebc5098fa614525031f1e4"
dependencies:
long "^3.2.0"

select-hose@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
Expand Down
2 changes: 2 additions & 0 deletions examples/sample-layers/data/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Additional data for new layers
export {default as s2cells} from './sf.s2cells.json';
Loading

0 comments on commit 321f3b0

Please sign in to comment.