ol-layerswitcher/examples/two-maps.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

34 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>OpenLayers - LayerSwitcher - Two Maps</title>
<meta
name="viewport"
content="initial-scale=1.0, user-scalable=no, width=device-width"
/>
<link rel="stylesheet" href="https://openlayers.org/en/v6.1.1/css/ol.css" />
<link rel="stylesheet" href="../dist/ol-layerswitcher.css" />
<link rel="stylesheet" href="layerswitcher.css" />
<style>
body {
display: flex;
flex-direction: column;
}
#map1,
#map2 {
height: 100%;
}
</style>
</head>
<body>
<div id="map1"></div>
<div id="map2"></div>
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,Object.assign,Event,URL"></script>
<script src="https://openlayers.org/en/v6.1.1/build/ol.js"></script>
<script src="../dist/ol-layerswitcher.js"></script>
<script src="two-maps.js"></script>
</body>
</html>