From fa448951d9802f616db7e34f941084abcf5bd75f Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 5 Mar 2013 16:46:55 +0100 Subject: [PATCH] Add simple example --- examples/simple.html | 46 ++++++++++++++++++++++++++++++++++++++++++++ examples/simple.js | 22 +++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 examples/simple.html create mode 100644 examples/simple.js diff --git a/examples/simple.html b/examples/simple.html new file mode 100644 index 0000000000..adb949a11d --- /dev/null +++ b/examples/simple.html @@ -0,0 +1,46 @@ + + + + + + + + + + Simple example + + + + + +
+ +
+
+
+
+
+ +
+ +
+

Simple example

+

Example of a simple map.

+
+

See the simple.js source to see how this is done.

+
+
simple, openstreetmap
+
+ +
+ + + + + diff --git a/examples/simple.js b/examples/simple.js new file mode 100644 index 0000000000..f71042eeb0 --- /dev/null +++ b/examples/simple.js @@ -0,0 +1,22 @@ +goog.require('ol.Collection'); +goog.require('ol.Coordinate'); +goog.require('ol.Map'); +goog.require('ol.RendererHints'); +goog.require('ol.View2D'); +goog.require('ol.layer.TileLayer'); +goog.require('ol.source.OpenStreetMap'); + + +var map = new ol.Map({ + layers: new ol.Collection([ + new ol.layer.TileLayer({ + source: new ol.source.OpenStreetMap() + }) + ]), + renderers: ol.RendererHints.createFromQueryData(), + target: 'map', + view: new ol.View2D({ + center: new ol.Coordinate(0, 0), + zoom: 2 + }) +});