Skip to content

YuukiToriyama/Leaflet.Fractal.Julia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet.Fractal.Julia

npm GitHub last commit

Display Julia Set on Leaflet.js

julia set

Abstract

ジュリア集合を表示させることができる Leaflet プラグインです。 ズームイン・アウトをするたびに計算処理が行なわれ、タイルがレンダリングされます。 ジュリア集合の計算には WebAssembly を用いており、高速なレンダリング処理を可能にしています。

Usage

Load from jsDelivr

<script src="https://cdn.jsdelivr.net/npm/leaflet.fractal.julia/dist/bundle.js"></script>

via npm.js

npm install leaflet.fractal.julia

Example

https://yuukitoriyama.github.io/Leaflet.Fractal.Julia/index.html

<html>
	<body>
		<div id="viewer" style="width: 1000px; height: 1000px"></div>
		<script type="module">
			const div = document.getElementById("viewer");
			// L.Mapを作成
			const viewer = L.map(div, {
				center: [0, 0],
				zoom: 0,
				crs: L.CRS.Simple,
			});
			// initメソッドを呼び、Wasmをロード
			await JuliaSetLayer.init();
			// ジュリア集合を定義
			const juliaSetLayer = new JuliaSetLayer({
				re: -0.15,
				im: 0.65,
			});
			// レイヤーとしてL.Mapに追加
			viewer.addLayer(juliaSetLayer);
		</script>
	</body>
</html>

Gallery

$-0.15 + 0.65i$ $0.11131 - 0.6289i$ $-0.4004 - 0.585i$

Related Project

Author

Torichan(@CoconMap)

Packages

 
 
 

Contributors