Openlayers e WMS Emilia Romagna

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Openlayers e WMS Emilia Romagna

albertobonati
Salve a tutti.

Sto provando ad aggiungere con openlayers, senza successo, il seguente
layer WMS della regione Emilia Romagna in una pagina html:

http://servizigis.regione.emilia-romagna.it/wms/dbtr2008_ctr5

altri layers del PCN, descritti in questo modo:

var igm25 = new OpenLayers.Layer.WMS( "PCN IGM 25K",
"http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/IGM_25000.map",
{layers: 'CB.IGM25000'} );

funzionano benissimo....

Premetto, non sono un esperto, solo un pasticcione!!!

grazie

alberto
_______________________________________________
[hidden email]
http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss
Questa e' una lista di discussione pubblica aperta a tutti.
Non inviate messaggi commerciali.
I messaggi di questa lista non hanno relazione diretta con le posizioni dell'Associazione GFOSS.it.
605 iscritti al 10.7.2012
Reply | Threaded
Open this post in threaded view
|

Re: Openlayers e WMS Emilia Romagna

francesco marucci-2
Ciao,
credo che dipenda dal sistema di riferimento che hai configurato nella tua mappa.
se chiedi il file di capabilities di quel servizio wms ottieni esattamente i codici epsg con i quali viene esposto: ad esempio il web mercator non è il canonico 900913 ma il 102113 (a causa di esri).

se ci mandi il pezzetto di codice cha hai scritto ti sappiamo dire di più.

saluti,
francesco

Il giorno 26/set/2012, alle ore 15:43, "[hidden email]" <[hidden email]> ha scritto:

> Salve a tutti.
>
> Sto provando ad aggiungere con openlayers, senza successo, il seguente layer WMS della regione Emilia Romagna in una pagina html:
>
> http://servizigis.regione.emilia-romagna.it/wms/dbtr2008_ctr5
>
> altri layers del PCN, descritti in questo modo:
>
> var igm25 = new OpenLayers.Layer.WMS( "PCN IGM 25K",
> "http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/IGM_25000.map", {layers: 'CB.IGM25000'} );
>
> funzionano benissimo....
>
> Premetto, non sono un esperto, solo un pasticcione!!!
>
> grazie
>
> alberto
> _______________________________________________
> [hidden email]
> http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss
> Questa e' una lista di discussione pubblica aperta a tutti.
> Non inviate messaggi commerciali.
> I messaggi di questa lista non hanno relazione diretta con le posizioni dell'Associazione GFOSS.it.
> 605 iscritti al 10.7.2012
_______________________________________________
[hidden email]
http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss
Questa e' una lista di discussione pubblica aperta a tutti.
Non inviate messaggi commerciali.
I messaggi di questa lista non hanno relazione diretta con le posizioni dell'Associazione GFOSS.it.
605 iscritti al 10.7.2012
Reply | Threaded
Open this post in threaded view
|

Re: Openlayers e WMS Emilia Romagna

albertobonati
Ecco qua.

con il PCN funziona, EPSG:4326 dovrebbe essere supportato da ER...



<html>
<head>
    <title>OSM Local Tiles</title>
    <link rel="stylesheet" href="style.css" type="text/css" />
    <!-- bring in the OpenLayers javascript library
         (here we bring it from the remote site, but you could
         easily serve up this javascript yourself) -->
    <script src="OpenLayers.js"></script>
 
    <!-- bring in the OpenStreetMap OpenLayers layers.
         Using this hosted file will make sure we are kept up
         to date with any necessary changes -->
    <script src="OpenStreetMap.js"></script>
 
    <script type="text/javascript">
// Start position for the map (hardcoded here for simplicity)
        var lat=44.32;
        var lon=11.60;
        var zoom=11;
 
        var map; //complex object of type OpenLayers.Map
 
        //Initialise the 'map' object
        function init() {
 
            map = new OpenLayers.Map ("map", {
                controls:[
                    new OpenLayers.Control.Navigation(),
                    new OpenLayers.Control.PanZoomBar(),
                    new OpenLayers.Control.Permalink(),
                    new OpenLayers.Control.ScaleLine(),
                    new OpenLayers.Control.Permalink('permalink'),
                    new OpenLayers.Control.MousePosition(),                   
                    new OpenLayers.Control.Attribution()],
                //maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
                //maxResolution: 156543.0399,
                numZoomLevels: 19,
                //units: 'm',
                projection: new OpenLayers.Projection("EPSG:4326"),
              displayProjection: new OpenLayers.Projection("EPSG:4326")
            } );
      
            var igm25 = new OpenLayers.Layer.WMS( "PCN IGM 25K",
                   "http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/IGM_25000.map", {layers: 'CB.IGM25000'} );

            var ER = new OpenLayers.Layer.WMS( "Multiscala ER",
                   <a class="moz-txt-link-rfc2396E" href="http://servizigis.regione.emilia-romagna.it/wms/dbtr2008_ctr5?&amp;REQUEST=GetMap,{layers:'2'}">" http://servizigis.regione.emilia-romagna.it/wms/dbtr2008_ctr5?&REQUEST=GetMap, {layers: '2'}");
 
            map.addLayers([igm25, ER]);
           
             map.addControl(new OpenLayers.Control.LayerSwitcher());
           
            // This is the end of the layer
 
           if( ! map.getCenter() ){
                var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
            map.setCenter (lonLat, zoom);
           }
        }
 
    </script>
</head>
 
<!-- body.onload is called once the page is loaded (call the 'init' function) -->
<body onload="init();">
 
    <!-- define a DIV into which the map will appear. Make it take up the whole window -->
    <div style="width:100%; height:100%" id="map"></div>
 
</body>
 
</html>


Scrittoo son parole grosse...diciamo scopiazzato qua e la....
Ciao

Alberto



_______________________________________________
[hidden email]
http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss
Questa e' una lista di discussione pubblica aperta a tutti.
Non inviate messaggi commerciali.
I messaggi di questa lista non hanno relazione diretta con le posizioni dell'Associazione GFOSS.it.
605 iscritti al 10.7.2012