Hide last authors
Pierre Dubois 8.1 1 = Cartography =
Pierre Dubois 2.1 2
Pierre Dubois 8.1 3 To add the cartography functionality, edit the file dysoweb.properties located in the folder tomcat/webapps/dysoweb/WEB-INF/classes:
4
5 * add ",\" at the end of the last row.
6 * then add the row "com.almworks.sqlite4java" atthe end of the file.
7
8 Edit the file requeadb.xml located in dysoweb.home/config by adding the row :
9 <DbSpatial>true</DbSpatial>
10
11 In the Requea interface, go to the menu System Parameters in the item l’onglet Administrator and modify these two parameters:
12
13 * com.requea.osm.tiles.path : inform the path to the .mbtiles file
14 * com.requea.dynapage.geospatial.geomap : put the value OSM
15
16 = Use Cartography =
Pierre Dubois 15.1 17
Pierre Dubois 9.1 18 To display items on the map, you have to create an entity with a property type //spacial Geometry// and the format //2D Geodetic property// :
Pierre Dubois 8.1 19
Pierre Dubois 31.1 20 [[image:Capturedecran2015-06-02a16.21.15.png]]
Pierre Dubois 15.1 21
Pierre Dubois 31.1 22
Pierre Dubois 8.1 23 To view the map from the .mbtiles file, create an entity derived from GeoMapView:
24
25 Modify the script of the field Display rules or behavior in the properties sysView and sysZoom so that it point to your preferred location:
26
Pierre Dubois 31.1 27 [[image:Capturedecran2015-06-01a17.55.14.png]]
Pierre Dubois 8.1 28
Pierre Dubois 31.1 29 [[image:Capturedecran2015-06-01a17.55.38.png]]
30
Pierre Dubois 9.1 31 To display items on that map, edit the operation BuildMap with a script.
32
33 For example:
34
35 {{code language="javascript"}}
36 var map = {};
37 map.layers = [];
38 var layer;
39
40 layer = {};
41 layer.title = "Items";
42 layer.layers = [];
43
Pierre Dubois 11.1 44 var flt = new Filter("custItem");
Pierre Dubois 9.1 45
46 var iter = flt.search();
47
48 while(iter.hasNext()) {
49 var item = iter.next();
Pierre Dubois 11.1 50 var pos = item.custGeoPosition;
Pierre Dubois 9.1 51
Pierre Dubois 10.1 52 //add the item on the map, at the position specified
Pierre Dubois 34.1 53 layer.points.push({id:station.sysId, pos:pos });
Pierre Dubois 9.1 54 }
55 map.layers.push(layer);
56
57 data = new Json(map);
58 }
59 {{/code}}
Pierre Dubois 11.1 60
61 You can change the default icon of the item by adding a icon field in the JSON Object layer.points.
62 For example:
63
64 {{code language="javascript"}}
65
66 layer.points = [];
67
Pierre Dubois 33.1 68 layer.icons = [ { url:'/img/img0.png',x:-16,y:-16},
69 { url:'img/img1.png',x:-16,y:-16},
Pierre Dubois 11.1 70 { url:'img/img2.png',x:-16,y:-16},
Pierre Dubois 33.1 71 { url:'/img/img3.png',x:-16,y:-16}
Pierre Dubois 11.1 72 ];
Pierre Dubois 33.1 73
74 icon = 2;
75
Pierre Dubois 32.1 76 layer.points.push({icon:icon, pos:pos,... });
Pierre Dubois 11.1 77
78 {{/code}}
Pierre Dubois 31.1 79
80 The root of the URL specified is the folder webapps in dysoweb.home///bundleName///src
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 9.11.5 - Documentation