[Spanish] empezando con Openlayers

bv2musae at uco.es bv2musae at uco.es
Thu Jul 29 08:57:37 EDT 2010


Resulta que he comenzado a intentar trabajar con OpenLayers y, ya de  
comienzo, me he encontrado con problemas. Estoy intentando un ejemplo  
muy simple con un archivo GML. Visualizo la capa de OL, pero no mi  
GML. Os pego a continuación el .html y el GML. Muchas gracias:

<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <style type="text/css">
         #map {
             width: 512px;
             height: 512px;
             border: 1px solid black;
         }
     </style>
     <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
     <script type="text/javascript">

         var map, layer;

         function init(){
             map = new OpenLayers.Map('map');
             layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
                     "http://labs.metacarta.com/wms/vmap0", {layers:  
'basic'} );
             map.addLayer(layer);
             map.zoomToExtent(new  
OpenLayers.Bounds(-7.322119,35.402827,-1.254243,38.591033));
             map.addLayer(new OpenLayers.Layer.GML("GML",  
"http://localhost/Documents and Settings/Administrador/Mis  
documentos/Proyecto_Parques/output.gml"));
         }

     </script>
    </head>
    <body onload="init()">

          <b>Ejemplo</b>

      <div>
           El uso básico de Openlayers para publicar cartografía
      </div>

      <div id="map"></div>

      <div id="docs">
          EJEMPLO: límites provinciales
      </div>
    </body>
   </html>

-----------------------------------

  <?xml version="1.0" encoding="ISO-8859-1" ?>
- <wfs:FeatureCollection  
xmlns:ms="http://mapserver.gis.umn.edu/mapserver"  
xmlns:wfs="http://www.opengis.net/wfs"  
xmlns:gml="http://www.opengis.net/gml"  
xmlns:ogc="http://www.opengis.net/ogc"  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
xsi:schemaLocation="http://www.opengis.net/wfs  
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd  
http://mapserver.gis.umn.edu/mapserver  
http://aneto.oco/cgi-bin/worldwfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=polygon&OUTPUTFORMAT=XMLSCHEMA">
- <gml:boundedBy>
- <gml:Box srsName="EPSG:4326">
   <gml:coordinates>-0.768746,47.003018 3.002191,47.925567</gml:coordinates>
   </gml:Box>
   </gml:boundedBy>
- <gml:featureMember>
- <ms:polygon fid="1">
- <gml:boundedBy>
- <gml:Box srsName="EPSG:4326">
   <gml:coordinates>-0.768746,47.003018 0.532597,47.925567</gml:coordinates>
   </gml:Box>
   </gml:boundedBy>
- <ms:msGeometry>
- <gml:MultiPolygon srsName="EPSG:4326">
- <gml:polygonMember>
- <gml:Polygon>
- <gml:outerBoundaryIs>
- <gml:LinearRing>
   <gml:coordinates>-0.318987,47.003018 -0.768746,47.358268  
-0.574463,47.684285 -0.347374,47.854602 -0.006740,47.925567  
0.135191,47.726864 0.149384,47.599127 0.419052,47.670092  
0.532597,47.428810 0.305508,47.443003 0.475824,47.144948  
0.064225,47.201721 -0.318987,47.003018</gml:coordinates>
   </gml:LinearRing>
   </gml:outerBoundaryIs>
- <gml:innerBoundaryIs>
- <gml:LinearRing>
   <gml:coordinates>-0.035126,47.485582 -0.035126,47.485582  
-0.049319,47.641706 -0.233829,47.655899 -0.375760,47.457196  
-0.276408,47.286879 -0.035126,47.485582</gml:coordinates>
   </gml:LinearRing>
   </gml:innerBoundaryIs>
   </gml:Polygon>
   </gml:polygonMember>
   </gml:MultiPolygon>
   </ms:msGeometry>
   <ms:ogc_fid>1</ms:ogc_fid>
   <ms:name>My Polygon with hole</ms:name>
   <ms:id>0</ms:id>
   </ms:polygon>
   </gml:featureMember>
- <gml:featureMember>
- <ms:polygon fid="2">
- <gml:boundedBy>
- <gml:Box srsName="EPSG:4326">
   <gml:coordinates>1.511919,47.088176 3.002191,47.882988</gml:coordinates>
   </gml:Box>
   </gml:boundedBy>
- <ms:msGeometry>
- <gml:Polygon srsName="EPSG:4326">
- <gml:outerBoundaryIs>
- <gml:LinearRing>
   <gml:coordinates>1.625463,47.357844 1.511919,47.741057  
1.880938,47.882988 2.420275,47.797830 2.789295,47.485582  
3.002191,47.457196 2.874453,47.088176 2.178993,47.343651  
1.625463,47.357844</gml:coordinates>
   </gml:LinearRing>
   </gml:outerBoundaryIs>
   </gml:Polygon>
   </ms:msGeometry>
   <ms:ogc_fid>2</ms:ogc_fid>
   <ms:name>My simple Polygon</ms:name>
   <ms:id>0</ms:id>
   </ms:polygon>
   </gml:featureMember>
- <gml:featureMember>
- <ms:polygon fid="3">
- <gml:boundedBy>
- <gml:Box srsName="EPSG:4326">
   <gml:coordinates>0.000000,45.000000 2.000000,47.000000</gml:coordinates>
   </gml:Box>
   </gml:boundedBy>
- <ms:msGeometry>
- <gml:MultiPolygon srsName="EPSG:4326">
- <gml:polygonMember>
- <gml:Polygon>
- <gml:outerBoundaryIs>
- <gml:LinearRing>
   <gml:coordinates>0.000000,45.000000 2.000000,45.000000  
2.000000,47.000000 0.000000,47.000000  
0.000000,45.000000</gml:coordinates>
   </gml:LinearRing>
   </gml:outerBoundaryIs>
- <gml:innerBoundaryIs>
- <gml:LinearRing>
   <gml:coordinates>0.500000,45.500000 1.500000,45.500000  
1.500000,46.500000 0.500000,46.500000  
0.500000,45.500000</gml:coordinates>
   </gml:LinearRing>
   </gml:innerBoundaryIs>
   </gml:Polygon>
   </gml:polygonMember>
   </gml:MultiPolygon>
   </ms:msGeometry>
   <ms:ogc_fid>3</ms:ogc_fid>
   <ms:name>my polygon with hole</ms:name>
   <ms:id>3</ms:id>
   </ms:polygon>
   </gml:featureMember>
   </wfs:FeatureCollection>


More information about the Spanish mailing list