1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-08 15:10:02 +00:00

Merge branch 'master' into multi-wiki-support

This commit is contained in:
Jeremy Ruston 2024-05-31 13:32:53 +01:00
commit 3c36e4bd55
147 changed files with 22520 additions and 39 deletions

View File

@ -393,6 +393,17 @@ node $TW5_BUILD_TIDDLYWIKI \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/highlight/empty.html text/plain \
|| exit 1
# /plugins/tiddlywiki/geospatial/index.html Demo wiki with geospatial plugin
# /plugins/tiddlywiki/geospatial/empty.html Empty wiki with geospatial plugin
node $TW5_BUILD_TIDDLYWIKI \
./editions/geospatialdemo \
--verbose \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all plugins/tiddlywiki/geospatial/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/geospatial/empty.html text/plain \
|| exit 1
######################################################
#
# Language editions

View File

@ -1,3 +1,6 @@
title: $:/boot/boot.css
type: text/css
/*
Basic styles used before we boot up the parsing engine
*/

View File

@ -25,11 +25,8 @@
}
},
{
"file": "boot.css",
"fields": {
"title": "$:/boot/boot.css",
"type": "text/css"
}
"file": "boot.css.tid",
"isTiddlerFile": true
}
]
}

View File

@ -39,6 +39,7 @@ exports.startup = function() {
method: params.method,
body: params.body,
binary: params.binary,
useDefaultHeaders: params.useDefaultHeaders,
oncompletion: params.oncompletion,
onprogress: params.onprogress,
bindStatus: params["bind-status"],
@ -69,8 +70,8 @@ exports.startup = function() {
// Install the copy-to-clipboard mechanism
$tw.rootWidget.addEventListener("tm-copy-to-clipboard",function(event) {
$tw.utils.copyToClipboard(event.param,{
successNotification: event.paramObject.successNotification,
failureNotification: event.paramObject.failureNotification
successNotification: event.paramObject && event.paramObject.successNotification,
failureNotification: event.paramObject && event.paramObject.failureNotification
});
});
// Install the tm-focus-selector message

View File

@ -112,6 +112,7 @@ function HttpClientRequest(options) {
this.method = options.method || "GET";
this.body = options.body || "";
this.binary = options.binary || "";
this.useDefaultHeaders = options.useDefaultHeaders !== "false" ? true : false,
this.variables = options.variables;
var url = options.url;
$tw.utils.each(options.queryStrings,function(value,name) {
@ -156,6 +157,7 @@ HttpClientRequest.prototype.send = function(callback) {
this.xhr = $tw.utils.httpRequest({
url: this.url,
type: this.method,
useDefaultHeaders: this.useDefaultHeaders,
headers: this.requestHeaders,
data: this.body,
returnProp: this.binary === "" ? "responseText" : "response",
@ -231,7 +233,8 @@ Make an HTTP request. Options are:
exports.httpRequest = function(options) {
var type = options.type || "GET",
url = options.url,
headers = options.headers || {accept: "application/json"},
useDefaultHeaders = options.useDefaultHeaders !== false ? true : false,
headers = options.headers || (useDefaultHeaders ? {accept: "application/json"} : {}),
hasHeader = function(targetHeader) {
targetHeader = targetHeader.toLowerCase();
var result = false;
@ -307,10 +310,10 @@ exports.httpRequest = function(options) {
request.setRequestHeader(headerTitle,header);
});
}
if(data && !hasHeader("Content-Type")) {
if(data && !hasHeader("Content-Type") && useDefaultHeaders) {
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
}
if(!hasHeader("X-Requested-With") && !isSimpleRequest(type,headers)) {
if(!hasHeader("X-Requested-With") && !isSimpleRequest(type,headers) && useDefaultHeaders) {
request.setRequestHeader("X-Requested-With","TiddlyWiki");
}
// Send data

View File

@ -31,34 +31,49 @@ DataWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
var jsonPayload = JSON.stringify(this.readDataTiddlerValues(),null,4);
var textNode = this.document.createTextNode(jsonPayload);
parent.insertBefore(textNode,nextSibling);
this.domNodes.push(textNode);
this.dataPayload = this.computeDataTiddlerValues(); // Array of $tw.Tiddler objects
this.domNode = this.document.createTextNode(this.readDataTiddlerValuesAsJson());
parent.insertBefore(this.domNode,nextSibling);
this.domNodes.push(this.domNode);
};
/*
Compute the internal state of the widget
*/
DataWidget.prototype.execute = function() {
// Construct the child widgets
this.makeChildWidgets();
// Nothing to do here
};
/*
Read the tiddler value(s) from a data widget must be called after the .render() method
Read the tiddler value(s) from a data widget as an array of tiddler field objects (not $tw.Tiddler objects)
*/
DataWidget.prototype.readDataTiddlerValues = function() {
var results = [];
$tw.utils.each(this.dataPayload,function(tiddler,index) {
results.push(tiddler.getFieldStrings());
});
return results;
};
/*
Read the tiddler value(s) from a data widget as an array of tiddler field objects (not $tw.Tiddler objects)
*/
DataWidget.prototype.readDataTiddlerValuesAsJson = function() {
return JSON.stringify(this.readDataTiddlerValues(),null,4);
};
/*
Compute list of tiddlers from a data widget
*/
DataWidget.prototype.computeDataTiddlerValues = function() {
var self = this;
// Start with a blank object
var item = Object.create(null);
// Read any attributes not prefixed with $
var item = Object.create(null);
$tw.utils.each(this.attributes,function(value,name) {
if(name.charAt(0) !== "$") {
item[name] = value;
}
});
item = new $tw.Tiddler(item);
// Deal with $tiddler, $filter or $compound-tiddler attributes
var tiddlers = [],title;
if(this.hasAttribute("$tiddler")) {
@ -86,21 +101,22 @@ DataWidget.prototype.readDataTiddlerValues = function() {
tiddlers.push.apply(tiddlers,this.extractCompoundTiddler(title));
}
}
// Convert the literal item to field strings
item = item.getFieldStrings();
if(tiddlers.length === 0) {
// Return the literal item if none of the special attributes were used
if(!this.hasAttribute("$tiddler") && !this.hasAttribute("$filter") && !this.hasAttribute("$compound-tiddler")) {
if(Object.keys(item).length > 0 && !!item.title) {
return [item];
return [new $tw.Tiddler(item)];
} else {
return [];
}
} else {
var results = [];
// Apply the item fields to each of the tiddlers
delete item.title; // Do not overwrite the title
if(Object.keys(item).length > 0) {
$tw.utils.each(tiddlers,function(tiddler,index) {
var fields = tiddler.getFieldStrings();
results.push($tw.utils.extend({},fields,item));
tiddlers[index] = new $tw.Tiddler(tiddler,item);
});
return results;
}
return tiddlers;
}
};
@ -134,12 +150,33 @@ DataWidget.prototype.extractCompoundTiddler = function(title) {
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
DataWidget.prototype.refresh = function(changedTiddlers) {
// It would be expensive to calculate whether the changedTiddlers impact the filter
// identified by the $filter attribute so we just refresh ourselves unconditionally
this.refreshSelf();
var changedAttributes = this.computeAttributes();
var newPayload = this.computeDataTiddlerValues();
if(hasPayloadChanged(this.dataPayload,newPayload)) {
this.dataPayload = newPayload;
this.domNode.textContent = this.readDataTiddlerValuesAsJson();
return true;
} else {
return false;
}
};
/*
Compare two arrays of tiddlers and return true if they are different
*/
function hasPayloadChanged(a,b) {
if(a.length === b.length) {
for(var t=0; t<a.length; t++) {
if(!(a[t].isEqual(b[t]))) {
return true;
}
}
return false;
} else {
return true;
}
}
exports.data = DataWidget;
})();

View File

@ -0,0 +1,4 @@
title: $:/DefaultTiddlers
HelloThere
$:/plugins/tiddlywiki/geospatial

View File

@ -0,0 +1,14 @@
title: GeoFeatures
tags: $:/tags/GeospatialDemo
This is a list of all the tiddlers containing ~GeoJSON feature collections in this wiki (identified by the tag <<tag "$:/tags/GeoFeature">>). A ~GeoJSON feature collection is a list of features, each of which consists of a geometry and associated metadata.
<ul>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoFeature]sort[caption]]">
<li>
<$link>
<$transclude field="caption"><$view field="title"/></$view>
</$link>
</li>
</$list>
</ul>

View File

@ -0,0 +1,27 @@
title: Flickr Demo
caption: Flickr
tags: $:/tags/GeospatialDemo
! Retrieve Geotagged Flickr Photos
This demo will not work until you have set a Flickr API key in the [[Geospatial plugin settings|$:/plugins/tiddlywiki/geospatial/settings]].
<$button>
<$macrocall $name="flickr-get-album-items" albumID={{$:/config/flickr-param/album-id}}/>
Get Flickr album
</$button> <$edit-text tiddler="$:/config/flickr-param/album-id" tag="input"/> (parameter should be an album ID, e.g. 72157630297432522)
<$button>
<$macrocall $name="flickr-get-interesting-items"/>
Get Flickr interesting items
</$button>
<$button>
<$macrocall $name="flickr-get-photos-of-user-items" userID={{$:/config/flickr-param/user-id}}/>
Get Flickr photos of user
</$button> <$edit-text tiddler="$:/config/flickr-param/user-id" tag="input"/> (parameter should be a user ID, e.g. 35468148136@N01)
<$button>
<$macrocall $name="flickr-get-group-items" groupID={{$:/config/flickr-param/group-id}}/>
Get Flickr group
</$button> <$edit-text tiddler="$:/config/flickr-param/group-id" tag="input"/> (parameter should be an group ID, e.g. 22075379@N00)

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 KiB

View File

@ -0,0 +1,2 @@
title: Geospatial Plugin Logo
type: image/png

View File

@ -0,0 +1,37 @@
title: HelloThere
//The latest build of the Geospatial Plugin can be found at:// https://tiddlywiki5-git-geospatial-plugin-jermolene.vercel.app/plugins/tiddlywiki/geospatial/index.html
!! Introduction
{{$:/plugins/tiddlywiki/geospatial/readme}}
!! Prerequisites
This demo requires that the API keys needed to access external services be obtained by the end user and manually configured. These keys are stored in the browser and so only need to be set up once. See the ''Settings'' tab of [[the plugin|$:/plugins/tiddlywiki/geospatial]] for details.
!! Demos
* Visit the ~GeoFeatures and ~GeoMarkers tabs to see the data loaded into this wiki
* Click on a link to a layer or marker to open the corresponding tiddler that includes a map
* Use the Flickr tab to retrieve geotagged photographs from Flickr
* Visit a ~GeoMarker tiddler and use the "Call ~TravelTime" button to calculate an isochrone from that location using the ~TravelTime API
! Map Showing All Features and Markers
<$geomap
state=<<qualify "$:/state/demo-map">>
startPosition="bounds"
>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoBaseLayer]]">
<$geobaselayer title=<<currentTiddler>>/>
</$list>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoMarker]]">
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}} name={{!!caption}}/>
</$list>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoFeature]]">
<$geolayer json={{!!text}} color={{!!color}} name={{!!caption}}/>
</$list>
</$geomap>
<<tabs tabsList:"[all[tiddlers+shadows]tag[$:/tags/GeospatialDemo]]" default:"GeoMarkers">>

