mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-27 18:40:28 +00:00
3fb2f980c8
* Add onclick attribute to geolayer widget * Temporarily add the plugin to tw5.com for the Netlify preview * Rename onclick to clickActions And add docs for the lat, long, alt variables * No longer apply the default popup template Now that we have customisable popups the default one is pretty useless * Prepare for merging to v5.3.6 The special circumstances are that this PR is confined to a plugin, and that the new work is an extension of the new features already merged in v5.3.6
28 lines
1.7 KiB
Plaintext
28 lines
1.7 KiB
Plaintext
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'', ''long'' and ''alt'' contain the new coordinates of the marker |
|
|
|''clickActions'' |<<.from-version "5.3.6">> Optional actions when the marker is clicked. The variable ''properties'' contains the JSON properties of the marker. The variables ''lat'', ''long'' and ''alt'' contain the coordinates of the marker |
|
|
|''properties'' |<<.from-version "5.3.6">> Optional JSON properties to be attached to the marker (only supported for non-JSON layers) |
|
|
|''popupTemplate'' |<<.from-version "5.3.6">> Optional template to be used for popups. The template is rendered with the variable ''feature'' containing the JSON text of the feature |
|
|
|
|
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'' and ''properties'' attributes specifying a marker to be drawn
|