ol-ext/examples/misc/map.interaction.tinkerbell.html
2022-08-22 14:13:10 +02:00

70 lines
2.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>ol-ext: Tinkerbell interaction</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Add some magic to yours ol3 maps" />
<meta name="keywords" content="ol3, interaction, Tinker Bell, sparkle, cursor" />
<!-- jQuery -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<!-- Openlayers -->
<link rel="stylesheet" href="https://openlayers.org/en/v6.15.1/css/ol.css" />
<script type="text/javascript" src="https://openlayers.org/en/v6.15.1/build/ol.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL,Object.assign"></script>
<!-- ol-ext -->
<link rel="stylesheet" href="../../dist/ol-ext.css" />
<script type="text/javascript" src="../../dist/ol-ext.js"></script>
<!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer -->
<script src="https://unpkg.com/elm-pep"></script>
<link rel="stylesheet" href="../style.css" />
</head>
<body>
<a href="https://github.com/Viglino/ol-ext" class="icss-github-corner"><i></i></a>
<a href="../../index.html">
<h1>ol-ext: Tinkerbell interaction</h1>
</a>
<div class="info">
<i>ol.interaction.TinkerBell</i> adds a Tinker Bell trail effect on the cursor.
</div>
<!-- the map -->
<div id="map" style="width:600px; height:400px;"></div>
<div class="options">
color:
<select onchange="tb.set('color', this.value);">
<option value="#fff">white</option>
<option value="red">red</option>
<option value="yellow">yellow</option>
<option value="black">black</option>
</select>
</div>
<script type="text/javascript">
// The map
var map=new ol.Map
({ target: 'map',
view: new ol.View
({ zoom: 3,
center: [270148, 6247782]
}),
layers: [ new ol.layer.Tile({ source: new ol.source.Stamen({ layer: 'watercolor' }) }) ]
});
// interaction
var tb = new ol.interaction.TinkerBell();
map.addInteraction(tb);
//map.addInteraction(new ol.interaction.Draw ({ type: 'LineString' }));
</script>
</body>
</html>