View File

@ -0,0 +1,53 @@
title: GeoMarkers
tags: $:/tags/GeospatialDemo
\procedure onsuccess()
<$action-setfield
$tiddler="CurrentLocation"
tags="$:/tags/GeoMarker"
timestamp=<<timestamp>>
lat=<<latitude>>
long=<<longitude>>
alt=<<altitude>>
accuracy=<<accuracy>>
altitudeAccuracy=<<altitudeAccuracy>>
heading=<<heading>>
speed=<<speed>>
/>
\end
\procedure onerror()
<$action-setfield
$tiddler="CurrentLocation"
$field="text"
$value=<<error>>
/>
\end
\procedure onclick()
<$action-sendmessage
$message="tm-request-geolocation"
actionsSuccess=<<onsuccess>>
actionsError=<<onerror>>
/>
\end
This is a list of all the tiddlers containing ~GeoJSON markers in this wiki (identified by the tag <<tag "$:/tags/GeoMarker">>). A ~GeoJSON marker identifies a location via latitude and longitude (and optional altitude) and may also contain associated metadata in JSON format.
Click this button to create a marker from the current location. Your browser will ask for permission before granting the request. On some browsers it takes a couple of seconds for the location to appear.
<$button actions=<<onclick>>>
Request location
</$button>
{{CurrentLocation}}
<ul>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoMarker]sort[caption]]">
<li>
<$link>
<$view field="caption"><$view field="title"/></$view>
</$link>
</li>
</$list>
</ul>

View File

@ -0,0 +1,3 @@
title: $:/SiteSubtitle
Geographic Data Features for ~TiddlyWiki

View File

@ -0,0 +1,3 @@
title: $:/SiteTitle
[img width=200 [Geospatial Plugin Logo]]<br>Geospatial Plugin

View File

@ -0,0 +1,6 @@
title: $:/plugins/geospatial/demo/ViewTemplateBodyFilters
tags: $:/tags/ViewTemplateBodyFilter
list-before: $:/config/ViewTemplateBodyFilters/stylesheet
[tag[$:/tags/GeoFeature]then[ui/geofeature]]
[tag[$:/tags/GeoMarker]then[ui/geomarker]]

View File

@ -0,0 +1,9 @@
title: cities/LimehouseTownHall
tags: $:/tags/GeoMarker
caption: Limehouse Town Hall
lat: 51.51216651476898
long: -0.03138562132137639
alt: 0
This is Limehouse Town Hall!

View File

@ -0,0 +1,9 @@
title: cities/Motovun
tags: $:/tags/GeoMarker
icon: Motovun Jack.svg
caption: Motovun
lat: 45.336453407749225
long: 13.828231379455806
alt: 0
This is Motovun!

View File

@ -0,0 +1,8 @@
title: cities/NewYork
tags: $:/tags/GeoMarker
caption: New York
lat: 40.712778
long: -74.006111
alt: 0
This is New York!

View File

@ -0,0 +1,8 @@
title: cities/Oxford
tags: $:/tags/GeoMarker
caption: Oxford
lat: 51.751944
long: -1.257778
alt: 0
This is Oxford!

View File

@ -0,0 +1,8 @@
title: cities/Toronto
tags: $:/tags/GeoMarker
caption: Toronto
lat: 43.651070
long: -79.347015
alt: 0
This is Toronto!

View File

@ -0,0 +1,8 @@
title: cities/Winchester
tags: $:/tags/GeoMarker
caption: Winchester
lat: 51.0632
long: -1.308
alt: 0
This is Winchester!

View File

@ -0,0 +1,5 @@
title: $:/config/flickr-param/
album-id: 72157630297432522
user-id: 35468148136@N01
group-id: 22075379@N00

View File

@ -0,0 +1,4 @@
title: $:/config/plugins/tiddlywiki/xlsx-utils/default-import-spec
type: text/vnd.tiddlywiki
$:/_importspec/RealEstate/

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,2 @@
title: $:/favicon.ico
type: image/png

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
title: $:/geospatialdemo/features/canada-census-subdivision-millesime
caption: Canada Census Subdivisions Millesime
type: application/json
tags: $:/tags/GeoFeature
color: #f8f

View File

