Frequently Asked Questions - Technical

Set up a WMS server and use the WMS layer model. Any WMS server that supports the raster types you want to process can be used. See http://www.geomajas.org/application-configuration for an example of a wms layer factory. After configuring the factory you can add the layer xml, for example :

<layer xmlns="http://geomajas.org/schemas/configuration/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="wms"
    xsi:type="rasterLayerInfo">
    <label>WMS</label>
    <visible>true</visible>
    <layerType>1</layerType>
    <crs>EPSG:31370</crs>
    <viewScale>
        <min>0</min>
        <max>50</max>
    </viewScale>
    <maxExtent>
        <minX>21900</minX>
        <maxX>258950</maxX>
        <minY>153100</minY>
        <maxY>244130</maxY>
    </maxExtent>
    <maxTileLevel>16</maxTileLevel>
    <rasterLayerFactoryRef>someWMS</rasterLayerFactoryRef>
    <layerName>someLayer</layerName>
    <tileWidth>256</tileWidth>
    <tileHeight>256</tileHeight>
    <style>1</style>
</layer>

Those filters are expressed using the CQL syntax. It is the same as the formulas in the style definitions.
For example, in the online search and filter demo, there is a layer of African countries. A filter, allowing only opec and unesco countries would look like this:
((OPEC == 1) AND (UNESCO == 1))
In this layer, there are defined attributes with the names "OPEC" and "UNESCO" (case-sensitive!), and both attributes are integers.
An example of a filter on a string attribute would look like this: (NAME LIKE '%dunno%')





You would have to register a MouseListener to the DOM node of the map's graphics context, which is accessible through map.getGraphics.getNode(). The map itself can be obtained using e.g. dijit.byId("mainMap"). The way the map widget works is that there is a single controller responsible for processing mouse events. This controller is set via the setController() function and will change whenever the user selects a different tool in the toolbar. Therefore, it probably makes more sense to not use the setController() function but instead add a separate "background" listener to monitor the current position.

The code would be as follows:

var map = dijit.byId("mainMap");
var node = map.getGraphics.getNode();
var subject = new MouseListenerSubject (node, 30); // 30 is the minimal time in millis between mouse move events
subject.addListener();

 

This should be fixed in 1.4.1 and higher versions of Geomajas. I have probably the same problem on Ubuntu 8.10 tomcat5.5. But what is worse I can not sometimes reload the application from tomcat manager -> hard to develop.

The catalina.out reports this:
Oct 4, 2009 10:12:36 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat5.5/webapps/majas-tutorial/WEB-INF/lib/servlet-api-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Oct 4, 2009 10:12:37 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Oct 4, 2009 10:12:37 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/majas-tutorial] startup failed due to previous errors
Using Geomajas 1.4.1 should have the servlet-api problem fixed.








