[OpenLayers-Commits] r4732 - in sandbox/context/examples: . WMC

commits at openlayers.org commits at openlayers.org
Mon Oct 1 09:53:41 EDT 2007


Author: ominiverdi
Date: 2007-10-01 09:53:40 -0400 (Mon, 01 Oct 2007)
New Revision: 4732

Modified:
   sandbox/context/examples/WMC/context.js
   sandbox/context/examples/WMC/context.xml
   sandbox/context/examples/wmc.html
Log:
WMC: example updated

Modified: sandbox/context/examples/WMC/context.js
===================================================================
--- sandbox/context/examples/WMC/context.js	2007-10-01 06:13:51 UTC (rev 4731)
+++ sandbox/context/examples/WMC/context.js	2007-10-01 13:53:40 UTC (rev 4732)
@@ -11,7 +11,7 @@
 		
 		"ContactInformation":{},
 		
-		"LogoURL":{width:130,height:50,format:"image/gif","OnlineResource":{"xlink:type":"simple","xlink:href":"http://mydomain/mylogo.gif"},
+		"LogoURL":{width:130,height:50,format:"image/gif","OnlineResource":{"xlink:type":"simple","xlink:href":"http://mydomain/mylogo.gif"}},
 		
 		"DescriptionURL":{format:"text/html","OnlineResource":{xlink:type="simple","xlink:href":"http://mydomain/mydescr.html"}
 		

Modified: sandbox/context/examples/WMC/context.xml
===================================================================
--- sandbox/context/examples/WMC/context.xml	2007-10-01 06:13:51 UTC (rev 4731)
+++ sandbox/context/examples/WMC/context.xml	2007-10-01 13:53:40 UTC (rev 4732)
@@ -7,8 +7,7 @@
        xsi:schemaLocation="http://www.opengeospatial.net/context context.xsd"> 
  <General> 
   <Window width="500" height="300" /> 
-  <BoundingBox SRS="EPSG:4326" minx="-180.000000" miny="-90.000000" maxx="180.000000" 
-maxy="90.000000"/> 
+  <BoundingBox SRS="EPSG:4326" minx="-180.000000" miny="-90.000000" maxx="180.000000" maxy="90.000000"/> 
   <Title>EOS Data Gateways</Title> 
   <KeywordList> 
    <Keyword>EOS</Keyword> 
@@ -52,8 +51,7 @@
    </Server> 
    <Name>WORLD_MODIS_1KM:MapAdmin</Name> 
    <Title>WORLD_MODIS_1KM</Title> 
-   <Abstract>Global maps derived from various Earth Observation sensors / 
-WORLD_MODIS_1KM:MapAdmin</Abstract> 
+   <Abstract>Global maps derived from various Earth Observation sensors WORLD_MODIS_1KM:MapAdmin</Abstract> 
    <SRS>EPSG:4326</SRS> 
    <FormatList> 
     <Format current="1">image/png</Format> 
@@ -64,9 +62,7 @@
      <Title>default</Title> 
      <LegendURL width="16" height="16" format="image/gif"> 
       <OnlineResource xlink:type="simple" 
-xlink:href="http://mapserv2.esrin.esa.it/cubestor/cubeserv/cubeserv.cgi?VERSION=1.1.0&amp;REQUEST=GetLegendIcon 
-&amp;LAYER=WORLD_MODIS_1KM:MapAdmin&amp;SPATIAL_TYPE=RASTER&amp;STYLE=default&amp;FORMAT=i 
-mage/gif"/> 
+xlink:href="http://mapserv2.esrin.esa.it/cubestor/cubeserv/cubeserv.cgi?VERSION=1.1.0&amp;REQUEST=GetLegendIcon&amp;LAYER=WORLD_MODIS_1KM:MapAdmin&amp;SPATIAL_TYPE=RASTER&amp;STYLE=default&amp;FORMAT=image/gif"/> 
      </LegendURL> 
     </Style> 
    </StyleList> 
@@ -109,16 +105,14 @@
      <Name>default</Name> 
      <Title>Default</Title> 
      <LegendURL width="180" format="image/gif" height="50"> 
-      <OnlineResource xlink:type="simple" 
-xlink:href="http://globe.digitalearth.gov/globe/en/icons/colorbars/NATIONAL.gif"/> 
+      <OnlineResource xlink:type="simple" xlink:href="http://globe.digitalearth.gov/globe/en/icons/colorbars/NATIONAL.gif"/> 
      </LegendURL> 
     </Style> 
    </StyleList> 
   </Layer> 
   <Layer queryable="1" hidden="0"> 
    <Server service="OGC:WMS" version="1.1.0" title="CCRS Spatial Data Warehouse"> 
-    <OnlineResource xlink:type="simple" 
-xlink:href="http://ceoware2.ccrs.nrcan.gc.ca/cubewerx/cubeserv/cubeserv.cgi"/> 
+    <OnlineResource xlink:type="simple" xlink:href="http://ceoware2.ccrs.nrcan.gc.ca/cubewerx/cubeserv/cubeserv.cgi"/> 
    </Server> 
    <Name>EOS_DATA_GATEWAYS:CEOWARE2</Name> 
    <Title>EOS Data Gateways</Title> 
@@ -134,9 +128,7 @@
      <Title>default</Title> 
      <LegendURL width="16" height="16" format="image/gif"> 
       <OnlineResource xlink:type="simple" 
-xlink:href="http://ceoware2.ccrs.nrcan.gc.ca/cubewerx/cubeserv/cubeserv.cgi?VERSION=1.1.0&amp;REQUEST=GetLege 
-ndIcon&amp;LAYER=EOS_DATA_GATEWAYS:CEOWARE2&amp;SPATIAL_TYPE=POINT&amp;STYLE=default&amp;F 
-ORMAT=image/gif"/> 
+xlink:href="http://ceoware2.ccrs.nrcan.gc.ca/cubewerx/cubeserv/cubeserv.cgi?VERSION=1.1.0&amp;REQUEST=GetLegendIcon&amp;LAYER=EOS_DATA_GATEWAYS:CEOWARE2&amp;SPATIAL_TYPE=POINT&amp;STYLE=default&amp;FORMAT=image/gif"/> 
      </LegendURL> 
     </Style> 
    </StyleList> 

Modified: sandbox/context/examples/wmc.html
===================================================================
--- sandbox/context/examples/wmc.html	2007-10-01 06:13:51 UTC (rev 4731)
+++ sandbox/context/examples/wmc.html	2007-10-01 13:53:40 UTC (rev 4732)
@@ -36,9 +36,8 @@
         <script type="text/javascript">
         //<![CDATA[
         var WMC_NS = 'http://www.opengeospatial.net/context';
-        var format = new OpenLayers.Format.XML();
+        var format = new OpenLayers.Format.WMC();
         var doc = null;
-        var doc2 = null;
         
         function init() {
             var url = "wmc/context.xml";
@@ -47,11 +46,9 @@
         
         function loadSuccess(request) {
             updateStatus("loaded");
-            if(!request.responseXML.documentElement) {
-                doc = format.read(request.responseText);
-            } else {
-                doc = request.responseXML;
-            }
+			doc = format.read(request.responseText);
+			doc = doc;
+			
         }
         
         function loadFailure(request) {
@@ -65,9 +62,7 @@
         function updateOutput(text) {
             document.getElementById("output").firstChild.nodeValue = text;
         }
-        function write2() {
-			 doc2 = doc;
-			}
+      
         function write() {
             var text = format.write(doc);
             updateOutput(text);
@@ -115,8 +110,8 @@
         </script>
     </head>
     <body>
-        <h3>OpenLayers XML Example</h3>
-        <p>OpenLayers has a very simple XML format class (OpenLayers.Format.XML)
+        <h3>OpenLayers Web Map Context (WMC) Example</h3>
+        <p>WMC extends XML Lib. OpenLayers has a very simple XML format class (OpenLayers.Format.XML)
         that can be used to read/write XML docs.  The methods available on the
         XML format (or parser if you like) allow for reading and writing of the
         various XML flavors used by the library - in particular the vector data
@@ -130,12 +125,13 @@
         below.  Assume that you start with the following code:
         <br />
         <span class="code">
-            var format = new OpenLayers.Format.XML();
+            var format = new OpenLayers.Format.WMC();
         </span>
         </p>
         Sample methods
         <ul>
             <li><a href="javascript:void write();">format.write()</a> - write the XML doc as text</li>
+			<li>functions here below should be meaningless because OLContext is not XML but a JS object</li>
             <li><a href="javascript:void getElementsByTagNameNS(doc, '*', 'General');">format.getElementsByTagNameNS()</a> - get the General Object</li>
             <li><a href="javascript:void hasAttributeNS(doc.documentElement, '*', 'schemaLocation');">format.hasAttributeNS()</a> - test to see schemaLocation attribute exists in the http://www.w3.org/2001/XMLSchema-instance namespace</li>
             <li><a href="javascript:void getAttributeNodeNS(doc.documentElement, '*', 'schemaLocation');">format.getAttributeNodeNS()</a> - get schemaLocation attribute in the http://www.w3.org/2001/XMLSchema-instance namespace</li>



More information about the Commits mailing list