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.
Pierre Dubois 46.1 6 * then add the row "com.almworks.sqlite4java" at the end of the file.
Pierre Dubois 8.1 7
8 Edit the file requeadb.xml located in dysoweb.home/config by adding the row :
9 <DbSpatial>true</DbSpatial>
10
Pierre Dubois 43.1 11 Go to http://localhost:8080/dysoweb/dysoweb/panel/secure/shell.jsp and add the reference to the open street map bundle from dynapage by executing
12
Pierre Dubois 45.1 13 {{code language="script"}}
Pierre Dubois 43.1 14
15 start reference:file:/../dynapage/ext/com.requea.dynapage.ext.geospatial.openstreetmap/src/main/
16
17 {{/code}}
18
19
Pierre Dubois 8.1 20 In the Requea interface, go to the menu System Parameters in the item l’onglet Administrator and modify these two parameters:
21
22 * com.requea.osm.tiles.path : inform the path to the .mbtiles file
23 * com.requea.dynapage.geospatial.geomap : put the value OSM
24
25 = Use Cartography =
Pierre Dubois 15.1 26
Pierre Dubois 9.1 27 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 28
Pierre Dubois 31.1 29 [[image:Capturedecran2015-06-02a16.21.15.png]]
Pierre Dubois 15.1 30
Pierre Dubois 31.1 31
Pierre Dubois 8.1 32 To view the map from the .mbtiles file, create an entity derived from GeoMapView:
33
Pierre Dubois 42.1 34 [[image:Capturedecran2015-07-10a16.18.34.png]]
35
Pierre Dubois 47.1 36 Modify the script of the field Display rules or behavior in the properties sysCenter and sysZoom so that it point to your preferred location:
Pierre Dubois 8.1 37
Pierre Dubois 31.1 38 [[image:Capturedecran2015-06-01a17.55.14.png]]
Pierre Dubois 8.1 39
Pierre Dubois 31.1 40 [[image:Capturedecran2015-06-01a17.55.38.png]]
41
Pierre Dubois 9.1 42 To display items on that map, edit the operation BuildMap with a script.
43
44 For example:
45
46 {{code language="javascript"}}
47 var map = {};
48 map.layers = [];
49 var layer;
50
51 layer = {};
52 layer.title = "Items";
53 layer.layers = [];
54
Pierre Dubois 11.1 55 var flt = new Filter("custItem");
Pierre Dubois 9.1 56
57 var iter = flt.search();
58
59 while(iter.hasNext()) {
60 var item = iter.next();
Pierre Dubois 11.1 61 var pos = item.custGeoPosition;
Pierre Dubois 9.1 62
Pierre Dubois 10.1 63 //add the item on the map, at the position specified
Pierre Dubois 34.1 64 layer.points.push({id:station.sysId, pos:pos });
Pierre Dubois 9.1 65 }
66 map.layers.push(layer);
67
68 data = new Json(map);
69 }
70 {{/code}}
Pierre Dubois 11.1 71
72 You can change the default icon of the item by adding a icon field in the JSON Object layer.points.
73 For example:
74
75 {{code language="javascript"}}
76
77 layer.points = [];
78
Pierre Dubois 33.1 79 layer.icons = [ { url:'/img/img0.png',x:-16,y:-16},
80 { url:'img/img1.png',x:-16,y:-16},
Pierre Dubois 11.1 81 { url:'img/img2.png',x:-16,y:-16},
Pierre Dubois 33.1 82 { url:'/img/img3.png',x:-16,y:-16}
Pierre Dubois 11.1 83 ];
Pierre Dubois 33.1 84
85 icon = 2;
86
Pierre Dubois 32.1 87 layer.points.push({icon:icon, pos:pos,... });
Pierre Dubois 11.1 88
89 {{/code}}
Pierre Dubois 31.1 90
91 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