Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>O meu primeiro mapa</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <script src="http://openlayers.org/api/OpenLayers.js"></script>
- <script type="text/javascript">
- var map;
- function init() {
- var bounds = new OpenLayers.Bounds(
- -15699, 188532, -13689, 190828);
- var options = {
- controls: [ new OpenLayers.Control.Navigation(),
- new OpenLayers.Control.PanZoom(),
- new OpenLayers.Control.LayerSwitcher()],
- maxExtent: bounds,
- maxResolution: 9.61328125,
- projection: "EPSG:4326",
- units: 'm'
- };
- map = new OpenLayers.Map('map', options);
- wms_ruas = new OpenLayers.Layer.WMS( 'ruas',
- 'http://localhost:8080/geoserver/wms',{
- format: 'image/png',
- layers: 'ruas'},{
- projection: 'map.getProjectionObject()',
- reproject: 'True',
- projection: new OpenLayers.Projection('4326'),
- unit: 'm'});
- map.addLayer(wms_ruas);
- if(!map.getCenter()) {
- map.zoomToMaxExtent();
- }
- }
- </script>
- </head>
- <body onload='init();'>
- <h1>Mapa mundo</h1>
- <div id='map' style='width: 500px; height: 500px;'>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement