forked from mapbox/mapbox-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add better release testing page at http://<host>:9966/test/release/
- Loading branch information
Showing
23 changed files
with
307 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const address = require('address'); | ||
const qrcode = require('qrcode-terminal'); | ||
|
||
const url = `http://${address.ip()}:9966/test/release/`; | ||
console.warn(`Scan this QR code or enter ${url}`); | ||
qrcode.generate(url); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Add GeoJSON marker", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/geojson-markers.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Adjust a layer's opacity", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/adjust-layer-opacity.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Animate point", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/animate-point-along-line.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Check for browser support", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/check-for-support.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Add custom icons with Markers", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/custom-marker-icons.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Add a custom style layer", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/custom-style-layer.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Filter features within map view", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/filter-features-within-map-view.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Create a hover effect", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/hover-styles.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
html, body { | ||
margin:0; | ||
padding:0; | ||
height:100%; | ||
width:100%; | ||
position: fixed; | ||
} | ||
|
||
body { | ||
font-family:"Open Sans", sans-serif; | ||
} | ||
|
||
nav#top { | ||
height:60px; | ||
background:#4264fb; | ||
display:flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
color:white; | ||
overflow: hidden; | ||
} | ||
|
||
#logo { | ||
margin:10px; | ||
display:flex; | ||
} | ||
|
||
#title { | ||
flex-grow:1; | ||
font-size:20px; | ||
display:flex; | ||
align-items:center; | ||
padding:4px 20px; | ||
line-height:0.9em; | ||
text-overflow:ellipsis; | ||
} | ||
|
||
#buttons { | ||
width:120px; | ||
display:flex; | ||
} | ||
|
||
#buttons button { | ||
width:60px; | ||
height:60px; | ||
border:0; | ||
background:none; | ||
color:white; | ||
} | ||
|
||
#buttons button path { | ||
fill:white; | ||
} | ||
|
||
#buttons button:disabled { | ||
opacity:0.25; | ||
} | ||
|
||
section#container { | ||
height:calc(100% - 60px); | ||
max-height:768px; | ||
display:flex; | ||
background-color:#CCC; | ||
} | ||
|
||
section#container iframe { | ||
flex-grow : 1; | ||
border:0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html class="has-navbar-fixed-top"> | ||
<head> | ||
<title>Mapbox GL JS release testing page</title> | ||
<meta charset='utf-8'> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | ||
<link rel="stylesheet" type="text/css" href="/test/release/index.css"> | ||
<script src="/test/release/index.js"></script> | ||
<script src='/debug/access_token_generated.js'></script> | ||
</head> | ||
|
||
<body> | ||
<nav id="top"> | ||
<div id="title">Release Testing</div> | ||
<div id="buttons"> | ||
<button id="prev"><svg aria-hidden="true" viewBox="-3 -1 14 9"><path d="M10,5l-6,0l0,3l-4,-4l4,-4l0,3l6,0l0,2Z"/></svg> Previous</button> | ||
<button id="next"><svg aria-hidden="true" viewBox="-2 -1 14 9"><path d="M0,3l6,0l0,-3l4,4l-4,4l0,-3l-6,0l0,-2Z"/></svg> Next</button> | ||
</div> | ||
</nav> | ||
<section id="container"></section> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
/* eslint-env browser */ | ||
const mapboxgl = {}; | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
const jsProdMin = document.createElement("a"); | ||
jsProdMin.href = "/dist/mapbox-gl.js"; | ||
const css = document.createElement("a"); | ||
css.href = "/dist/mapbox-gl.css"; | ||
|
||
const titleElement = document.querySelector('#title'); | ||
const container = document.querySelector('#container'); | ||
const prevButton = document.querySelector('#prev'); | ||
const nextButton = document.querySelector('#next'); | ||
|
||
const pages = [ | ||
"add-geojson", | ||
"animate-point", | ||
"queryrenderedfeatures", | ||
"scroll-fly-to", | ||
"popup-on-click", | ||
"hover-styles", | ||
"satellite-map", | ||
"custom-marker-icons", | ||
"filter-features-within-map-view", | ||
"video-on-a-map", | ||
"custom-style-layer", | ||
"adjust-layer-opacity", | ||
"check-for-support", | ||
"mapbox-gl-geocoder", | ||
"mapbox-gl-directions", | ||
"mapbox-gl-draw", | ||
"mapbox-gl-compare", | ||
"mapbox-gl-rtl-text" | ||
]; | ||
|
||
const params = { | ||
page: pages[0] | ||
}; | ||
|
||
location.hash.substr(1).split('&').forEach((param) => { | ||
const entry = param.split('=', 2); | ||
params[entry[0]] = entry[1]; | ||
}); | ||
|
||
let index = pages.indexOf(params.page); | ||
if (index < 0) index = 0; | ||
|
||
let req; | ||
let metadata; | ||
|
||
function load() { | ||
if (req) { | ||
req.abort(); | ||
} | ||
|
||
titleElement.innerText = 'Loading…'; | ||
while (container.firstChild) container.removeChild(container.firstChild); | ||
|
||
params.page = pages[index]; | ||
const page = params.page; | ||
|
||
req = new XMLHttpRequest(); | ||
req.addEventListener("load", loadedMetadata); | ||
req.responseType = 'json'; | ||
req.open("GET", `/test/release/${page}.json`); | ||
req.send(); | ||
|
||
function loadedMetadata() { | ||
if (req.status !== 200) { | ||
container.innerText = `Failed to load ${req.responseURL}: ${req.statusText}`; | ||
return; | ||
} | ||
metadata = req.response; | ||
titleElement.innerText = metadata.title; | ||
|
||
req = new XMLHttpRequest(); | ||
req.addEventListener("load", loadedHTML); | ||
req.open("GET", metadata.url ? metadata.url : `/test/release/${page}.html`); | ||
req.send(); | ||
} | ||
|
||
function loadedHTML() { | ||
if (req.status !== 200) { | ||
container.innerText = `Failed to load ${req.responseURL}: ${req.statusText}`; | ||
return; | ||
} | ||
const iframe = document.createElement('iframe'); | ||
container.appendChild(iframe); | ||
const url = URL.createObjectURL(new Blob([ | ||
'<!DOCTYPE html>\n', | ||
'<html>\n', | ||
'<head>\n', | ||
' <title>Mapbox GL JS debug page</title>\n', | ||
' <meta charset="utf-8">\n', | ||
' <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">\n', | ||
` <script src="${jsProdMin.href}"><\/script>\n`, | ||
` <script>mapboxgl.accessToken = "${mapboxgl.accessToken}";<\/script>\n`, | ||
` <link rel="stylesheet" href="${css.href}" />\n`, | ||
' <style>\n', | ||
' body { margin: 0; padding: 0; }\n', | ||
' html, body, #map { height: 100%; }\n', | ||
' </style>\n', | ||
'</head>\n', | ||
'<body>\n', | ||
req.response, | ||
'</body>\n', | ||
'</html>' ], {type: 'text/html'})); | ||
|
||
iframe.src = url; | ||
} | ||
|
||
prevButton.disabled = index === 0; | ||
nextButton.disabled = index + 1 === pages.length; | ||
|
||
location.hash = `page=${page}`; | ||
} | ||
|
||
prevButton.addEventListener('click', () => { | ||
if (index > 0) { | ||
index--; | ||
load(); | ||
} | ||
}); | ||
|
||
nextButton.addEventListener('click', () => { | ||
if (index + 1 <= pages.length) { | ||
index++; | ||
load(); | ||
} | ||
}); | ||
|
||
load(); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Swipe between maps", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/mapbox-gl-compare.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Display driving directions", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/mapbox-gl-directions.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Show drawn polygon area", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/mapbox-gl-draw.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Add a geocoder", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/mapbox-gl-geocoder.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Add support for right-to-left scripts", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/mapbox-gl-rtl-text.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Display a popup on click", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/popup-on-click.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Get features under the mouse pointer", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/queryrenderedfeatures.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Display a satellite map", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/satellite-map.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Fly to a location based on scroll position", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/scroll-fly-to.html" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"title": "Add a video", | ||
"url": "https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/video-on-a-map.html" | ||
} |