[Spanish] (no subject)

José Luis Mateos joseluismateos90 at gmail.com
Fri Sep 7 05:47:36 PDT 2012


Hola a todos!

Estoy intentando hacer un web gis muy simple para poner en una página web
de divulgación donde se visualice un mapa físico y unos yacimientos
arqueológicos. He conseguido que se viese el basemap de google maps pero
los yacimientos, provienen de una base de datos PostGIS, sólo se ven cuando
el mapa base está en la máxima extensión. Además me gustaría que al clicar
los yacimientos se viese la información en PostGIS de ellos, cual es el
comando para ello? os copio el código html, serías muy amables si me
ayudaseis!

Muchísimas gracias

<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
 <title>NoGAP archaeological project</title>
 <script type='text/javascript' src='OpenLayers.js'></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false
"></script>
 <style type="text/css">
#tituloPagina {
font-family: Verdana, calibri;
 font-size: 1.2em;
font-weight: normal;
color: #FF696969;
 }
body {
                font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
                font-size: small;
        }
#map_element {
            clear: both;
            position: relative;
            width: 1000px;
            height: 491px;
            border: ;
            }
 #wrapper {
                width: 512px;
            }

            #location {
                float: middle;
            }

            #options {
                position: absolute;
                left: 13px;
                top: 7px;
                z-index: 3000;
            }
 /* Styles used by the default GetFeatureInfo output, added to make IE
happy */
            table.featureInfo, table.featureInfo td, table.featureInfo th {
                border: 1px solid #ddd;
                border-collapse: collapse;
                margin: 0;
                padding: 0;
                font-size: 90%;
                padding: .2em .1em;
            }

            table.featureInfo th {
                padding: .2em .2em;
                text-transform: uppercase;
                font-weight: bold;
                background: #eee;
            }

            table.featureInfo td {
                background: #fff;
            }

            table.featureInfo tr.odd td {
                background: #eee;
            }

            table.featureInfo caption {
                text-align: left;
                font-size: 100%;
                font-weight: bold;
                text-transform: uppercase;
                padding: .2em .2em;
            }
</style>
 <script type='text/javascript'>

var map;
 function init() {
 var bounds = new OpenLayers.Bounds(
14000, 305900,
 277000, 610500
);
  var overview = new OpenLayers.Control.OverviewMap({
size: new OpenLayers.Size(400, 200),
projection: new OpenLayers.Projection("EPSG:4326"),
 units: "m",
maxResolution: 610,
maxExtent: bounds,
 restrictedExtent: bounds
});
 map = new OpenLayers.Map('map_element', {});
 var gphy = new OpenLayers.Layer.Google(
"Google Physical",
{type: google.maps.MapTypeId.TERRAIN}
 // used to be {type: G_PHYSICAL_MAP}
);
var gmap = new OpenLayers.Layer.Google(
 "Google Streets", // the default
{numZoomLevels: 20}
// default type, no change needed here
 );
var ghyb = new OpenLayers.Layer.Google(
"Google Hybrid",
 {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
// used to be {type: G_HYBRID_MAP, numZoomLevels: 20}
 );
var gsat = new OpenLayers.Layer.Google(
"Google Satellite",
 {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
// used to be {type: G_SATELLITE_MAP, numZoomLevels: 22}
 );
 var nogap = new OpenLayers.Layer.WMS(
'NoGAP Settlements',
 'http://localhost:8080/geoserver/NoGAP_webgis/wms',
 {layers: 'NoGAP_webgis:NoGAP_Sites_oct2011',
tiled: true,
inRange: true,
 format: "image/png",
displayOutsideMaxExtent: false,
singleTile: true,
 transparent: true,
maxExtent: bounds,
tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom,
 transitionEffect: true},
{visibility: true, opacity:1},
{isBaseLayer:false}
 );
  map.addLayers([nogap, gphy, gmap, ghyb, gsat]);
map.addControl(new OpenLayers.Control.LayerSwitcher({}));
 map.addControl(new OpenLayers.Control.Navigation());
            map.addControl(new OpenLayers.Control.Scale($('scale')));
map.addControl (new OpenLayers.Control.Attribution());
 map.addControl (new OpenLayers.Control.ArgParser());
map.addControl(new OpenLayers.Control.MousePosition({element:
$('location')}));
 map.addControl (overview);
if(!map.getCenter()){
map.zoomToMaxExtent();
  map.setCenter(new OpenLayers.LonLat( 71,23 ).transform(
        new OpenLayers.Projection("EPSG:4326"),
         map.getProjectionObject()
    ), 7);
     }
}

</script>
</head>

<body onload='init();'>
<p id="tituloPagina">NoGAP archaeological survey</p>
<div id='map_element' style='width: 1000px; height: 500px;'>
 </div>
</body>
</html>

-- 
José Luis Mateos González
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/spanish/attachments/20120907/41058b67/attachment.html>


More information about the Spanish mailing list