From 1284b71bbc4da13ca9df1e724db1885f4446355f Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 16 Sep 2010 20:34:49 +0000 Subject: [PATCH] Updating basic example. git-svn-id: http://svn.openlayers.org/trunk/openlayers@10754 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/example.html | 77 ++++++++++++------------------------------- examples/example.js | 23 +++++++++++++ 2 files changed, 44 insertions(+), 56 deletions(-) create mode 100644 examples/example.js diff --git a/examples/example.html b/examples/example.html index c10bbcef79..108f812313 100644 --- a/examples/example.html +++ b/examples/example.html @@ -1,57 +1,22 @@ - - - OpenLayers Example - - - - - - -

OpenLayers Example

-
- simple, basic -
-

- Demonstrate a simple map with an overlay that includes layer switching controls. -

-
-
- + + + + OpenLayers Example + + + + +

OpenLayers Example

+
simple, basic
+

+ Demonstrate a simple map with an overlay that includes layer switching controls. +

+
+
+

This is a basic example demonstrating the use of a map with two layers and a few controls.

+

View the example.js source to see how this is done.

+
+ + + diff --git a/examples/example.js b/examples/example.js new file mode 100644 index 0000000000..d02e530b45 --- /dev/null +++ b/examples/example.js @@ -0,0 +1,23 @@ +var map = new OpenLayers.Map("map"); + +var ol_wms = new OpenLayers.Layer.WMS( + "OpenLayers WMS", + "http://vmap0.tiles.osgeo.org/wms/vmap0", + {layers: "basic"} +); + +var dm_wms = new OpenLayers.Layer.WMS( + "Canadian Data", + "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap", + { + layers: "bathymetry,land_fn,park,drain_fn,drainage," + + "prov_bound,fedlimit,rail,road,popplace", + transparent: "true", + format: "image/png" + }, + {isBaseLayer: false, visibility: false} +); + +map.addLayers([ol_wms, dm_wms]); +map.addControl(new OpenLayers.Control.LayerSwitcher()); +map.zoomToMaxExtent();