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

77 lines
2.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<!--
Copyright (c) 2016-2018 Jean-Marc VIGLINO,
released under CeCILL-B (french BSD like) licence: http://www.cecill.info/
-->
<title>ol-ext: Map ripple</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Add watter ripple effect on OL3 map." />
<meta name="keywords" content="ol3,canvas,animation,ripple,effect,interaction" />
<!-- 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: Map ripple</h1>
</a>
<p class="info">
The ripple interaction add a watter ripple effect on a map.
<br />
Original code (Java) by <a href="http://www.neilwallis.com/java/water.html">Neil Wallis</a>
<br />
! Animation may cause performance issue !
</p>
<!-- DIV pour la carte -->
<div id="map" style="width:600px; height:400px;"></div>
<div class="options">
<h2>Options:</h2>
<p>
<i>Move around the map to add ripples!</i>
</p>
</div>
<script type="text/javascript">
// Layers
var layer = new ol.layer.Tile({
title:'terrain-background',
source: new ol.source.Stamen({ layer: 'terrain' })
});
// The map
var map = new ol.Map({
target: 'map',
view: new ol.View ({
zoom: 5,
center: [166326, 5992663]
}),
layers: [layer]
});
var ripple = new ol.interaction.Ripple({ layer: layer });
map.addInteraction(ripple);
</script>
</body>
</html>