Every Locago layer can be described as layer pages and a map view. In the map view, the layer can show an overlay of points, lines and/or polygons.
This tutorial will show you how to create a static layer showing some places in Lund.
In a static layer the content is compiled and placed on the Locago server. If the map data is very seldom changed you should create a static layer, otherwise a dynamic layer.
You can download all the files needed to create the tutorial layer here.
The steps to create this static layer are:
IGEO is a XML-based file format where geographical data can be stored. It is preferable to generate an IGEO file if there is a need to store many places.
Create an IGEO file with this content:
Save the file as tutorial_1.igeo, or download the file from here.
The
<Marker>
tag is used to store a place.
The attributes used are
The IGEO can store more information, such as categories. See Develop the layer further. It is also possible to store other types of geometry. See the documentation.
Up Next >IDOC is also a XML-based file format where both the layer content and how the layer page will look are described.
Create an IDOC file with this content:
Save the file as static_tutorial_1.idoc.
, or download the file from here. Save the icon:
as icon.png
The title and icon specified in the
<idoc>
tag are used to describe the layer to Locago users.
The icon must be in .png, .gif or .jpg format and a good size
is 24x24 pixels.
A layer must have one and only one
<layer>
tag. Information about the layer is presented to a Locago user with tags such as
<info>
and
<tag>
.
A sublayer, such as
<symbolLayer>
, connects the IGEO information to the map overlay. The access to the geographical content is defined with the
attribute dataset. A layer can consists of many sublayers. See the IDOC
documentation to define the layer.
The action attribute of the
<section>
tag makes a call to view the extent of the map data by using the IScript language. See the IScript documentation for more information.
A web server is needed to make the content available to. Place all the files, IGEO, IDOC and any icons, in the same directory.
Make sure the files are available to Locago for example by pointing a web browser to the files.
< Back Up Next >The last step is to publish the page on Locago. To publish a page you need to be signed in. If you do not have an account you need to create one first. It is free.
The layer URL to be given on the publisher page is the path to the IDOC file.
After publishing your layer you can add it to your mobile phone from the head menu in Locago by searching for the
title. You can also view the layer in the Locago's Web demo by clicking the 'View' option on the publisher page.
Note! Your layer may not be visible if you browse the Locago layers by tag. Only the top ten rated
layers in every tag category are visible. This may be changed in Locago in the future.
An easy way to develop the layer further is to add categories to make the layer more interactive with the Locago users.
You can download all the files needed to create the further development of the tutorial layer here. You can also see them here.
Save the file as tutorial_2.igeo, or download the file from here.
The category must be a number between 0 and 31. See the IGEO documentation for more attributes of the geographical data.
Save the file as static_tutorial_2.idoc, or download the file from here. Save the symbol:
as symbol.png
The
<cateogrySymbol>
tag defines a symbol to correspond to a category in the IGEO. In Locago the symbol aliases
i:pinblue, i:pinred, i:pingreen, i:pinyellow, i:pinlime, i:pinpurple
and
i:pinorange
are available. You can also use an URL path to a .png, .gif or .jpg image. This is done for category 4. The path can be
relative. See the IDOC documentation for more information.
The action attribute of the
<section>
tag makes a call using the IScript language. As can be found in the IScript
documentation for the
layer.set
call:
This example hides the sublayer myLayer:
To set the parameter
included
the
doc.fields
from the IScript language is used to get the value of the checkboxes, referenced by id. The action makes three calls to
layer.set
and one two
layer.viewExtent()
to show the extent on top of the map.
< Back
Up