@ -0,0 +1,109 @@
title: $:/geospatialdemo/features/denver/bikerental
caption: Denver bike rentals as ~GeoJSON points
tags: $:/tags/GeoFeature
type: application/json
color: blue
{
"type": "FeatureCollection",
"features": [
{
"geometry": {
"type": "Point",
"coordinates": [
-104.9998241,
39.7471494
]
},
"type": "Feature",
"properties": {
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
},
"id": 51
},
{
"geometry": {
"type": "Point",
"coordinates": [
-104.9983545,
39.7502833
]
},
"type": "Feature",
"properties": {
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
},
"id": 52
},
{
"geometry": {
"type": "Point",
"coordinates": [
-104.9963919,
39.7444271
]
},
"type": "Feature",
"properties": {
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
},
"id": 54
},
{
"geometry": {
"type": "Point",
"coordinates": [
-104.9960754,
39.7498956
]
},
"type": "Feature",
"properties": {
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
},
"id": 55
},
{
"geometry": {
"type": "Point",
"coordinates": [
-104.9933717,
39.7477264
]
},
"type": "Feature",
"properties": {
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
},
"id": 57
},
{
"geometry": {
"type": "Point",
"coordinates": [
-104.9913392,
39.7432392
]
},
"type": "Feature",
"properties": {
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
},
"id": 58
},
{
"geometry": {
"type": "Point",
"coordinates": [
-104.9788452,
39.6933755
]
},
"type": "Feature",
"properties": {
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
},
"id": 74
}
]
}

View File

@ -0,0 +1,63 @@
title: $:/geospatialdemo/features/denver/campus
caption: Denver Auraria West Campus as ~GeoJSON multipolygons
tags: $:/tags/GeoFeature
type: application/json
color: purple
{
"type": "Feature",
"properties": {
"popupContent": "This is the Auraria West Campus",
"style": {
"weight": 2,
"color": "#999",
"opacity": 1,
"fillColor": "#B0DE5C",
"fillOpacity": 0.8
}
},
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[-105.00432014465332, 39.74732195489861],
[-105.00715255737305, 39.74620006835170],
[-105.00921249389647, 39.74468219277038],
[-105.01067161560059, 39.74362625960105],
[-105.01195907592773, 39.74290029616054],
[-105.00989913940431, 39.74078835902781],
[-105.00758171081543, 39.74059036160317],
[-105.00346183776855, 39.74059036160317],
[-105.00097274780272, 39.74059036160317],
[-105.00062942504881, 39.74072235994946],
[-105.00020027160645, 39.74191033368865],
[-105.00071525573731, 39.74276830198601],
[-105.00097274780272, 39.74369225589818],
[-105.00097274780272, 39.74461619742136],
[-105.00123023986816, 39.74534214278395],
[-105.00183105468751, 39.74613407445653],
[-105.00432014465332, 39.74732195489861]
],[
[-105.00361204147337, 39.74354376414072],
[-105.00301122665405, 39.74278480127163],
[-105.00221729278564, 39.74316428375108],
[-105.00283956527711, 39.74390674342741],
[-105.00361204147337, 39.74354376414072]
]
],[
[
[-105.00942707061768, 39.73989736613708],
[-105.00942707061768, 39.73910536278566],
[-105.00685214996338, 39.73923736397631],
[-105.00384807586671, 39.73910536278566],
[-105.00174522399902, 39.73903936209552],
[-105.00041484832764, 39.73910536278566],
[-105.00041484832764, 39.73979836621592],
[-105.00535011291504, 39.73986436617916],
[-105.00942707061768, 39.73989736613708]
]
]
]
}
}

View File

@ -0,0 +1,56 @@
title: $:/geospatialdemo/features/denver/freebus
caption: Denver free bus routes as ~GeoJSON linestrings
tags: $:/tags/GeoFeature
type: application/json
color: green
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[-105.00341892242432, 39.75383843460583],
[-105.0008225440979, 39.751891803969535]
]
},
"properties": {
"popupContent": "This is a free bus line that will take you across downtown.",
"underConstruction": false
},
"id": 1
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[-105.0008225440979, 39.751891803969535],
[-104.99820470809937, 39.74979664004068]
]
},
"properties": {
"popupContent": "This is a free bus line that will take you across downtown.",
"underConstruction": true
},
"id": 2
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[-104.99820470809937, 39.74979664004068],
[-104.98689651489258, 39.741052354709055]
]
},
"properties": {
"popupContent": "This is a free bus line that will take you across downtown.",
"underConstruction": false
},
"id": 3
}
]
}

View File

@ -0,0 +1,30 @@
title: $:/geospatialdemo/features/denver/lightrail
caption: Denver light rail stops as ~GeoJSON points
tags: $:/tags/GeoFeature
type: application/json
color: red
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"popupContent": "18th & California Light Rail Stop"
},
"geometry": {
"type": "Point",
"coordinates": [-104.98999178409576, 39.74683938093904]
}
},{
"type": "Feature",
"properties": {
"popupContent": "20th & Welton Light Rail Stop"
},
"geometry": {
"type": "Point",
"coordinates": [-104.98689115047453, 39.747924136466565]
}
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
title: $:/geospatialdemo/features/harvard-volcanoes-of-the-world
caption: Harvard Volcanoes of the World
type: application/json
tags: $:/tags/GeoFeature/Hidden
color: #f88

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
title: $:/geospatialdemo/features/us-states
caption: US State Boundaries
type: application/json
tags: $:/tags/GeoFeature
color: #88f

View File

@ -0,0 +1,99 @@
title: real-estate-demo
caption: Real Estate Demo
tags: $:/tags/GeospatialDemo
\define default-display-filter() [<currentTiddler>get<fieldname>]
\define default-limit() 10
This is a list of all the tiddlers containing ~GeoJSON markers in this wiki (identified by the tag <<tag "$:/tags/GeoMarker">>) viewed as both a map and a table.
<$let
schema={{real-estate-demo/schema}}
>
<div>
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
<$let
config={{{ [<schema>jsonget[columns],<index>,[name]addprefix[$:/config/geospatial/demo/real-estate-demo/columns/]] }}}
>
<div>
<$checkbox tiddler=<<config>> field="visible" checked="yes" unchecked="no" default="yes">
<$text text={{{ [<schema>jsonget[columns],<index>,[caption]] }}}/>
</$checkbox>
</div>
</$let>
</$list>
</div>
<div>
Sorting by
<$select tiddler="$:/config/geospatial/demo/real-estate-demo/sort-field" default="title">
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
<option value={{{ [<schema>jsonget[columns],<index>,[name]] }}}>
<$text text={{{ [<schema>jsonget[columns],<index>,[caption]] }}}/>
</option>
</$list>
</$select>
<$checkbox tiddler="$:/config/geospatial/demo/real-estate-demo/sort-order" field="text" checked="reverse" unchecked="normal" default="normal">
Reverse sort order
</$checkbox>
</div>
<div>
Search: <$edit-text tiddler="$:/config/geospatial/demo/real-estate-demo/search" tag="input"/>
</div>
<div>
Limit: <$edit-text tiddler="$:/config/geospatial/demo/real-estate-demo/limit" tag="input" placeholder=<<default-limit>>/>
</div>
<table>
<thead>
<tr>
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
<$let
config={{{ [<schema>jsonget[columns],<index>,[name]addprefix[$:/config/geospatial/demo/real-estate-demo/columns/]] }}}
>
<$list filter="[<config>get[visible]else[yes]match[yes]]" variable="ignore">
<th>
<$text text={{{ [<schema>jsonget[columns],<index>,[caption]] }}}/>
</th>
</$list>
</$let>
</$list>
</tr>
</thead>
<tbody>
<$let
sortField={{{ [[$:/config/geospatial/demo/real-estate-demo/sort-field]get[text]else[title]] }}}
sortOrder={{{ [[$:/config/geospatial/demo/real-estate-demo/sort-order]get[text]else[normal]] }}}
limit={{{ [[$:/config/geospatial/demo/real-estate-demo/limit]get[text]] :else[<default-limit>] }}}
>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoMarker]search:*{$:/config/geospatial/demo/real-estate-demo/search}nsort<sortField>order<sortOrder>limit<limit>]">
<$let
rowTiddler=<<currentTiddler>>
>
<$setmultiplevariables
$names="[<schema>jsonindexes[variables]sort[]]"
$values="[<schema>jsonindexes[variables]sort[]] :map[<schema>jsonget[variables],<currentTiddler>] :map[subfilter<currentTiddler>]"
>
<tr>
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
<$let
config={{{ [<schema>jsonget[columns],<index>,[name]addprefix[$:/config/geospatial/demo/real-estate-demo/columns/]] }}}
>
<$list filter="[<config>get[visible]else[yes]match[yes]]" variable="ignore">
<td>
<$let
fieldname={{{ [<schema>jsonget[columns],<index>,[name]] }}}
displayFilter={{{ [<schema>jsonget[columns],<index>,[display]] :else[<default-display-filter>] }}}
>
<$text text={{{ [subfilter<displayFilter>] }}}/>
</$let>
</td>
</$list>
</$let>
</$list>
</tr>
</$setmultiplevariables>
</$let>
</$list>
</$let>
</tbody>
</table>
</$let>

