From version 8.1
edited by Pierre Dubois
on 2015/06/02 12:09
To version 9.1
edited by Pierre Dubois
on 2015/06/02 14:33
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Content
... ... @@ -14,6 +14,8 @@
14 14  * com.requea.dynapage.geospatial.geomap : put the value OSM
15 15  
16 16  = Use Cartography =
17 +To display items on the map, you have to create an entity with a property type //spacial Geometry// and the format //2D Geodetic property// :
18 +[[image:Capturedecran2015-06-02a09.35.43.png||style="font-family: sans-serif; font-size: 14px;"]]
17 17  
18 18  To view the map from the .mbtiles file, create an entity derived from GeoMapView:
19 19  [[image:Capturedecran2015-06-01a17.54.55.png]]
... ... @@ -24,5 +24,45 @@
24 24  
25 25  [[image:Capturedecran2015-06-01a17.55.38.png]]
26 26  
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// :
28 -[[image:Capturedecran2015-06-02a09.35.43.png||style="font-family: sans-serif; font-size: 14px;"]]
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.points = [];
41 +layer.layers = [];
42 +
43 +var centerX = 0;
44 +var centerY = 0;
45 +var nb = 0;
46 +var flt = new Filter("seItem");
47 +
48 +var iter = flt.search();
49 +
50 +while(iter.hasNext()) {
51 + var item = iter.next();
52 + var pos = item.seGeoPosition;
53 +
54 + if(pos != null) {
55 + if(nb == 0) {
56 + centerX = pos.x;
57 + centerY = pos.y;
58 + nb = 1;
59 + } else {
60 + centerX = (pos.x + nb * centerX) / ( nb+1 );
61 + centerY = (pos.y + nb * centerY) / ( nb+1 );
62 + nb ++;
63 + }
64 + }
65 +}
66 +map.layers.push(layer);
67 +
68 +data = new Json(map);
69 +}
70 +{{/code}}
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 9.11.5 - Documentation