From version 10.1
edited by Pierre Dubois
on 2015/06/02 15:00
To version 11.1
edited by Pierre Dubois
on 2015/06/02 16:03
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Content
... ... @@ -37,16 +37,15 @@
37 37  
38 38  layer = {};
39 39  layer.title = "Items";
40 -layer.points = [];
41 41  layer.layers = [];
42 42  
43 -var flt = new Filter("seItem");
42 +var flt = new Filter("custItem");
44 44  
45 45  var iter = flt.search();
46 46  
47 47  while(iter.hasNext()) {
48 48   var item = iter.next();
49 - var pos = item.seGeoPosition;
48 + var pos = item.custGeoPosition;
50 50  
51 51   //add the item on the map, at the position specified
52 52   layer.points.push({pos:pos });
... ... @@ -56,3 +56,19 @@
56 56  data = new Json(map);
57 57  }
58 58  {{/code}}
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}}
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 9.11.5 - Documentation