IDOC is an XML based format that describes pages and layers in Locago. It has in many aspects the same role as HTML
and resembles that format in some ways but IDOC is quite simplified and minimalistic. The root element is the
idoc
element. The following is an example of a layer page:
<?
xml version=
"1.0"
encoding=
"UTF-8"?>
<
idoc backgroundColor=
"#FFFFFF" title=
"My
Layer" icon=
"myicon.png">
<
layer dataset=
"mydata.igeo">
<
info>
This is an example layer.
</info>
<tag name="Example"
/>
<symbolLayer name="mydata" symbol="i:yellow"
/>
</layer>
<
style alignX=
"middle"
color=
"#FF6600" fontSize=
"16">
My Layer
</style>
<br />
<br />
<section title="Show"
action="layer.viewExtent()" />
</idoc>
idoc
This is the root element that contains all the other elements. It has a few
attributes that defines properties of the entire page. The order of the subelements is unimportant except that a
layer element must be first if available and that handler elements must come next if available.
Attributes
| Attribute |
Use |
Description |
| title |
optional
|
Title of the document. |
| icon |
optional
|
Icon that is shown in layer listings, and in the carousel in the upper part of Locago interface.
Preferably it should be an SVG image. For historical reasons the icon name should be [some name of your
choice]_24x24.svg to indicate a default size of 24 by 24 pixels. If you don't have an SVG image, a PNG image, 24
by 24 pixels in size, will do. |
| backgroundColor |
optional
|
Color for the background of the page. Use the hexadecimal HTML RGB format. It starts with a # and then
red green and blue with two hex digits each like #ff0000 for a red color and #0000ff for e blue. |
| language |
optional
|
A three digit ISO code for the language of the document. |
Child elements
| Child element |
Cardinality |
Description |
| layer
|
0..1 |
All layer pages must have an element that specifies properties of the layer. |
| handler
|
0..n |
The handlers that should be available in the document goes here. |
| br
|
0..n |
Line break. |
| space
|
0..n |
Space. |
| style
|
0..n |
Style elements changes appearance of their contents. |
| image
|
0..n |
Image. |
| section
|
0..n |
Input fields or buttons. |
br
space
Inserts a space (an empty gap).
style
This element can have one of two purposes. If name is defined a named style is created that can be applied
with the apply attribute in another style element. If name is not defined, the style values are applied to the
contents of the element.
Attributes
| Attribute |
Use |
Description |
| name |
optional
|
Defines a named style that can be referenced later with the apply attribute. |
| apply |
optional
|
Apply a named style. First the style values from the named style is applied, then the values defined in
this element, if any. |
| color |
default:#000000
|
The color for foreground objects like text. Use the hexadecimal HTML RGB format. It starts with a # and
then red green and blue with two hex digits each like #ff0000 for a red color and #0000ff for e blue. |
| fontSize |
optional
|
Size of text in points. This size is mapped to the closest available size on the platform. |
| fontFamily |
default:proportional
|
Name of font to use. The available ones are: proportional, monospace and system. |
| fontStyle |
default:plain
|
Style of font. Available values are plain, bold, italic and underlined. |
| alignX |
optional
|
Alignment in X. Available values are left, middle and right. |
| alignY |
optional
|
Alignment in Y. Available values are top, middle and bottom. |
Child elements
| Child element |
Cardinality |
Description |
| br
|
0..n |
Line break. |
| space
|
0..n |
Space. |
| style
|
0..n |
Style elements changes appearance of their contents. |
| image
|
0..n |
Image. |
| section
|
0..n |
Input fields or buttons. |
image
Mostly the image element is for displaying an image in a page but it can also act
as a button that can be clicked. The action attribute decides if it is clickable or not. Note that the size used for
formatting of the page is the width and height attributes, not the actual image size. It also supports choosing from
predefined alternatives via the options element.
Attributes
| Attribute |
Use |
Description |
| id |
default:
|
The field can be referred to by this id in IScript. |
| action |
optional
|
An IScript action that is executed when the image is clicked. Leave it out to show a regular image that
is not clickable. |
| width |
optional
|
The width of the field in pixels. If this is not specified it gets the value of the contents. |
| height |
optional
|
Height of space used for image in pixels. If not set the maximum height is used. |
| ref |
required
|
Link to the image file. It can be relative or absolute. The supported formats are PNG, JPG and SVG.
Others might work depending on platform but are not recommended. There are a few predefined symbols that can be
used. All these start with "i:". Currently the available ones are: i:pinblue, i:pinred, i:pingreen, i:pinyellow,
i:pinlime, i:pinpurple, i:pinorange. SVG images will be scaled and rasterized to PNG. If SVG images are rendered
too big, add "_wxh" to the filename to set max width and max height - someimage_30x40.svg would have a size limit
of 30 pixels wide and 40 pixels high. |
section
Renders a full-width (possibly interactive) element, such as a button, checkbox or
text field. The element has a title, an optional value or subtitle, and an optional icon.
Attributes
| Attribute |
Use |
Description |
| id |
optional
|
The element can be referred to by this id in IScript. |
| title |
required
|
The title or caption of the element. |
| value |
optional
|
The value or subtitle of the element. If set to "true" or "false" the element is rendered as a check box.
If it's set to any other value it will be rendered as a text field, unless readonly is set to "false", in which
case it will be rendered as a button with a subtitle. If the value attribute is omitted, the element will render
as a button or a combo box without a subtitle. |
| icon |
optional
|
The URL of the icon to use in the section element. SVG is preferred, but PNG will do. The image will be
scaled to fit in the section element. |
| action |
optional
|
An IScript action that is executed when the value is changed or the element is clicked. |
| readonly |
default:false
|
If this is true the value can not be changed. |
Child elements
| Child element |
Cardinality |
Description |
| option
|
0..n |
Add options to render the element as a combo box. |
handler
A handler is a placeholder for a script (in the action attribute). The handlers with certain predefined IDs are
called at special occasions, see below. An argument can be passed to a handler and it is available in the handler as
a variable named
arg. Handlers can also be used as script functions. A handler with id "myHandler" can be
called with
doc.handlers.myHandler.doAction("hepp")
Predefined handlers:
| id |
Description |
| load |
Called when the page is displayed the first time. |
| show |
Called every time the page is displayed. |
Attributes
| Attribute |
Use |
Description |
| id |
required
|
The handler can be referred to by this id in IScript. |
| action |
required
|
An IScript action that is executed when the handler is invoked. |
option
An option defines a predefined value for a field.
Attributes
| Attribute |
Use |
Description |
| value |
required
|
The value of the option. |
| label |
optional
|
Label presented for this option. If not specified the value is used as label. |
layer
This element defines the layer contents of a layer page. By default it visualize a symbol file on igeo-format
specified in the dataset property. For more detailed control it can contain sublayers that defines what data should
be read and how it should be displayed.
<
layer dataset=
"simple.igeo">
<
info>
This is an example layer. It is a good starting point for making new Layers based on
your own data.
</info>
<tag name="Example"
/>
</layer>
Attributes
| Attribute |
Use |
Description |
| dataset |
optional
|
The URL or the IGEO file. Can be relative or absolute. This value is used only if not specified in the
sublayer. |
| webServiceFormat |
default:
|
If the dataset is dynamic and makes a call to the dataset URL at each access specify the format of the
data here. Available formats are igeo, georss and kml. This value is used only if not specified in the sublayer. |
Child elements
| Child element |
Cardinality |
Description |
| info
|
0..1 |
A description of the layer. |
| tag
|
0..n |
Classification for the layer. |
| coverage
|
0..1 |
Information on the area covered by the layer. |
| symbolLayer
|
0..n |
A layer presenting point data. |
| lineLayer
|
0..n |
A layer presenting line data. |
| polygonLayer
|
0..n |
A layer presenting area data. |
symbolLayer
A symbolLayer displays
Marker
objects normally defined in an
IGEO file. The symbol for an object is selected by the following rules in
order:
- If a symbol is specified in the symbol attribute (in the igeo file) that is used.
- If a categorySymbol element is specified that match the object that symbol is used.
- If the symbol property is specified that is used.
- A black dot.
Instead of a symbol url one of the predefined symbols can be used. These are: i:pinblue, i:pinred, i:pingreen,
i:pinyellow, i:pinlime, i:pinpurple, i:pinorange.
Attributes
| Attribute |
Use |
Description |
| name |
optional
|
The name of the sublayer. |
| dataset |
optional
|
The URL or the IGEO file. Can be relative or absolute. If not specified here the value in the enclosing
layer element is used. |
| webServiceFormat |
default:
|
If the dataset is dynamic and makes a call to the dataset URL at each access specify the format of the
data here. Available formats are igeo, georss and kml. If not specified here the value in the enclosing layer
element is used. |
| minScale |
default:0
|
Most zoomed in scale where this layer should be presented. Defined as inverted scale, i.e. 1000 means
scale 1:1000. |
| maxScale |
optional
|
Most zoomed out scale where this layer should be presented. Defined as inverted scale, i.e. 1000 means
scale 1:1000. |
| visible |
default:true
|
Set to false if this layer should not be visible initially. |
| selectable |
default:true
|
Set to false if objects in this layer should not be included in user iterations. |
| symbol |
optional
|
URL to a symbol to use. |
| alignX |
default:middle
|
Symbol alignment in X. Available values are left, middle and right. |
| alignY |
default:bottom
|
Symbol alignment in Y. Available values are top, middle and bottom. |
Child elements
| Child element |
Cardinality |
Description |
| categorySymbol
|
0..n |
A mapping from a category value to a symbol URL. |
lineLayer
A lineLayer displays
MarkerLine
objects normally defined in an IGEO file. The lines have the color and width specified in this element. The
color is dependent on the category attribute when categoryColor elements are specified.
Attributes
| Attribute |
Use |
Description |
| name |
optional
|
The name of the sublayer. |
| dataset |
optional
|
The URL or the IGEO file. Can be relative or absolute. If not specified here the value in the enclosing
layer element is used. |
| webServiceFormat |
default:
|
If the dataset is dynamic and makes a call to the dataset URL at each access specify the format of the
data here. Available formats are igeo, georss and kml. If not specified here the value in the enclosing layer
element is used. |
| minScale |
default:0
|
Most zoomed in scale where this layer should be presented. Defined as inverted scale, i.e. 1000 means
scale 1:1000. |
| maxScale |
optional
|
Most zoomed out scale where this layer should be presented. Defined as inverted scale, i.e. 1000 means
scale 1:1000. |
| visible |
default:true
|
Set to false if this layer should not be visible initially. |
| selectable |
default:true
|
Set to false if objects in this layer should not be included in user iterations. |
| color |
default:#000000
|
The color that the line is drawn with. Use the hexadecimal HTML RGB format. It starts with a # and then
red green and blue with two hex digits each like #ff0000 for a red color and #0000ff for e blue. |
| width |
default:1
|
Line width in pixels. |
Child elements
| Child element |
Cardinality |
Description |
| categoryColor
|
0..n |
A mapping from a category value to a color. |
polygonLayer
A polygonLayer displays
MarkerPolygon
objects normally defined in an IGEO file. The polygons have the color specified in this element. The color
is dependent on the category attribute when categoryColor elements are specified.
Attributes
| Attribute |
Use |
Description |
| name |
optional
|
The name of the sublayer. |
| dataset |
optional
|
The URL or the IGEO file. Can be relative or absolute. If not specified here the value in the enclosing
layer element is used. |
| webServiceFormat |
default:
|
If the dataset is dynamic and makes a call to the dataset URL at each access specify the format of the
data here. Available formats are igeo, georss and kml. If not specified here the value in the enclosing layer
element is used. |
| minScale |
default:0
|
Most zoomed in scale where this layer should be presented. Defined as inverted scale, i.e. 1000 means
scale 1:1000. |
| maxScale |
optional
|
Most zoomed out scale where this layer should be presented. Defined as inverted scale, i.e. 1000 means
scale 1:1000. |
| visible |
default:true
|
Set to false if this layer should not be visible initially. |
| selectable |
default:true
|
Set to false if objects in this layer should not be included in user iterations. |
| color |
default:#000000
|
The color that the area is filled with. Use the hexadecimal HTML RGB format. It starts with a # and then
red green and blue with two hex digits each like #ff0000 for a red color and #0000ff for e blue. |
Child elements
| Child element |
Cardinality |
Description |
| categoryColor
|
0..n |
A mapping from a category value to a color. |
info
Documentation text for the surrounding element.
categorySymbol
A mapping from a category value to a symbol URL.
Attributes
| Attribute |
Use |
Description |
| value |
required
|
When the category attribute of the marker object has this value the specified symbol will be used. |
| symbol |
required
|
URL to a symbol to use. |
categoryColor
A mapping from a category value to a color.
Attributes
| Attribute |
Use |
Description |
| value |
required
|
When the category attribute of the object has this value the specified color will be used. |
| color |
required
|
The color that the line is drawn with. Use the hexadecimal HTML RGB format. It starts with a # and then
red green and blue with two hex digits each like #ff0000 for a red color and #0000ff for e blue. |
tag
Tags for classification of a layer. The currently allowed tags are:
- Car
- Companies
- Eating
- Entertainment
- Example
- Health
- Nature
- News
- Outdoor
- People
- Photo
- Search
- Science
- Service
- Shopping
- SocialCommunity
- Sports
- Tourism
- Transport
- Travel
When using multiple tags, define them in order of importance.
Attributes
| Attribute |
Use |
Description |
| name |
required
|
The tag name. |
coverage
Adds information about the area covered by a layer. It is used when a user searches for layers and the system then
tries to match the users current area with the layers covered areas. The name can also be used for searching layers.
Note that bounds should be specified for layers reading dynamic data. Layers that reads from static data takes the
bounds information from the data so bounds are then ignored. Example:
<coverage name="Gothenburg"
bounds="11.6 57.6 12.2 57.8" />
Attributes
| Attribute |
Use |
Description |
| name |
optional
|
Name of covered area. Use continent, country or region in the language that the idoc is written in. |
| bounds |
optional
|
The coordinates of the rectangle that approximates the covered area at format "<west> <south>
<east> <north>". Only used for layers reading from dynamic datasets. |