View File

@ -0,0 +1,22 @@
{
"columns": [
{"name": "address", "caption": "Address", "type": "string"},
{"name": "broker", "caption": "Broker", "type": "string"},
{"name": "city", "caption": "City", "type": "string"},
{"name": "lat", "caption": "Latitude", "type": "number"},
{"name": "long", "caption": "Longitude", "type": "number"},
{"name": "price", "caption": "Price", "type": "number"},
{"name": "salesagent", "caption": "Sales Agent", "type": "string"},
{"name": "state", "caption": "State", "type": "string"},
{"name": "title", "caption": "Title", "type": "string"},
{"name": "zipcode", "caption": "Zip Code", "type": "string"},
{"name": "census-province", "caption": "Census Province", "type": "string", "display": "[<census-data>jsonget[0],[prov_name_en],[0]]"},
{"name": "census-division", "caption": "Census Division", "type": "string", "display": "[<census-data>jsonget[0],[cd_name_en],[0]]"},
{"name": "census-subdivision", "caption": "Census Subdivision", "type": "string", "display": "[<census-data>jsonget[0],[csd_name_en],[0]]"},
{"name": "nearest-volcano", "caption": "Nearest Volcano", "type": "string", "display": "[{$:/geospatialdemo/features/harvard-volcanoes-of-the-world}geonearestpoint<coords>]"}
],
"variables": {
"coords": "[<rowTiddler>] :map[geopoint{!!long},{!!lat}]",
"census-data": "[<rowTiddler>] :map[geopoint{!!long},{!!lat}geolookup{$:/geospatialdemo/features/canada-census-subdivision-millesime}]"
}
}

View File

@ -0,0 +1,3 @@
title: real-estate-demo/schema
type: application/json

View File

@ -0,0 +1,5 @@
import-spec-role: row
list: $:/_importspec/RealEstate/PropertiesRow/Field/long $:/_importspec/RealEstate/PropertiesRow/Field/lat $:/_importspec/RealEstate/PropertiesRow/Field/price $:/_importspec/RealEstate/PropertiesRow/Field/broker $:/_importspec/RealEstate/PropertiesRow/Field/salesagent $:/_importspec/RealEstate/PropertiesRow/Field/zipcode $:/_importspec/RealEstate/PropertiesRow/Field/state $:/_importspec/RealEstate/PropertiesRow/Field/city $:/_importspec/RealEstate/PropertiesRow/Field/tags $:/_importspec/RealEstate/PropertiesRow/Field/title $:/_importspec/RealEstate/PropertiesRow/Field/address
tags:
title: $:/_importspec/RealEstate/PropertiesRow
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,7 @@
import-field-column: Address
import-field-name: address
import-field-source: column
import-spec-role: field
title: $:/_importspec/RealEstate/PropertiesRow/Field/address
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,7 @@
import-field-column: Broker
import-field-name: broker
import-field-source: column
import-spec-role: field
title: $:/_importspec/RealEstate/PropertiesRow/Field/broker
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,7 @@
import-field-column: City
import-field-name: city
import-field-source: column
import-spec-role: field
title: $:/_importspec/RealEstate/PropertiesRow/Field/city
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,8 @@
import-field-column: Latitude
import-field-name: lat
import-field-type: number
import-field-source: column
import-spec-role: field
title: $:/_importspec/RealEstate/PropertiesRow/Field/lat
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,8 @@
import-field-column: Longitude
import-field-name: long
import-field-type: number
import-field-source: column
import-spec-role: field
title: $:/_importspec/RealEstate/PropertiesRow/Field/long
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,8 @@
import-field-column: Price
import-field-name: price
import-field-type: number
import-field-source: column
import-spec-role: field
title: $:/_importspec/RealEstate/PropertiesRow/Field/price
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,7 @@
import-field-column: Sales Agent
import-field-name: salesagent
import-field-source: column
import-spec-role: field
title: $:/_importspec/RealEstate/PropertiesRow/Field/salesagent
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,7 @@
import-field-column: State
import-field-name: state
import-field-source: column
import-spec-role: field
title: $:/_importspec/RealEstate/PropertiesRow/Field/state
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,7 @@
import-spec-role: field
import-field-name: tags
import-field-type: string
import-field-source: constant
import-field-value: $:/tags/GeoMarker
title: $:/_importspec/RealEstate/PropertiesRow/Field/tags
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,8 @@
import-field-column: Address
import-field-name: title
import-field-source: column
import-spec-role: field
import-field-skip-tiddler-if-blank: yes
title: $:/_importspec/RealEstate/PropertiesRow/Field/title
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,7 @@
import-field-column: Zip Code
import-field-name: zipcode
import-field-source: column
import-spec-role: field
title: $:/_importspec/RealEstate/PropertiesRow/Field/zipcode
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,7 @@
import-sheet-name: Final Day 1 and 2
import-spec-role: sheet
list: [[$:/_importspec/RealEstate/PropertiesRow]]
tags:
title: $:/_importspec/RealEstate/PropertiesSheet
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,7 @@
caption: Real Estate Listing Demo
import-spec-role: workbook
list: [[$:/_importspec/RealEstate/PropertiesSheet]]
tags:
title: $:/_importspec/RealEstate/
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,2 @@
title: $:/themes/tiddlywiki/vanilla/options/sidebarlayout
text: fluid-fixed

View File

@ -0,0 +1,39 @@
title: ui/geofeature
\define create-intersection()
<$let
intersectLayer={{{ =[<currentTiddler>get[text]] =[<otherFeature>get[text]] +[geointersect[]] }}}
>
<$action-createtiddler $basetitle="$:/temp/_IsochroneLayer" text={{{ [<intersectLayer>] }}} tags="$:/tags/GeoFeature" caption={{{ [<captionThisFeature>addsuffix[ intersected with ]addsuffix<captionOtherFeature>] }}}/>
</$let>
\end
!! Mapped
<$geomap
state=<<qualify "$:/state/demo-map">>
startPosition="bounds"
>
<$geolayer json={{!!text}} color={{!!color}}/>
</$geomap>
!! Intersect with other features
<$let
captionThisFeature={{{ [<currentTiddler>get[caption]else<currentTiddler>] }}}
>
<ul>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoFeature]sort[caption]] -[<currentTiddler>]" variable="otherFeature">
<$let
captionOtherFeature={{{ [<otherFeature>get[caption]else<otherFeature>] }}}
>
<li>
<$link to=<<otherFeature>>><$transclude tiddler=<<otherFeature>> field="caption"><$view tiddler=<<otherFeature>> field="title"/></$transclude></$link>
<$button actions=<<create-intersection>>>
Create intersection
</$button>
</li>
</$let>
</$list>
</ul>
</$let>

