mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-01 02:46:53 +00:00
First commit
This is the beginnings of a new core plugin to add geospatial capabilities, building on the JSON operators that we now have in the core. It uses the libraries leaflet.js for mapping and turf.js for geospatial calculations.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
title: $:/plugins/tiddlywiki/geospatial/tests/geodistance
|
||||
description: geodistance operator
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$let
|
||||
oxford={{{ [geopoint[51.751944],[-1.257778]] }}}
|
||||
new-york={{{ [geopoint[40.730610],[-73.935242]] }}}
|
||||
>
|
||||
|
||||
<$text text={{{ [geodistance<oxford>,<new-york>] }}}/>,
|
||||
<$text text={{{ [geodistance<oxford>,<new-york>,[miles]] }}}/>,
|
||||
<$text text={{{ [geodistance<oxford>,<new-york>,[kilometers]] }}}/>,
|
||||
<$text text={{{ [geodistance<oxford>,<new-york>,[degrees]] }}}/>,
|
||||
<$text text={{{ [geodistance<oxford>,<new-york>,[radians]] }}}/>,
|
||||
<$text text={{{ [geodistance<oxford>,<new-york>,[xxxxxxx]] }}}/>
|
||||
|
||||
</$let>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>5042.67688063485,5042.67688063485,8115.401781788412,72.89828683394038,1.2738016908387275,5042.67688063485</p>
|
||||
15
plugins/tiddlywiki/geospatial/tests/operators/geopoint.tid
Normal file
15
plugins/tiddlywiki/geospatial/tests/operators/geopoint.tid
Normal file
@@ -0,0 +1,15 @@
|
||||
title: $:/plugins/tiddlywiki/geospatial/tests/operators/geopoint
|
||||
description: geopoint operator
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
<$text text={{{ [geopoint[51.751944],[-1.257778]] }}}/>
|
||||
|
||||
<$text text={{{ [geopoint[51.751944],[-1.257778],[2]] }}}/>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[51.751944,-1.257778,0]}}{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[51.751944,-1.257778,2]}}
|
||||
Reference in New Issue
Block a user