From b3ee25079e51135ac6a76fe5cf5d83157a2e06bf Mon Sep 17 00:00:00 2001 From: deecay Date: Fri, 6 Apr 2018 12:58:55 -0400 Subject: [PATCH 1/2] Choropleth: Add fullscreen control --- client/app/visualizations/choropleth/index.js | 3 +++ package.json | 1 + 2 files changed, 4 insertions(+) diff --git a/client/app/visualizations/choropleth/index.js b/client/app/visualizations/choropleth/index.js index b9ad7088c77..6da2b9dc8c0 100644 --- a/client/app/visualizations/choropleth/index.js +++ b/client/app/visualizations/choropleth/index.js @@ -2,6 +2,8 @@ import _ from 'underscore'; import L from 'leaflet'; import 'leaflet/dist/leaflet.css'; import { formatSimpleTemplate } from '@/lib/value-format'; +import 'leaflet-fullscreen'; +import 'leaflet-fullscreen/dist/leaflet.fullscreen.css'; import { AdditionalColors, @@ -152,6 +154,7 @@ function choroplethRenderer($sanitize, $http) { maxBounds: choroplethBounds, maxBoundsViscosity: 1, attributionControl: false, + fullscreenControl: true, }); map.on('focus', () => { map.on('moveend', getBounds); }); diff --git a/package.json b/package.json index b6ae2d9141d..24baf6f3d5a 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "jquery-ui": "^1.12.1", "leaflet": "^1.2.0", "leaflet.markercluster": "^1.1.0", + "leaflet-fullscreen": "^1.0.2", "markdown": "0.5.0", "material-design-iconic-font": "^2.2.0", "moment": "^2.19.3", From 07b5003c6faa007c08fdb87fd309feeedf6fe9a9 Mon Sep 17 00:00:00 2001 From: deecay Date: Sat, 7 Apr 2018 14:37:44 +0900 Subject: [PATCH 2/2] Map: Add fullscreen control --- client/app/visualizations/map/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/app/visualizations/map/index.js b/client/app/visualizations/map/index.js index ecb3242c838..2e7f4fe6f9a 100644 --- a/client/app/visualizations/map/index.js +++ b/client/app/visualizations/map/index.js @@ -8,6 +8,8 @@ import 'leaflet.markercluster/dist/MarkerCluster.Default.css'; import markerIcon from 'leaflet/dist/images/marker-icon.png'; import markerIconRetina from 'leaflet/dist/images/marker-icon-2x.png'; import markerShadow from 'leaflet/dist/images/marker-shadow.png'; +import 'leaflet-fullscreen'; +import 'leaflet-fullscreen/dist/leaflet.fullscreen.css'; import template from './map.html'; import editorTemplate from './map-editor.html'; @@ -29,7 +31,10 @@ function mapRenderer() { template, link($scope, elm) { const colorScale = d3.scale.category10(); - const map = L.map(elm[0].children[0].children[0], { scrollWheelZoom: false }); + const map = L.map(elm[0].children[0].children[0], { + scrollWheelZoom: false, + fullscreenControl: true, + }); const mapControls = L.control.layers().addTo(map); const layers = {}; const tileLayer = L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {