Commit 7f5c53688be0e5c78de8c4926ef247a6e2feed60
- Diff rendering mode:
- inline
- side by side
myVector.js
(12 / 4)
  | |||
10 | 10 | var box_extents1 = [ | |
11 | 11 | [4263.0000, -1630.33337, 4559.0000, -1342.33337] | |
12 | 12 | ]; | |
13 | var myJSON = {}; | ||
13 | 14 | // avoid pink tiles | |
14 | 15 | OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3; | |
15 | 16 | OpenLayers.Util.onImageLoadErrorColor = "transparent"; | |
… | … | ||
65 | 65 | } | |
66 | 66 | function onMyFeatureSelect(feature, json, x, y) | |
67 | 67 | { | |
68 | // str = ""; | ||
69 | // x = 1; | ||
70 | 68 | z = new OpenLayers.Popup.FramedCloud( | |
71 | 69 | "test", | |
72 | 70 | new OpenLayers.LonLat(x, y), // Always should be at the center of the map, not the center of viewport. | |
… | … | ||
225 | 225 | console.log(labelFeature.attributes['name']); | |
226 | 226 | if(labelFeature.attributes['name']) | |
227 | 227 | { | |
228 | //console.log(myObj.feature.geometry.bounds.top); Use this to get the bounds. | ||
229 | top = myObj.feature.geometry.bounds.top; | ||
228 | console.log(myObj.feature.geometry.bounds.top); //Use this to get the bounds. | ||
229 | topValue = myObj.feature.geometry.bounds.top; | ||
230 | 230 | bottom = myObj.feature.geometry.bounds.bottom; | |
231 | 231 | left = myObj.feature.geometry.bounds.left; | |
232 | 232 | right = myObj.feature.geometry.bounds.right; | |
… | … | ||
235 | 235 | vectorLayer.drawFeature(labelFeature); | |
236 | 236 | vectorLayer.addFeatures([labelFeature]); | |
237 | 237 | annotationTree(); | |
238 | attribs = { | ||
239 | "top": topValue, | ||
240 | "bottom": bottom, | ||
241 | "right": right, | ||
242 | "left": left, | ||
243 | "name": name, | ||
244 | "character": $("#character-value").text(), | ||
245 | "material": $("#material-value").text() | ||
246 | }; | ||
238 | 247 | } | |
239 | 248 | else | |
240 | 249 | myObj.feature.destroy(); |
openlayers.html
(15 / 6)
  | |||
35 | 35 | </style> | |
36 | 36 | <script src="http://www.openlayers.org/api/2.11/OpenLayers.js" type="text/javascript"></script> | |
37 | 37 | <script type="text/javascript" src="myVector.js"></script> | |
38 | <script type="text/javascript"> | ||
39 | function treeClose() | ||
40 | { | ||
41 | $('#annotation-tree').hide(); | ||
42 | myJSON['attribs'] = attribs; | ||
43 | } | ||
44 | </script> | ||
38 | 45 | </head> | |
39 | <body onload="init();inits();"> | ||
46 | <body onload="init();"> | ||
40 | 47 | <div id="header"><h1>Lepakshi Mural</h1></div> | |
41 | 48 | <div id="subheader">Generated by <a href="http://www.maptiler.org/">MapTiler</a><a href="http://www.klokan.cz/projects/gdal2tiles/">GDAL2Tiles</a>, Copyright © 2008 <a href="http://www.klokan.cz/">Klokan Petr Pridal</a>, <a href="http://www.gdal.org/">GDAL</a> & <a href="http://www.osgeo.org/">OSGeo</a> <a href="http://code.google.com/soc/">GSoC</a> | |
42 | 49 | <!-- PLEASE, LET THIS NOTE ABOUT AUTHOR AND PROJECT SOMEWHERE ON YOUR WEBSITE, OR AT LEAST IN THE COMMENT IN HTML. THANK YOU --> | |
43 | 50 | </div> | |
44 | <input onclick="handler.trigger();" type="button" style="background-color:#00CC00;height:15px;-moz-border-radius:75px;-webkit-border-radius:75px; width:15px;" value="Mural" /><br /><div id="content"></div> | ||
45 | <input onclick="handler.trigger1();" type="button" style="background-color:#00CC00;height:15px;-moz-border-radius:75px;-webkit-border-radius:75px; width:15px;" value="Face" /><br /><div id="content1"></div> | ||
46 | <input onclick="handler.trigger2();" type="button" style="background-color:#00CC00;height:15px;-moz-border-radius:75px;-webkit-border-radius:75px; width:15px;" value="Jewelery" /><br /><div id="content2"></div> | ||
51 | <input onclick="handler.trigger();" type="button" style="background-color:#00CC00;height:15px;-moz-border-radius:75px;-webkit-border-radius:75px; width:15px;"/>Mural<div id="content"></div> | ||
52 | <input onclick="handler.trigger1();" type="button" style="background-color:#00CC00;height:15px;-moz-border-radius:75px;-webkit-border-radius:75px; width:15px;"/>Face<div id="content1"></div> | ||
53 | <input onclick="handler.trigger2();" type="button" style="background-color:#00CC00;height:15px;-moz-border-radius:75px;-webkit-border-radius:75px; width:15px;"/>Jewellery<div id="content2"></div> | ||
47 | 54 | <div id="map"></div> | |
48 | 55 | <div> | |
49 | 56 | <ul> | |
… | … | ||
69 | 69 | </ul> | |
70 | 70 | </div> | |
71 | 71 | <script type="text/javascript" >resize()</script> | |
72 | <div id="annotation-tree"><div id="infovis"> | ||
72 | <div id="annotation-tree"> | ||
73 | <input type="button" value="close" onClick="treeClose();"/> | ||
74 | <div id="infovis"> | ||
73 | 75 | <form> | |
74 | <div>Charater: <span id="character-value"></span></div> | ||
76 | <div>Character: <span id="character-value"></span></div> | ||
75 | 77 | <div>Ornament </div> | |
76 | 78 | <div>Material: <span id="material-value"></span></div> | |
77 | 79 | <div>Jewellery: <span id="jewellery-value"></span></div> |