This should be fixed in 1.4.1 and higher versions of Geomajas. The catalina.out reports this:
INFO: validateJarFile(/usr/local/tomcat/webapps/majas-tutorial-1.4.0/WEB-INF/lib/servlet-api-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

It is a warning, not an error. Your application will run fine as it is. In the next version the jar will be removed.

See also the following issue:
http://jira.geomajas.org/jira/browse/MAJ-369

Here is an example of a Google layer configuration (layer ID: "google"):

<?xml version="1.0" encoding="UTF-8"?>
<layer xmlns="http://geomajas.org/schemas/configuration/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="google" xsi:type="rasterLayerInfo">
<label>Google normal</label>
<visible>true</visible>
<layerType>1</layerType>
<crs>EPSG:900913</crs>
<viewScale>
<min>0</min>
<max>50</max>
</viewScale>
<maxExtent>
<minX>256779.44576658405</minX>
<maxX>899274.9255782376</maxX>
<minY>6324781.646007931</minY>
<maxY>6955458.07432226</maxY>
</maxExtent>
<maxTileLevel>16</maxTileLevel>
 
<rasterLayerFactoryRef>googleFactory</rasterLayerFactoryRef>
<layerName>G_NORMAL_MAP</layerName>
<tileWidth>256</tileWidth>
<tileHeight>256</tileHeight>
<style>1</style>
</layer>

It references to a raster LayerFactory, called "GoogleFactory". This means that in your application.xml you will need a layer factory for Google layers. Here is how this would look like:

<rasterLayerFactory id="googleFactory">
<factoryClass>org.geomajas.layermodels.google.GoogleLayerFactory</factoryClass>
<parameterMap />
</rasterLayerFactory>

The ShapeInMem LayerModel is defined for demo purposes and does not write the changes to the shapefile. Instead you must use the Geotools layermodel if you want to write to the shapefile.

Writing to a shapefile is not encouraged anyhow, as a shapefile is a file based architecture and not optimized for performance over the internet. A good approach is to use the shape file format as an import/export format and to store your editable geo data in a PostGIS environment.

Basically you have to provide the same parameters as you would when configuring a GeoTools datastore. In case of the ArcSDE (from the GeoTools website):

<layerModelFactory id="arcSDE_example">
    <factoryClass>GeotoolsLayerModelFactory</factoryClass>
    <parameterMap>
        <parameter name="dbtype" value="arcsde" />
        <parameter name="server" value="a_database_server(localhost?)" />
        <parameter name="port" value="a_port_number" />
        <parameter name="database" value="database_name" />
        <parameter name="user" value="some_user_name" />
        <parameter name="password" value="some_password" />
    </parameterMap>
</layerModelFactory>

More information from the GeoTools website:
http://geotools.codehaus.org/ArcSDE+Plugin
http://geotools.codehaus.org/ArcSDE+snippets

 

Geomajas can connect in different ways to data stores or even a webstream. When you use the GeoTools layermodel, you use exactly the same parameters as you would for GeoTools directly. Geomajas simply passes the arguments to GeoTools. It is the GeoTools library that figures out what kind of datastore is required (whether it is Postgis, WFS or a shapefile).

Geomajas 1.4.0 uses GeoTools version 2.4.1.

Before we start on the cooperation of Geomajas and GeoServer, there is the issue of where to store your data. If you intend to store it in a database, then you have many options. You can either have GeoServer render it without caching, and let it return WMS or WFS maps to Geomajas. But you could also configure your database directly into Geomajas, so you could eliminate the need to use GeoServer. Either way would work.
The GWT release date has been pinned at "before the end of the year 2009". We are currently busy creating the modular structure onto which we will have 2 technologies to create user interfaces from: Dojo (Ajax) and GWT. Although this modular release is almost there (this will be 1.5.0), it will at first only contain the Dojo user interface. The GWT will be added in what we are now calling 1.5.1 (end of December). We are actually getting extra help to finish this, as other companies are also very eager for this GWT version, so this release date should hold. Note that when we first release GWT, it will be an unstable release (because it is a first release), but the API's will be stable, so you can start working on it already.
It would be difficult to start using Geomajas 1.4 without using at least a little bit Javascript. You can keep it to a bare minimum by using only default functionality (such as shown in the example applications), but if you want to add your own functionality, you would need Javascript understanding.

The location of the source code can be found at the following url: https://svn.geomajas.org/majas/. The java source (the back-end), can be found in the majas-core project.

Geomajas is a client-server solution. So this question has 2 answers, depending on what side of the equation you are.

To run the server, you need an application container, such as Tomcat and a Java runtime environment (jre 1.5 or higher)

The client is accessed through a web browser.

    Geomajas 1.4.x has support for the following browsers:
  • Internet Explorer 6 and higher
  • Mozilla FireFox 2.0 and 3.0
  • Google Chrome
  • Safari v 3.1.2

Geomajas has been built from the ground up, to make use of native browser technology. This means that you do not need any plug-in to make it work, just your standard browser!

Also thanks to the FireFox and Safari support, Geomajas runs on Windows, Linux and Max os X.

The list of supported formats can be split up in 2 categories: vector data and raster image data. All are accessed through so-called LayerModels, which are abstractions capable of accessing of the data underneath.

    Vector based layer models:
  • Geotools : support for shape file, WFS (Web Feature Service), PostGIS, DB2, JDBC, ArcSDE, ...
  • Hibernate Spatial : support for PostGIS, Oracle, MySQL
    Raster images models:
  • WMS : Support for Web Map Service.
  • Google : Supports the Google Maps (default, satellite and hybrid).
  • OSM : Supports the OpenStreetMaps rasters.