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>
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: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.
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 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.
Geosparc professionally supports Geomajas, the open source GIS application development software, coupling the innovation of open source with the reliability of a true enterprise-class platform. Geomajas was built with today's Internet and cloud architectures in mind. This truly differentiates Geomajas from other GIS software.