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.layers = [];
var flt = new Filter("custItem");
var iter = flt.search();
while(iter.hasNext()) {
var item = iter.next();
var pos = item.custGeoPosition;
//add the item on the map, at the position specified
layer.points.push({pos:pos });
}
map.layers.push(layer);
data = new Json(map);
}
You can change the default icon of the item by adding a icon field in the JSON Object layer.points.
For example:
layer.points = [];
layer.icons = [ { url:'/img/img1.png',x:-16,y:-16},
{ url:'img/img2.png',x:-16,y:-16},
{ url:'img/img3.png',x:-16,y:-16},
{ url:'/img/img4.png',x:-16,y:-16}
];
layer.points.push({icon:icon });
The root of the URL specified is the folder webapps in dysoweb.home/bundleName/src