View File

@ -0,0 +1,128 @@
title: ui/geomarker
\define default-traveltime-time() 5400
\define completion-actions()
<$action-log/>
<$action-setfield $tiddler="$:/temp/_StatusCode" text=<<status>>/>
<$action-setfield $tiddler="$:/temp/_StatusText" text=<<statusText>>/>
<$action-setfield $tiddler="$:/temp/_Error" text=<<error>>/>
<$action-setfield $tiddler="$:/temp/_Result" text=<<data>>/>
<$action-setfield $tiddler="$:/temp/_Headers" text=<<headers>>/>
<$list filter="[<status>compare:number:gteq[200]compare:number:lteq[299]]" variable="ignore">
<$action-createtiddler $basetitle="$:/temp/_IsochroneLayer" text={{{ [<data>] }}} tags="$:/tags/GeoFeature" caption={{{ [<currentTiddler>get[caption]else<currentTiddler>addprefix[Travel time from ]] }}}/>
</$list>
\end
\define progress-actions()
<$action-log message="In progress-actions"/>
<$action-log/>
\end
\define payload-source()
\rules only transcludeinline transcludeblock filteredtranscludeinline filteredtranscludeblock
{
"departure_searches": [
{
"id": "My first isochrone",
"coords": {
"lat": {{!!lat}},
"lng": {{!!long}}
},
"departure_time": "2023-02-27T08:00:00Z",
"travel_time": {{{ [[$:/config/plugins/geospatial/traveltime/time]get[text]else<default-traveltime-time>] }}},
"transportation": {
"type": "driving"
}
}
]
}
\end
\define get-traveltime-actions()
<$wikify name="payload" text=<<payload-source>>>
<$action-log $message="Making payload"/>
<$action-log/>
<$action-sendmessage
$message="tm-http-request"
url="https://api.traveltimeapp.com/v4/time-map"
method="POST"
header-accept="application/geo+json"
header-Content-Type="application/json"
password-header-X-Api-Key="traveltime-secret-key"
password-header-X-Application-Id="traveltime-application-id"
body=<<payload>>
var-currentTiddler=<<currentTiddler>>
bind-status="$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/status"
bind-progress="$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/progress"
oncompletion=<<completion-actions>>
onprogress=<<progress-actions>>
/>
</$wikify>
\end
!! Mapped
<$geomap
state=<<qualify "$:/state/demo-map">>
startPosition="bounds"
>
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}}/>
</$geomap>
!! Distance to other markers
<$let
thisLocation={{{ [geopoint{!!long},{!!lat}] }}}
>
<ul>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoMarker]sort[caption]] -[<currentTiddler>]">
<li>
<$link><$view field="caption"><$view field="title"/></$view></$link>
--
<$let
otherLocation={{{ [geopoint{!!long},{!!lat}] }}}
>
<$text text={{{ [geodistance<thisLocation>,<otherLocation>,[miles]fixed[0]] }}}/> miles
</$let>
</li>
</$list>
</ul>
</$let>
!! GeoFeature Lookups
<$let
thisLocation={{{ [geopoint{!!long},{!!lat}] }}}
>
<ul>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoFeature]sort[caption]]">
<li>
<$text text={{{ [<currentTiddler>get[caption]] :else[<currentTiddler>] }}}/> --
<$text text={{{ [<thisLocation>geolookup{!!text}] }}}/>
</li>
</$list>
</ul>
</$let>
!! Travel Time
<$button actions=<<get-traveltime-actions>>>
Call ~TravelTime
</$button>
Maximum time: <$edit-text tiddler="$:/config/plugins/geospatial/traveltime/time" default=<<default-traveltime-time>> tag="input"/> seconds
|Status |<$text text={{$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/status}}/> |
|Progress |<$text text={{$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/progress}}/> |
|Status Code |<$text text={{$:/temp/_StatusCode}}/> |
|Status Text |<$text text={{$:/temp/_StatusText}}/> |
|Error |<$text text={{$:/temp/_Error}}/> |
<$list filter="[<currentTiddler>has[photo-url]]" variable="ignore">
!! Photo
<img src={{!!photo-url}}/>
</$list>

View File

@ -0,0 +1,23 @@
{
"description": "Demo of the geospatial plugin for TiddlyWiki",
"plugins": [
"tiddlywiki/geospatial",
"tiddlywiki/jszip",
"tiddlywiki/xlsx-utils",
"tiddlywiki/codemirror"
],
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
],
"includeWikis": [
],
"build": {
"index": [
"--render","$:/core/save/all","index.html","text/plain"],
"favicon": [],
"static": [],
"empty": [],
"encrypted": []
}
}

View File

@ -0,0 +1,27 @@
title: Data/ImportCompound
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
description: Importing a compound payload tiddler and adding custom fields
title: Description
text: Importing a compound payload tiddler and adding custom fields
+
title: Output
\whitespace trim
<$testcase template="$:/core/ui/testcases/RawJSONTemplate">
<$data $compound-tiddler="Compound" custom="Alpha"/>
</$testcase>
+
title: Compound
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Payload Tiddler
tags: Alpha Beta Gamma
This is a payload tiddler from a compound tiddler
+
title: ExpectedResult
<p><div><div>[{"title":"Payload Tiddler","tags":"Alpha Beta Gamma","text":"This is a payload tiddler from a compound tiddler","custom":"Alpha"}]</div></div></p>

View File

@ -0,0 +1,28 @@
title: Data/ImportFilter
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
description: Importing a payload filter and adding custom fields
title: Description
text: Importing a payload filter and adding custom fields
+
title: Output
\whitespace trim
<$testcase template="$:/core/ui/testcases/RawJSONTemplate">
<$data $filter="[tag[Definitions]]" custom="Alpha"/>
</$testcase>
+
title: HelloThere
tags: Definitions
This is the tiddler HelloThere
+
title: AnotherDefinition
tags: Definitions
This is the tiddler AnotherDefinition
+
title: ExpectedResult
<p><div><div>[{"title":"AnotherDefinition","tags":"Definitions","text":"This is the tiddler AnotherDefinition","custom":"Alpha"},{"title":"HelloThere","tags":"Definitions","text":"This is the tiddler HelloThere","custom":"Alpha"}]</div></div></p>

View File

@ -0,0 +1,23 @@
title: Data/ImportTiddler
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
description: Importing a payload tiddler and adding custom fields
title: Description
text: Importing a payload tiddler and adding custom fields
+
title: Output
\whitespace trim
<$testcase template="$:/core/ui/testcases/RawJSONTemplate">
<$data $tiddler="HelloThere" custom="Alpha"/>
</$testcase>
+
title: HelloThere
tags: Definitions
This is the tiddler HelloThere
+
title: ExpectedResult
<p><div><div>[{"title":"HelloThere","tags":"Definitions","text":"This is the tiddler HelloThere","custom":"Alpha"}]</div></div></p>

View File

@ -0,0 +1,18 @@
title: Data/Simple
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
description: Standalone data widget to create individual tiddlers
title: Description
text: Standalone data widget to create individual tiddlers
+
title: Output
\whitespace trim
<$testcase template="$:/core/ui/testcases/RawJSONTemplate">
<$data title="Epsilon" text="Theta"/>
</$testcase>
+
title: ExpectedResult
<p><div><div>[{"title":"Epsilon","text":"Theta"}]</div></div></p>

View File

