Cartography
Cartography
To add the cartography functionality, edit the file dysoweb.properties located in the folder tomcat/webapps/dysoweb/WEB-INF/classes:
- add ",\" at the end of the last row.
- then add the row "com.almworks.sqlite4java" atthe end of the file.
Edit the file requeadb.xml located in dysoweb.home/config by adding the row :
<DbSpatial>true</DbSpatial>
In the Requea interface, go to the menu System Parameters in the item l’onglet Administrator and modify these two parameters:
- com.requea.osm.tiles.path : inform the path to the .mbtiles file
- com.requea.dynapage.geospatial.geomap : put the value OSM
Use Cartography
To display items on the map, you have to create an entity with a property type spacial Geometry and the format 2D Geodetic property :
To view the map from the .mbtiles file, create an entity derived from GeoMapView:
Modify the script of the field Display rules or behavior in the properties sysView and sysZoom so that it point to your preferred location:
To display items on that map, edit the operation BuildMap with a script.
For example:
map.layers = [];
var layer;
layer = {};
layer.title = "Items";
layer.points = [];
layer.layers = [];
var centerX = 0;
var centerY = 0;
var nb = 0;
var flt = new Filter("seItem");
var iter = flt.search();
while(iter.hasNext()) {
var item = iter.next();
var pos = item.seGeoPosition;
if(pos != null) {
if(nb == 0) {
centerX = pos.x;
centerY = pos.y;
nb = 1;
} else {
centerX = (pos.x + nb * centerX) / ( nb+1 );
centerY = (pos.y + nb * centerY) / ( nb+1 );
nb ++;
}
}
}
map.layers.push(layer);
data = new Json(map);
}