OpenLayers OpenLayers

root/branches/openlayers/2.5/examples/GMLParser.html

Revision 2978, 1.0 kB (checked in by sderle, 2 years ago)

propset svn:eol-style native recursively throughout trunk. enjoy\!

  • Property svn:eol-style set to native
Line 
1 <html xmlns="http://www.w3.org/1999/xhtml">
2   <head>
3     <style type="text/css">
4         #map {
5             width: 800px;
6             height: 475px;
7             border: 1px solid black;
8         }
9     </style>
10     <script src="../lib/OpenLayers.js"></script>
11     <script type="text/javascript">
12         function parseData(req) {
13           g =  new OpenLayers.Format.GML();
14           html = ""
15           features = g.read(req.responseText);
16           for(var feat in features) {
17             html += "Feature: Geometry: "+ features[feat].geometry+",";
18                 html += "<ul>";
19             for (var j in features[feat].attributes) {
20                 html += "<li>"+j+":"+features[feat].attributes[j]+"</li>";
21             }
22                 html += "</ul>"
23           }
24           document.body.innerHTML = html;
25         }
26         function load() {
27             OpenLayers.loadURL("gml/owls.xml", "", null, parseData);
28         }   
29     </script>
30   </head>
31   <body onload="load()">
32   </body>
33 </html> 
Note: See TracBrowser for help on using the browser.