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 layer_selector variable in published maps #1595

Merged
merged 3 commits into from
Mar 16, 2020
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: 1 addition & 1 deletion cartoframes/assets/init.js.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ document
const camera = {{ camera|tojson }};
const has_legends = '{{has_legends}}' === 'True';
const is_static = '{{is_static}}' === 'True';
const layer_selector = '{{layer_selector}}' === 'True'; // TODO it will be a helper
const layer_selector = '{{layer_selector}}' === 'True';
const layers = {{ layers|tojson }};
const mapboxtoken = '{{mapboxtoken}}';
const show_info = '{{show_info}}' === 'True';
Expand Down
1 change: 1 addition & 0 deletions cartoframes/viz/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def _get_publication_html(self, name):
description=self.description,
is_static=self.is_static,
is_embed=True,
layer_selector=self.layer_selector,
_carto_vl_path=self._carto_vl_path,
_airship_path=self._airship_path)

Expand Down
2 changes: 2 additions & 0 deletions tests/unit/viz/test_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def test_map_publish_remote_default(self, mocker):
description=None,
is_embed=True,
is_static=None,
layer_selector=False,
layers=[],
show_info=False,
size=None,
Expand Down Expand Up @@ -268,6 +269,7 @@ def test_map_publish_remote_params(self, mocker):
description='description',
is_embed=True,
is_static=True,
layer_selector=False,
layers=[],
show_info=False,
size=None,
Expand Down