Wiki source code of Cartography
Hide last authors
8.1 | 1 | = Cartography = | |
2.1 | 2 | ||
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 = | ||
15.1 | 17 | ||
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// : | |
8.1 | 19 | ||
24.1 | 20 | [[image:Capturedecran2015-06-02a16.06.13.png]] | |
15.1 | 21 | ||
8.1 | 22 | To view the map from the .mbtiles file, create an entity derived from GeoMapView: | |
23 | |||
15.1 | 24 | ||
24.1 | 25 | ||
8.1 | 26 | Modify the script of the field Display rules or behavior in the properties sysView and sysZoom so that it point to your preferred location: | |
27 | |||
28 | |||
9.1 | 29 | To display items on that map, edit the operation BuildMap with a script. | |
30 | |||
31 | For example: | ||
32 | |||
33 | {{code language="javascript"}} | ||
34 | var map = {}; | ||
35 | map.layers = []; | ||
36 | var layer; | ||
37 | |||
38 | layer = {}; | ||
39 | layer.title = "Items"; | ||
40 | layer.layers = []; | ||
41 | |||
11.1 | 42 | var flt = new Filter("custItem"); | |
9.1 | 43 | ||
44 | var iter = flt.search(); | ||
45 | |||
46 | while(iter.hasNext()) { | ||
47 | var item = iter.next(); | ||
11.1 | 48 | var pos = item.custGeoPosition; | |
9.1 | 49 | ||
10.1 | 50 | //add the item on the map, at the position specified | |
51 | layer.points.push({pos:pos }); | ||
9.1 | 52 | } | |
53 | map.layers.push(layer); | ||
54 | |||
55 | data = new Json(map); | ||
56 | } | ||
57 | {{/code}} | ||
11.1 | 58 | ||
59 | You can change the default icon of the item by adding a icon field in the JSON Object layer.points. | ||
60 | For example: | ||
61 | |||
62 | {{code language="javascript"}} | ||
63 | |||
64 | layer.points = []; | ||
65 | |||
66 | layer.icons = [ { url:'/img/img1.png',x:-16,y:-16}, | ||
67 | { url:'img/img2.png',x:-16,y:-16}, | ||
68 | { url:'img/img3.png',x:-16,y:-16}, | ||
69 | { url:'/img/img4.png',x:-16,y:-16} | ||
70 | ]; | ||
71 | layer.points.push({icon:icon }); | ||
72 | |||
73 | {{/code}} |