-
-
Notifications
You must be signed in to change notification settings - Fork 129
Plugins
Plugins add features to Trail Sense without requiring Trail Sense to be modified. Plugins also allow access to permissions that are not allowed in the base Trail Sense APK, such as Internet.
NOTE: Plugins are not currently available
TODO: Details on how to tell Trail Sense about these.
TODO: Preferences.
The body of the plugin response must be valid GeoJSON (https://geojson.org/). All geometry types are supported.
Trail Sense will request a region to be loaded. There will be a way to specify that your source does not vary meaning Trail Sense will only call it once (ex. plugin returns GeoJSON for the whole world). Trail Sense snaps the region to tiles, but will request the entire region when it changes, not just the changed area; you may need to cache.
Trail Sense supports the following properties (additional properties can be sent, but are ignored):
-
name(string, defaultnull): The name of the feature. Depending on user settings this may be displayed on the map or when selected. -
lineStyle(string, default"solid"): The style of the line. Valid values are:soliddottedarrowdashedsquarediamondcross
-
color(number, default transparent): The Android compatible ARGB color int of the fill/LineString. -
strokeColor(string, default null): The Android compatible ARGB color int of the stroke. Does not apply to LineStrings. -
strokeWeight(number, default0.5for Points,2.25for LineStrings,0for Polygons): The stroke weight in dp. -
size(number, default12): The size of the marker in the units ofsizeUnit. Only applies to Points. -
sizeUnit(string, default"dp"): The size unit of the marker. Only applies to Points. Valid values are:-
px: Pixels -
dp: Density pixels -
m: Meters
-
-
icon(number, default null): The ID of the icon to use. Only applies to Points. A full list of icons can be found here. This may be transitioned over to strings before the official plugin support is released. -
iconSize(number, defaultsize): The size of the icon in dp. Only applies to Points. -
iconColor(number, default black): The Android compatible ARGB color int of the icon. Only applies to Points. -
markerShape(string, default"circle"ificonis not provided, else"none"): The shape of the marker. Valid values are:circle-
none: Only the icon is rendered
-
isClickable(boolean, defaultfalse): A boolean that indicates if the feature should be clickable. -
opacity(number, default255): The opacity of the feature (between 0 and 255).
Other properties in the future may include description and coordinateProperties (properties of coordinates in a LineString/Polygon).