This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH | |
| filtered_selection AS ( | |
| SELECT * | |
| FROM demographic | |
| WHERE geoid IN ('1000201','1000202','1000600','1000800','1001001','1001002','1001200','1001401','1001402','1001600','1001800','1002000','1002201','1002202','1002400','1002500','1002601','1002602','1002700','1002800','1003001','1003002','1003200','1003400','1003601','1003602','1003800','1004000','1004400','1004800') | |
| ), | |
| enriched_selection AS ( | |
| SELECT * | |
| FROM filtered_selection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle' | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Promise } from 'rsvp'; | |
| import Config from '../../config/environment'; | |
| import MapboxGl from 'mapbox-gl'; | |
| import QUnit from 'qunit'; | |
| MapboxGl.accessToken = Config['mapbox-gl'].accessToken; | |
| export default function createMap() { | |
| return new Promise((resolve) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle' | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Service from '@ember/service'; | |
| import EmberObject from '@ember/object'; | |
| import { alias } from '@ember/object/computed'; | |
| export default class DynamicQueryParamsService extends Service { | |
| setup(expected, received) { | |
| // map and alias model prop references to public properties | |
| const aliasedObjectMap = expected | |
| .reduce((acc, layerGroup) => { | |
| const id = layerGroup.get('id'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| @module Discourse | |
| */ | |
| var get = Ember.get, set = Ember.set; | |
| var popstateFired = false; | |
| var supportsHistoryState = window.history && 'state' in window.history; | |
| // Thanks: https://gist.github.com/kares/956897 | |
| var re = /([^&=]+)=?([^&]*)/g; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default class ProjectsMapComponent extends Component { | |
| @restartableTask | |
| projectCentroidsSource = function*() { | |
| const sourceLayers = [{ | |
| id: 'project-centroids', | |
| sql: 'SELECT * FROM project_centroids', | |
| }]; | |
| const tileURL = yield carto.getVectorTileTemplate(sourceLayers); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* GET /tiles/:z/:x/:y.mvt */ | |
| /* Retreive a vector tile by tileid */ | |
| router.get('/tiles/:z/:x/:y.mvt', async (req, res) => { | |
| const { z, x, y } = req.params; | |
| // calculate the bounding polygon for this tile | |
| const bbox = mercator.bbox(x, y, z, false); | |
| // Query the database, using ST_AsMVTGeom() to clip the geometries | |
| // Wrap the whole query with ST_AsMVT(), which will create a protocol buffer |