@ -2,7 +2,8 @@
"description": "TiddlyWiki core tests",
"plugins": [
"tiddlywiki/jasmine",
"tiddlywiki/multiwikiserver"
"tiddlywiki/multiwikiserver",
"tiddlywiki/geospatial"
],
"themes": [
"tiddlywiki/vanilla",

View File

@ -19,6 +19,7 @@ The following parameters are used:
|method |HTTP method (eg "GET", "POST") |
|body |String data to be sent with the request |
|binary |<<.from-version "5.3.1">> Set to "yes" to cause the response body to be treated as binary data and returned in base64 format |
|useDefaultHeaders |<<.from-version "5.3.4">> Defaults to true. Set to "false" to prevent default headers from being added. This can be helpful when dealing with apis that restrict header fields. |
|query-* |Query string parameters with string values |
|header-* |Headers with string values |
|password-header-* |Headers with values taken from the password store |

View File

@ -70,7 +70,7 @@ No: 否
OfficialPluginLibrary: ~TiddlyWiki 官方插件程式庫
OfficialPluginLibrary/Hint: 此為在 tiddlywiki.com 的 ~TiddlyWiki 官方插件程式庫。由核心團隊維護的插件、主題和語言包。
PageTemplate/Description: 預設的 ~Tiddlywiki 佈局
PageTemplate/Name: 標佈局
PageTemplate/Name: 標佈局
PluginReloadWarning: 請儲存 {{$:/core/ui/Buttons/save-wiki}} 並刷新頁面 {{$:/core/ui/Buttons/refresh}} ,使 ~JavaScript 插件的更改生效
RecentChanges/DateFormat: YYYY年0MM月0DD日
Shortcuts/Input/Accept/Hint: 接受選取的項目

View File

@ -0,0 +1,2 @@
title: $:/tags/GeoBaseLayer
list: $:/plugins/tiddlywiki/geospatial/baselayers/openstreetmap $:/plugins/tiddlywiki/geospatial/baselayers/esri-world-imagery $:/plugins/tiddlywiki/geospatial/baselayers/opentopomap $:/plugins/tiddlywiki/geospatial/baselayers/stamen-terrain $:/plugins/tiddlywiki/geospatial/baselayers/stamen-watercolor

View File

@ -0,0 +1,7 @@
title: $:/plugins/tiddlywiki/geospatial/baselayers/esri-world-imagery
caption: ESRI World Imagery
tags: $:/tags/GeoBaseLayer
tiles-url: https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}
max-zoom: 18
Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community

View File

@ -0,0 +1,7 @@
title: $:/plugins/tiddlywiki/geospatial/baselayers/openstreetmap
caption: OpenStreetMap
tags: $:/tags/GeoBaseLayer
tiles-url: https://tile.openstreetmap.org/{z}/{x}/{y}.png
max-zoom: 19
&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>

View File

@ -0,0 +1,7 @@
title: $:/plugins/tiddlywiki/geospatial/baselayers/opentopomap
caption: OpenTopoMap
tags: $:/tags/GeoBaseLayer
tiles-url: https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png
max-zoom: 17
Map data: &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)

View File

@ -0,0 +1,3 @@
title: $:/plugins/tiddlywiki/geospatial/docs
<<tabs tabsList:"[all[tiddlers+shadows]tag[$:/tags/GeospatialDocs]]" default:"$:/plugins/tiddlywiki/geospatial/docs/geomap" class:"tc-vertical">>

View File

