Advertisement
Guest User

Untitled

a guest
Dec 13th, 2011
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.42 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4.     <head>
  5.         <title>O meu primeiro mapa</title>
  6.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  7.         <script src="http://openlayers.org/api/OpenLayers.js"></script>
  8.         <script type="text/javascript">
  9.             var map;
  10.             function init() {
  11.  
  12.                 var bounds = new OpenLayers.Bounds(
  13.                 -15699, 188532, -13689, 190828);
  14.  
  15.                 var options = {
  16.                     controls: [ new OpenLayers.Control.Navigation(),
  17.                                         new OpenLayers.Control.PanZoom(),
  18.                                         new OpenLayers.Control.LayerSwitcher()],
  19.                     maxExtent: bounds,
  20.                     maxResolution: 9.61328125,
  21.                     projection: "EPSG:4326",
  22.                     units: 'm'
  23.  
  24. };
  25.  
  26.                 map = new OpenLayers.Map('map', options);
  27.                 wms_ruas = new OpenLayers.Layer.WMS( 'ruas',
  28.                 'http://localhost:8080/geoserver/wms',{
  29.                 format: 'image/png',
  30.                 layers: 'ruas'},{
  31.                 projection: 'map.getProjectionObject()',
  32.                 reproject: 'True',
  33.                 projection: new OpenLayers.Projection('4326'),
  34.                 unit: 'm'});
  35.  
  36.  
  37.  
  38.                
  39.                 map.addLayer(wms_ruas);
  40.                 if(!map.getCenter()) {
  41.                     map.zoomToMaxExtent();
  42.                 }
  43.             }
  44.         </script>
  45.     </head>
  46.     <body onload='init();'>
  47.         <h1>Mapa mundo</h1>
  48.         <div id='map' style='width: 500px; height: 500px;'>
  49.         </div>
  50.     </body>
  51. </html>
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement