Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter option to layer_definition and named_map in vizjson #4197

Merged
merged 3 commits into from
Jun 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/models/layer_group/presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module CartoDB
module LayerGroup
class Presenter
LAYER_GROUP_VERSION = '1.0.1'
DEFAULT_TILER_FILTER = 'mapnik'

def initialize(layers, options, configuration)
@layers = layers
Expand Down Expand Up @@ -33,6 +34,7 @@ def to_poro
sql_api_port: (configuration[:sql_api]["public"]["port"] rescue nil),
cdn_url: configuration.fetch(:cdn_url, nil),
dynamic_cdn: @options.fetch(:dynamic_cdn_enabled, false),
filter: @configuration[:tiler].fetch('filter', DEFAULT_TILER_FILTER),
layer_definition: {
stat_tag: options.fetch(:visualization_id),
version: LAYER_GROUP_VERSION,
Expand Down
3 changes: 2 additions & 1 deletion app/models/named_map/presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module NamedMapsWrapper
class Presenter

NAMED_MAP_TYPE = 'namedmap'

LAYER_TYPES_TO_DECORATE = [ 'torque' ]
DEFAULT_TILER_FILTER = 'mapnik'

# @throws NamedMapsPresenterError
def initialize(visualization, layergroup, options, configuration)
Expand Down Expand Up @@ -63,6 +63,7 @@ def to_poro
@configuration[:tiler]['public']['port'],
cdn_url: @configuration.fetch(:cdn_url, nil),
dynamic_cdn: @options.fetch(:dynamic_cdn_enabled),
filter: @configuration[:tiler].fetch('filter', DEFAULT_TILER_FILTER),
named_map: {
name: @named_map_name,
stat_tag: @visualization.id,
Expand Down
1 change: 1 addition & 0 deletions config/app_config.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ defaults: &defaults
watcher:
ttl: 60
tiler:
filter: 'mapnik'
internal:
protocol: 'http'
domain: 'localhost.lan'
Expand Down