From 3e7cd5fffb9e1021553db2859ffcd4aab28eef51 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Wed, 6 Mar 2013 20:13:45 +0100 Subject: [PATCH] Add Bing Maps example --- examples/bing-maps.html | 52 +++++++++++++++++++++++++++++++++++++++++ examples/bing-maps.js | 26 +++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 examples/bing-maps.html create mode 100644 examples/bing-maps.js diff --git a/examples/bing-maps.html b/examples/bing-maps.html new file mode 100644 index 0000000000..1265dac5c3 --- /dev/null +++ b/examples/bing-maps.html @@ -0,0 +1,52 @@ + + + + + + + + + + Bing Maps example + + + + + +
+ +
+
+
+
+
+ +
+ +
+

Bing Maps example

+

Example of a Bing Maps layer.

+
+

See the bing-maps.js source to see how this is done.

+
+
bing, bing-maps
+
+ +
+ +
+ + + + + diff --git a/examples/bing-maps.js b/examples/bing-maps.js new file mode 100644 index 0000000000..d6372fe966 --- /dev/null +++ b/examples/bing-maps.js @@ -0,0 +1,26 @@ +goog.require('ol.Coordinate'); +goog.require('ol.Map'); +goog.require('ol.RendererHints'); +goog.require('ol.View2D'); +goog.require('ol.layer.TileLayer'); +goog.require('ol.projection'); +goog.require('ol.source.BingMaps'); + + +var map = new ol.Map({ + layers: [ + new ol.layer.TileLayer({ + source: new ol.source.BingMaps({ + key: 'AgtFlPYDnymLEe9zJ5PCkghbNiFZE9aAtTy3mPaEnEBXqLHtFuTcKoZ-miMC3w7R', + style: 'AerialWithLabels' + }) + }) + ], + renderers: ol.RendererHints.createFromQueryData(), + target: 'map', + view: new ol.View2D({ + center: ol.projection.transformWithCodes( + new ol.Coordinate(-123.1, 49.25), 'EPSG:4326', 'EPSG:3857'), + zoom: 8 + }) +});