ol-layerswitcher/test/index.html
Matt Walker 9a2c6e6c46 Prevent base radio buttons in one map affecting another
Remove name attribute from base radio buttons, add tests and example for
manual testing. Addresses #474.

Giving each base layer radio button a name attribute of "base" causes an
issue when more than one map with a layer switcher control is shown on a
page; selecting a base layer causes all other radio buttons with the
same name to be unchecked. As we're not relying on the default radio
group behaviour due to the panel being re-rendered when a layer's
visibility changes this commit omits the name attribute.
2021-08-24 14:32:33 +01:00

66 lines
2.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>ol-layerswitcher spec runner</title>
<meta charset="utf-8" />
<link
rel="stylesheet"
type="text/css"
href="../node_modules/mocha/mocha.css"
/>
<link rel="stylesheet" href="https://openlayers.org/en/v6.1.1/css/ol.css" />
<link rel="stylesheet" type="text/css" href="../dist/ol-layerswitcher.css" />
<style type="text/css">
/* Can be useful when writing tests, uncomment the following CSS to always show
the panel and add a `debugger` statement where you want to inspect the current state */
/*
.layer-switcher .panel {
display: block;
}
#map1, #map2 {
height: 600px;
}
*/
</style>
</head>
<body>
<div id="mocha"></div>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Array.prototype.includes,Element.prototype.classList,Object.assign,Event,URL"></script>
<script
type="text/javascript"
src="../node_modules/jquery/dist/jquery.js"
></script>
<script
type="text/javascript"
src="../node_modules/expect.js/index.js"
></script>
<script
type="text/javascript"
src="../node_modules/mocha/mocha.js"
></script>
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"
></script>
<script src="https://cdn.jsdelivr.net/npm/difflib@0.2.4/dist/difflib-browser.min.js"></script>
<script>
mocha.setup({
ui: 'bdd',
bail: false
});
</script>
<script src="https://openlayers.org/en/v6.1.1/build/ol.js"></script>
<script type="text/javascript" src="../dist/ol-layerswitcher.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="spec/ol-layerswitcher.js"></script>
<script type="text/javascript" src="spec/twomaps.js"></script>
<script type="text/javascript" src="spec/renderpanel.js"></script>
<script type="text/javascript" src="spec/groupselectstyle.js"></script>
<script type="text/javascript" src="spec/startactive.js"></script>
<script type="text/javascript" src="spec/activationmode.js"></script>
<script>
mocha.run();
</script>
</body>
</html>