@ -0,0 +1,141 @@
title: $:/plugins/tiddlywiki/geospatial/docs/flickr-helpers
caption: Flickr helpers
tags: $:/tags/GeospatialDocs
!! Flickr Helpers
!!! Photo Tiddlers
The procedures that retrieve photos from Flickr create a separate tiddler for each retrieved photo. The field values of these photo tiddlers are specified through a photo tiddler template that specifies a filter expression for each field that is to be included.
A [[default photo tiddler template|$:/plugins/tiddlywiki/geospatial/procedures/Flickr/DefaultPhotoTemplate]] is used if one is not specified. The default template makes the following assignments:
|!Field |!Description |
|title |Set to "Flickr Photo " appended with Flickr's ID for the photograph |
|tags |`$:/tags/GeoMarker` and `$:/tags/FlickrPhoto` |
|caption |The title of the photograph |
|lat |The latitude of the image (blank for non-geocoded photographs) |
|long |The longitude of the image (blank for non-geocoded photographs) |
|alt |0 |
|photo-url |The URL of the "large" image size of the photograph (longest side will be a maximum of 1024px) |
|icon-url |The URL of the "small thumbnail" image size of the photograph (cropped to a square of maximum size 75px) |
The photo tiddler template can reference the following variables. See [[Flickr's documentation|https://www.flickr.com/services/api/misc.urls.html]] to learn how these values can be combined to construct URLs to access photographs.
|!Variable |!Description |
|photoData |Raw JSON data returned from Flickr API |
|photoFarm |Flickr photo farm associated with the photograph |
|photoServer | Flickr server associated with the photograph |
|photoID |Flickr photo ID for the photograph |
|photoSecret |The URL secret associated with the photograph |
!!! `flickr-get-photos-of-user-items` procedure
Retrieves photographs of a particular user, identified by their user ID.
|!Parameter |!Description |
|userID |ID of the user of whom to retrieve photos (eg 35468148136@N01) |
|photoTiddlerTemplate |Optional title of tiddler specifying field values for the created photo tiddlers |
For example:
<$testcase>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
<$data title="Description" text="Get photographs of user"/>
<$data title="Output" text="""<$button>
<$transclude $variable="flickr-get-photos-of-user-items" userID="35468148136@N01"/>
Click to get photos of user
</$button>
<$geomap
state=<<qualify "$:/state/demo-map">>
>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/FlickrPhoto]]">
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}}/>
</$list>
</$geomap>
"""/>
</$testcase>
!!! `flickr-get-group-items` procedure
Retrieves photographs from a group, identified by the group ID.
|!Parameter |!Description |
|groupID |ID of the group from which to retrieve photos (eg 22075379@N00) |
|photoTiddlerTemplate |Optional title of tiddler specifying field values for the created photo tiddlers |
For example:
<$testcase>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
<$data title="Description" text="Get photographs from group"/>
<$data title="Output" text="""<$button>
<$transclude $variable="flickr-get-group-items" groupID="22075379@N00"/>
Click to get photos from group
</$button>
<$geomap
state=<<qualify "$:/state/demo-map">>
>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/FlickrPhoto]]">
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}}/>
</$list>
</$geomap>
"""/>
</$testcase>
!!! `flickr-get-album-items` procedure
Retrieves photographs from an album, identified by the album ID.
|!Parameter |!Description |
|albumID |ID of the album from which to retrieve photos (eg 72157630297432522) |
|photoTiddlerTemplate |Optional title of tiddler specifying field values for the created photo tiddlers |
For example:
<$testcase>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
<$data title="Description" text="Get photographs from album"/>
<$data title="Output" text="""<$button>
<$transclude $variable="flickr-get-album-items" albumID="72157630297432522"/>
Click to get photos from album
</$button>
<$geomap
state=<<qualify "$:/state/demo-map">>
>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/FlickrPhoto]]">
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}}/>
</$list>
</$geomap>
"""/>
</$testcase>
!!! `flickr-get-interesting-items` procedure
Retrieves Flickr's current list of the 500 most "interesting" photographs.
|!Parameter |!Description |
|photoTiddlerTemplate |Optional title of tiddler specifying field values for the created photo tiddlers |
For example:
<$testcase>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
<$data title="Description" text="Get interesting photographs"/>
<$data title="Output" text="""<$button>
<$transclude $variable="flickr-get-interesting-items"/>
Click to get interesting photos
</$button>
<$geomap
state=<<qualify "$:/state/demo-map">>
>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/FlickrPhoto]]">
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}}/>
</$list>
</$geomap>
"""/>
</$testcase>

View File

@ -0,0 +1,20 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geobaselayer
caption: geobaselayer widget
tags: $:/tags/GeospatialDocs
!! `<$geobaselayer>` widget
The `<$geobaselayer>` widget is used inside the `<$geomap>` widget to define the base layers to display on the map.
The following attributes are supported:
|!Attribute |!Description |
|''title'' |Optional title of a tiddler that defines the base layer through the fields ''caption'', ''tiles-url'', ''max-zoom'' and ''text'' (the text field defines the attribution string for the base layer) |
|''name'' |Optional name for the base layer |
|''tiles-url'' |Optional templated tile server URL for the base layer |
|''max-zoom'' |Optional maximum zoom level for the base layer |
|''attribution'' |Optional attribution text for the base layer |
The base layer will only work if all four of the required items ''name'', ''tiles-url'', ''max-zoom'' and ''attribution'' must be provided, either through the base layer tiddler specified in the title attribute, or explicitly via their own attributes.
See https://leaflet-extras.github.io/leaflet-providers/preview/ for a collection of compatible base layers.

View File

@ -0,0 +1,20 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geodifference
caption: geodifference operator
tags: $:/tags/GeospatialDocs
!! `geodifference` operator
The `geodifference` operator calculates the difference between two or more [[GeoJSON Polygon Features|GeoJSON Polygon Feature]].
Each input list item is interpreted as a [[GeoJSON Polygon Feature Collection]] containing polygons.
```
[geodifference[]]
```
!! Examples
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/operators/geodifference-interactive"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,14 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geodistance
caption: geodistance operator
tags: $:/tags/GeospatialDocs
!! `geodistance` operator
The `geodistance` operator calculates the distance between two points in [[GeoJSON Point Feature]] format. The points are specified as two operands. An optional third operand specifies the units as `miles`, `kilometers`, `degrees` or `radians` (defaults to `miles`).
!! Examples
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/operators/geodistance"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,20 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geointersect
caption: geointersect operator
tags: $:/tags/GeospatialDocs
!! `geointersect` operator
The `geointersect` operator calculates the intersection between two or more [[GeoJSON Polygon Features|GeoJSON Polygon Feature]].
Each input list item is interpreted as a [[GeoJSON Polygon Feature Collection]] containing polygons.
```
[geointersect[]]
```
!! Examples
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/operators/geointersect-interactive"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,24 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geolayer
caption: geolayer widget
tags: $:/tags/GeospatialDocs
!! `<$geolayer>` widget
The `<$geolayer>` widget is used inside the `<$geomap>` widget to indicate the layers and markers to display.
The following attributes are supported:
|!Attribute |!Description |
|''json'' |Optional GeoJSON Feature Collection to be rendered |
|''name'' |Optional name to be displayed for this layer |
|''color'' |Optional CSS colour for this layer |
|''lat'' |Optional latitude of marker if json attribute missing |
|''long'' |Optional longitude of marker if json attribute missing |
|''alt'' |Optional altitude of marker if json attribute missing |
|''draggable'' |Set to "yes" to make the marker draggable |
|''updateActions'' |Optional actions when the marker is dragged other otherwise modified. The variables ''lat'' and ''long'' contain the new coordinates of the marker |
Note that the `<$geolayer>` widget can be used in one of two modes:
* With the ''json'' attibute specifying the layer to be drawn
* With the ''lat'', ''long'' and optional ''alt'' attributes specifying a marker to be drawn

View File

@ -0,0 +1,92 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geolocation
caption: tm-request-geolocation message
tags: $:/tags/GeospatialDocs
!! `tm-request-geolocation` message
The `tm-request-geolocation` message requests the location of the device on which TiddlyWiki is running. Browsers will request permission from the user before returning the location.
The following parameters are supported:
|!Parameters |!Description |
|''actionsSuccess'' |Action string that is invoked if the request succeeds. See below for the variable values that are made available to the action string |
|''actionsError'' |Action string that is invoked if the request fails. See below for the variable values that are made available to the action string |
|''accuracy'' |Optional value "low" or "high", defaults to "high". Note that higher accuracy can be significantly slower |
|''timeout'' |Optional timeout value in milliseconds after which requests are automatically aborted. Defaults to infinity, meaning that requests do not timeout |
|''maximumAge'' |An optional positive value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. If set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position |
The following variables are made available to the action strings passed in the ''actionsSuccess'' parameter:
|!Name |!Description |
|''timestamp'' |Date and time at which the location was retrieved, in TiddlyWiki YYYYMMDDHHMMSSmmm format |
|''latitude'' |The latitude of the position in decimal degrees |
|''longitude'' |The longitude of the position in decimal degrees |
|''altitude'' |The altitude of the position in meters, relative to sea level. This value can be null if the implementation cannot provide the data |
|''accuracy'' |A number representing the accuracy of the latitude and longitude properties, expressed in meters |
|''altitudeAccuracy'' |A number representing the accuracy of the altitude expressed in meters. This value can be null |
|''heading'' |A number representing the direction towards which the device is facing. This value, specified in degrees, indicates how far off from heading true north the device is. 0 degrees represents true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). If speed is 0, heading is NaN. If the device is unable to provide heading information, this value is null |
|''speed'' |A number representing the velocity of the device in meters per second. This value can be null |
Note that Safari appears to provide obfuscated values for some items for privacy reasons.
The following variables are made available to the action strings passed in the ''actionsError'' parameter:
|!Name |!Description |
|''error'' |Message associated with the error |
!! Examples
<$testcase>
<$data
title="Description"
text="Retrieve current location"
/>
<$data
title="Output"
text="""
\procedure onsuccess()
<$action-setfield
$tiddler="CurrentLocation"
tags="$:/tags/GeoMarker"
timestamp=<<timestamp>>
lat=<<latitude>>
long=<<longitude>>
alt=<<altitude>>
accuracy=<<accuracy>>
altitudeAccuracy=<<altitudeAccuracy>>
heading=<<heading>>
speed=<<speed>>
/>
\end
\procedure onerror()
<$action-setfield
$tiddler="CurrentLocation"
$field="text"
$value=<<error>>
/>
\end
\procedure onclick()
<$action-sendmessage
$message="tm-request-geolocation"
actionsSuccess=<<onsuccess>>
actionsError=<<onerror>>
/>
\end
<$button actions=<<onclick>> style="background: red; color: white; font-size: 18pt;">
Click this button to request current location
</$button>
Your browser will ask for permission before granting the request. On some system it may take a couple of seconds for the location to appear.
<hr>
{{CurrentLocation}}
{{CurrentLocation||$:/core/ui/TiddlerFields}}
<hr>
<$geomap
state=<<qualify "$:/state/demo-map">>
>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoMarker]]">
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}}/>
</$list>
</$geomap>
"""/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,16 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geolookup
caption: geolookup operator
tags: $:/tags/GeospatialDocs
!! `geolookup` operator
The `geolookup` operator identifies the polygon(s) within a [[GeoJSON Polygon Feature]] that correspond to a particular point, and returns the JSON properties of that polygon.
Each input list item is interpreted as a [[GeoJSON Point Feature]] and the operand is interpreted as a [[GeoJSON Polygon Feature Collection]].
!! Examples
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/operators/geolookup"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,122 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geomap
caption: geomap widget
tags: $:/tags/GeospatialDocs
!! `<$geomap>` widget
The `<$geomap>` widget displays an interactive map using [[Leaflet.js|https://leafletjs.com/]]. `<$geolayer>` and `<$geobaselayer>` widgets inside the `<$geomap>` widget are used to indicate the overlay layers and markers to display, and the base map layer to be used.
The following attributes are supported:
|!Attribute |!Description |
|''state'' |The title of a state tiddler used to track the state of the map in the `zoom`, `long` and `lat` fields |
|''startPosition'' |Optional starting position for the map: "world" (the default) shows the entire map, "bounds" zooms to the bounds of the loaded layes |
|''layersPanel'' |Optional starting status for the layers panel: "collapsed" (the default) causes the layers panel to initially be shown collapsed, "open" causes the layers panel to initially be shown opened |
If no base layers are defined by `<$geobaselayer>` widgets within the `<$geomap>` widget then all the available base layers will be loaded by the equivalent of the following code:
```
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoBaseLayer]]">
<$geobaselayer title=<<currentTiddler>>/>
</$list>
```
!! Examples
<$testcase>
<$data
title="Description"
text="Map with state preservation"
/>
<$data
title="Output"
text="""<$geomap
state=<<qualify "$:/state/demo-map">>
/>
"""/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>
<$testcase>
<$data
title="Description"
text="Map with geomarker"
/>
<$data
title="Oxford"
tags="$:/tags/GeoMarker"
caption="Oxford"
lat="51.751944"
long="-1.257778"
alt="0"
text="""This is Oxford!"""/>
<$data title="Output" text="""<$geomap
state=<<qualify "$:/state/demo-map">>
>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoMarker]]">
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}}/>
</$list>
</$geomap>
"""/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>
<$testcase>
<$data
title="Description"
text="Map with geofeature"
/>
<$data
title="Layer"
tags="$:/tags/GeoFeature"
type="application/json"
color="red"
text="""{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "An example geofeature feature",
"properties": {
"custom": "A custom property of this feature"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-90,35],
[-90,30],
[-85,30],
[-85,35],
[-90,35]
]
]
}
}
]
}"""/>
<$data title="Output" text="""<$geomap
state=<<qualify "$:/state/demo-map">>
>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoFeature]]">
<$geolayer json={{!!text}} color={{!!color}}/>
</$list>
</$geomap>
"""/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/widgets/geomap"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/widgets/geomap-refresh"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/widgets/geomap-draggable-marker"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,19 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geonearestpoint
caption: geonearestpoint operator
tags: $:/tags/GeospatialDocs
!! `geonearestpoint` operator
The `geonearestpoint` operator determines the point in a list that is nearest to a target point. Each input list item is interpreted as a [[GeoJSON Feature]] comprising the candidate points. The target point is specified as the first operand in [[GeoJSON Point Feature]] format.
!! Examples
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/operators/geonearestpoint"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/operators/geonearestpoint2"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,22 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geopoint
caption: geopoint operator
tags: $:/tags/GeospatialDocs
!! `geopoint` operator
The `geopoint` operator converts separate latitude, longitude and (optionally) altitude numbers into a [[GeoJSON Point Feature]] that can be used with other geospatial primitives.
The coordinates are specified as two or three operands:
```
[geopoint<latitude>,<longitude>,<attitude>]
```
Any operands that cannot be interpreted as a valid number will be interpreted as the value zero.
!! Examples
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/operators/geopoint"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,20 @@
title: $:/plugins/tiddlywiki/geospatial/docs/geounion
caption: geounion operator
tags: $:/tags/GeospatialDocs
!! `geounion` operator
The `geounion` operator calculates the union between two or more [[GeoJSON Polygon Features|GeoJSON Polygon Feature]].
Each input list item is interpreted as a [[GeoJSON Polygon Feature Collection]] containing polygons.
```
[geounion[]]
```
!! Examples
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/operators/geounion-interactive"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,14 @@
title: $:/plugins/tiddlywiki/geospatial/docs/olc-decode
caption: olc-decode operator
tags: $:/tags/GeospatialDocs
!! `olc-decode` operator
The `olc-decode` operator converts an [[OpenLocationCode|https://github.com/google/open-location-code]] shortcut into the [[GeoJSON Point Feature]] at its centre or the [[GeoJSON Polygon Feature]] representing the bounds of the area identified by the input code.
!! Examples
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/operators/olc-decode"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,14 @@
title: $:/plugins/tiddlywiki/geospatial/docs/olc-encode
caption: olc-encode operator
tags: $:/tags/GeospatialDocs
!! `olc-encode` operator
The `olc-encode` operator converts separate latitude and longitude numbers into an [[OpenLocationCode|https://github.com/google/open-location-code]] shortcut code with a specified length (defaults to 11 characters).
!! Examples
<$testcase>
<$data $compound-tiddler="$:/plugins/tiddlywiki/geospatial/tests/operators/olc-encode"/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -0,0 +1,26 @@
BSD 2-Clause License
Copyright (c) 2010-2024, Volodymyr Agafonkin
Copyright (c) 2010-2011, CloudMade
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,661 @@
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
max-width: none !important;
max-height: none !important;
}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
max-width: none !important;
max-height: none !important;
width: auto;
padding: 0;
}
.leaflet-container img.leaflet-tile {
/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
mix-blend-mode: plus-lighter;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
svg.leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline-offset: 1px;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 12px;
font-size: 0.75rem;
line-height: 1.5;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
font-size: 13px;
font-size: 1.08333em;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.8);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
line-height: 1.4;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
text-decoration: underline;
}
.leaflet-attribution-flag {
display: inline !important;
vertical-align: baseline !important;
width: 1em;
height: 0.6669em;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
white-space: nowrap;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.8);
text-shadow: 1px 1px #fff;
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 24px 13px 20px;
line-height: 1.3;
font-size: 13px;
font-size: 1.08333em;
min-height: 1px;
}
.leaflet-popup-content p {
margin: 17px 0;
margin: 1.3em 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-top: -1px;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
pointer-events: auto;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
border: none;
text-align: center;
width: 24px;
height: 24px;
font: 16px/24px Tahoma, Verdana, sans-serif;
color: #757575;
text-decoration: none;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
color: #585858;
}
.leaflet-popup-scrolled {
overflow: auto;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
-ms-zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-interactive {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}
/* Printing */
@media print {
/* Prevent printers from removing background-images of controls. */
.leaflet-control {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,34 @@
{
"tiddlers": [
{
"file": "leaflet.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/geospatial/leaflet.js",
"module-type": "library"
}
},
{
"file": "leaflet.css",
"fields": {
"type": "text/css",
"title": "$:/plugins/tiddlywiki/geospatial/leaflet.css",
"tags": "[[$:/tags/Stylesheet]]"
}
},
{
"file": "images/layers-2x.png",
"fields": {
"type": "image/png",
"title": "$:/plugins/tiddlywiki/geospatial/leaflet/images/layers-2x.png"
}
},
{
"file": "LICENSE",
"fields": {
"type": "text/plain",
"title": "$:/plugins/tiddlywiki/geospatial/leaflet.js/LICENSE"
}
}
]
}

View File

@ -0,0 +1,20 @@
Copyright 2012 David Leaver
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,60 @@
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}
.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}
.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}
/* IE 6-8 fallback colors */
.leaflet-oldie .marker-cluster-small {
background-color: rgb(181, 226, 140);
}
.leaflet-oldie .marker-cluster-small div {
background-color: rgb(110, 204, 57);
}
.leaflet-oldie .marker-cluster-medium {
background-color: rgb(241, 211, 87);
}
.leaflet-oldie .marker-cluster-medium div {
background-color: rgb(240, 194, 12);
}
.leaflet-oldie .marker-cluster-large {
background-color: rgb(253, 156, 115);
}
.leaflet-oldie .marker-cluster-large div {
background-color: rgb(241, 128, 23);
}
.marker-cluster {
background-clip: padding-box;
border-radius: 20px;
}
.marker-cluster div {
width: 30px;
height: 30px;
margin-left: 5px;
margin-top: 5px;
text-align: center;
border-radius: 15px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.marker-cluster span {
line-height: 30px;
}

View File

@ -0,0 +1,14 @@
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}
.leaflet-cluster-spider-leg {
/* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
-webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
-moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
-o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More