Commit 904a33664ca389771d8fb733f37db540e1ba607f

  • avatar
  • arvind
  • Thu May 31 14:30:09 IST 2012
Framed cloud
myVector.js
(70 / 43)
  
1818 check1: false,
1919 check2: false,
2020 trigger: function() {
21 if(handler.check == false)
22 {
23 handler.check = true;
24 myjson = {"temple":[
25 {"period": "16th century"},
26 {"location":"13.80338 - 77.61067"},
27 {"sthapati":"Shivakumar"},
28 {"innerloc": "MaharangaMandapa"}
29 ],
30 "size": "311110px X 4668 px",
31 "narrative": "Narrative",
32 "muralTradition": "XYZ",
33 "muralTechnique": "Foo",
34 "muralContent": "Bar"
35 };
36 var x = document.getElementById("content");
37 for (var i in myjson)
38 {
39 if(i == "temple")
40 {
41 for(var y =0; y <myjson[i].length;y++)
42 {
43 for(var z in myjson[i][y])
44 {
45 x.innerHTML += z+': '+'<i>'+myjson[i][y][z]+'</i>; ';
46 }
47 }
48 }
49 else{
50 x.innerHTML += i+': '+'<i>'+myjson[i]+'</i>; ';
51 }
52 }
53 }
54 else{
55 var x = document.getElementById("content");
56 x.innerHTML ='';
57 handler.check = false;
58 }
21 // if(handler.check == false)
22 // {
23 // handler.check = true;
24 // myjson = {"temple":[
25 // {"period": "16th century"},
26 // {"location":"13.80338 - 77.61067"},
27 // {"sthapati":"Shivakumar"},
28 // {"innerloc": "MaharangaMandapa"}
29 // ],
30 // "size": "311110px X 4668 px",
31 // "narrative": "Narrative",
32 // "muralTradition": "XYZ",
33 // "muralTechnique": "Foo",
34 // "muralContent": "Bar"
35 // };
36 // var x = document.getElementById("content");
37 // for (var i in myjson)
38 // {
39 // if(i == "temple")
40 // {
41 // for(var y =0; y <myjson[i].length;y++)
42 // {
43 // for(var z in myjson[i][y])
44 // {
45 // x.innerHTML += z+': '+'<i>'+myjson[i][y][z]+'</i>; ';
46 // }
47 // }
48 // }
49 // else{
50 // x.innerHTML += i+': '+'<i>'+myjson[i]+'</i>; ';
51 // }
52 // }
53 // }
54 // else{
55 // var x = document.getElementById("content");
56 // x.innerHTML ='';
57 // handler.check = false;
58 // }
59 onMyFeatureSelect(map);
5960 },
6061 trigger1: function() {
6162 if(handler.check1 == false)
129129};
130130function onFeatureSelect(feature)
131131{
132 z = new OpenLayers.Popup(
132 z = new OpenLayers.Popup.FramedCloud(
133133 "test",
134 new OpenLayers.LonLat(4263.0000, -1630.33337),
134 feature.geometry.getBounds().getCenterLonLat(),
135135 new OpenLayers.Size(640,480),
136 '<iframe width="480" height="360" src="http://www.youtube.com/embed/WwNUnmZ_aww" frameborder="0" allowfullscreen></iframe>',true);
136 '<iframe width="480" height="360" src="http://www.youtube.com/embed/WwNUnmZ_aww" frameborder="0" allowfullscreen></iframe>',null,true);
137137 feature.popup = z;
138138 z.panMapIfOutOfView = true;
139139 map.addPopup(z);
140140}
141function onMyFeatureSelect(feature)
142{
143 z = new OpenLayers.Popup.FramedCloud(
144 "test",
145 new OpenLayers.LonLat(15555, -2334), // Always should be at the center of the map, not the center of viewport.
146 new OpenLayers.Size(640,480),
147 "<pre><b><center>Temple</center></b>\n"+
148 "period: 16th century\n"+
149 "location: 13.80338 - 77.61067\n"+
150 "sthapati: Shivakumar\n"+
151 "innerloc: MaharangaMandapa\n"+
152 "size: 311110px X 4668 px\n"+
153 "narrative: Narrative\n"+
154 "muralTradition: XYZ\n"+
155 "muralTechnique: Foo\n"+
156 "muralContent: Bar</pre>"
157 ,null,true);
158 feature.popup = z;
159 z.panMapIfOutOfView = true;
160 map.addPopup(z);
161}
141162function init(){
142163 var options = {
143164 controls: [],
184184 box = new OpenLayers.Feature.Vector(bounds.toGeometry());
185185 box2.addFeatures(box);
186186 }
187 box3 = new OpenLayers.Layer.Vector( "Boxes" );
187 box3 = new OpenLayers.Layer.Vector( "Boxes");
188188 for (var i = 0; i < box_extents1.length; i++) {
189189 ext = box_extents1[i];
190190 bounds = OpenLayers.Bounds.fromArray(ext);
197197 selectControl = new OpenLayers.Control.SelectFeature(box3,
198198 {onSelect: onFeatureSelect});
199199
200 MapselectControl = new OpenLayers.Control.SelectFeature(map,
201 {onSelect: onMyFeatureSelect});
202
200203 drawControls = {
201204 box : new OpenLayers.Control.DrawFeature(boxes,
202205 OpenLayers.Handler.RegularPolygon, {
209209 }
210210 }
211211 ),
212 select: selectControl
212 select: selectControl,
213 mySelect: MapselectControl
213214 };
214215 map.zoomToExtent( mapBounds );
215216 for(var key in drawControls){
216217 map.addControl(drawControls[key]);
217218 }
218219 drawControls['select'].activate();
220 drawControls['mySelect'].activate();
219221 addLabel('3759.0000','-1274.33337','Face');
220222 addLabel('3719','-1771','Jewelery');
221223 addLabel('4263.0000','-1630.33337', 'Video')