This page last changed on Dec 18, 2007 by aaime.

OpenLayers is a pure JavaScript library for displaying map data in most modern web browsers, with no server-side dependencies. It supports WMS layers.

OpenLayers implements a (still-developing) JavaScript API for building rich web-based geographic applications, similar to the Google Maps and MSN Virtual Earth APIs, with one important difference – OpenLayers is Free Software, developed for and by the Open Source software community.

Sample

This code shows how to add GeoServer 1. WMS layers to OpenLayers maps. Inlcude this code in your HTML pages.

<html>
<head>
<script src="http://openlayers.org/api/OpenLayers.js"></script>
</head>
<body>

...

<script defer="defer" type="text/javascript">
  var map = new OpenLayers.Map('map');
  var wms = new OpenLayers.Layer.WMS("Curva de Nivel",
                                     "http://sig.cas.gov.co:9999/geoserver/wms?service=wms",
                                     {layers: 'basica25:capa_6101_curva_de_nivel'}
                                     );
  map.addLayer(wms);
  map.addControl(new OpenLayers.Control.LayerSwitcher());
  map.zoomToFullExtent();
</script>

...

</body>
</html>

External Links

Document generated by Confluence on Jan 16, 2008 23:28