From ade9ac8857685508edb3abf8d9cd517494a23e2f Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Sun, 22 Mar 2020 20:08:24 +0100 Subject: [PATCH] Make mapbox-style example fullscreen on demand --- examples/mapbox-style.html | 27 ++------------------------- examples/mapbox-style.js | 5 ++++- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/examples/mapbox-style.html b/examples/mapbox-style.html index 8285734955..1c88215464 100644 --- a/examples/mapbox-style.html +++ b/examples/mapbox-style.html @@ -1,5 +1,5 @@ --- -layout: example-verbatim.html +layout: example.html title: Vector tiles created from a Mapbox Style object shortdesc: Example of using ol-mapbox-style with tiles from maptiler.com. docs: > @@ -10,27 +10,4 @@ cloak: - key: get_your_own_D6rA4zTHduk6KOKTXzGB value: Get your own API key at https://www.maptiler.com/cloud/ --- - - - - - - - Mapbox Style objects with ol-mapbox-style - - - - - -
- - - - +
diff --git a/examples/mapbox-style.js b/examples/mapbox-style.js index 819177a69d..a774155526 100644 --- a/examples/mapbox-style.js +++ b/examples/mapbox-style.js @@ -1,3 +1,6 @@ import apply from 'ol-mapbox-style'; +import FullScreen from '../src/ol/control/FullScreen.js'; -apply('map', 'https://api.maptiler.com/maps/topo/style.json?key=get_your_own_D6rA4zTHduk6KOKTXzGB'); +apply('map', 'https://api.maptiler.com/maps/topo/style.json?key=get_your_own_D6rA4zTHduk6KOKTXzGB').then(function(map) { + map.addControl(new FullScreen()); +});