Advertisement
xurxosanz

Guguel + Castastro in Spain WMS with Open Layers

Jun 12th, 2011
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.65 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5.     <link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css" type="text/css">
  6.     <link rel="stylesheet" href="http://openlayers.org/dev/examples/style.css" type="text/css">
  7.     <script src="http://openlayers.org/dev/OpenLayers.js" type="text/javascript"></script>  
  8.    
  9.     <!-- es el de openlayers dev pero hoygan, por un momentin... -->
  10.     <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
  11.    
  12.     <script type="text/javascript">
  13.         var map;
  14.         function init(){
  15.           map = new OpenLayers.Map('map');
  16.           map.addLayer(new OpenLayers.Layer.Google("Guguel",{type: G_PHYSICAL_MAP}));
  17.           map.addLayer( new OpenLayers.Layer.WMS(
  18.             "WMS Catastro",
  19.             "http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx",
  20.             {
  21.               layers: "catastro",
  22.               format:"image/png",
  23.               transparent: true              
  24.             },
  25.             {
  26.               singleTile:true,
  27.               isBaseLayer: false,
  28.               reproject: true //you'll love OL because of this
  29.             }));
  30.  
  31.           map.setCenter(new OpenLayers.LonLat(-2, 39), 5);    
  32.           map.addControl(new OpenLayers.Control.LayerSwitcher());
  33.           map.addControl(new OpenLayers.Control.MousePosition());          
  34.         }
  35.     </script>
  36.   </head>
  37.   <body onload="init()">
  38.     <div id="map" class="smallmap"></div>
  39.   </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement