Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

GISGetFeaturesByLayer

Get the list of features for a layer. This should probably only be used with the default app layer.

Input

layerrefnumberThe ID of a layer, usually -1 for 'default app layer'
modcodestringOnly get features from this module (eg. “todo” for tasks)
sysrefnumberOnly get features for this object (used together with modcode), eg. the ID of a task
datatypestringOnly get this type of features, usually not set

Output

featurescollection[ feature ]A collection of features.

If layerref is set to -1 then modcode+sysref should be set.

GISGetCustomBaseLayers

Get the list of base layers (background maps and WMS layers).

Input

changedatedateOnly get baselayers that were changed after this date
changetimetimeOnly get baselayers that were changed after this time

Output

layerscollection[ baselayer ]A collection of baselayers

GISCreateUpdateFeatures

Create or update features in a GIS layer.

Input

featurescollection[ feature ]A collection of features to create/update

Output

None--

Notice that when reading the features (using e.g. GISGetFeaturesByLayer) the returned features do not include details about the layer ID, but when writing the features (using e.g. GISCreateUpdateFeatures) each feature should include the layer ID in the layerref field. If you specify the layer with ID = -1 the default app layer will be used; if the default app layer doesn't exist it will be created.

Map features

See the feature object for more details about the feature object.

Feature types: 1=point, 2=points, 3=text, 11=line, 12=polyline, 21=rectangle, 22=shape, 23=circle, 100=group.

Feature type 1 - point/marker

The data field is a set containing the following name/value pairs:

namevalue typedescription
xfloatlongitude
yfloatlatitude
markerstringname of the marker to use, may be ignored
textstringText to display

The point/marker

...

will be displayed with a suitable icon/marker and the text from the text field in the feature.

Feature type 12 - polyline/freehand

The data field is a set containing the following name/value pairs:

namevalue typedescription
pointscollection[xy]a collection of sets, each containing x and y
subtypestringeither “freehand” or “polyline”

A polyline or freehand line is a set of points that is displayed connected by a line.

In the app the polyline is created by clicking on the screen once for each point. A freehand line is created by dragging - the app then adds a point a regular intervals.

colour1 is used for the colour of the circle. size is used for the linewidth (in pixels) of the circle.

Feature type 22 - shape

The data field is a set containing the following name/value pairs:

namevalue typedescription
pointscollection[xy]a collection of sets, each containing x and y

colour1 is used for the line colour of the shape. colour2 is used for the fill colour. size is used for the linewidth (in pixels) of the shape.

JSON encoded example:

Code Block
languagejs
{"layerref":83,
 "datatype":22,
 "data":{"points":[{"x":27,"y":55},{"x":27.5,"y":55},{"x":27,"y":55.5}]},
 "colour1":"#ff00ff",
 "size":2}

Feature type 23 - circle

The data field is a set containing the following name/value pairs:

namevalue typedescription
xfloatlongitude
yfloatlatitude
rfloatradius in degrees, eg. x=55 and r=1 means that the circle covers from x=54 to x=56.

colour1 is used for the colour of the circle. size is used for the linewidth (in pixels) of the circle.


Table of Contents
maxLevel3