Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 |
This file contains 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 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 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'); |