diff --git a/examples/tissot.html b/examples/tissot.html new file mode 100644 index 0000000000..2557eba84f --- /dev/null +++ b/examples/tissot.html @@ -0,0 +1,51 @@ + + + + + + + + + + + Tissot indicatrix example + + + + + +
+ +
+
+
+
+
+ +
+ +
+

Tissot indicatrix example

+

Example of a Tissot indicatrix map.

+
+

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

+
+
tissot, circle
+
+ +
+ +
+ + + + + + + diff --git a/examples/tissot.js b/examples/tissot.js new file mode 100644 index 0000000000..909df77ae3 --- /dev/null +++ b/examples/tissot.js @@ -0,0 +1,44 @@ +goog.require('ol.Feature'); +goog.require('ol.Map'); +goog.require('ol.View2D'); +goog.require('ol.layer.Tile'); +goog.require('ol.layer.Vector'); +goog.require('ol.source.TileWMS'); +goog.require('ol.source.Vector'); +goog.require('ol.sphere.WGS84'); + +var vectorSource = new ol.source.Vector(); + +var map = new ol.Map({ + layers: [ + new ol.layer.Tile({ + source: new ol.source.TileWMS({ + url: 'http://vmap0.tiles.osgeo.org/wms/vmap0', + params: { + 'VERSION': '1.1.1', + 'LAYERS': 'basic', + 'FORMAT': 'image/jpeg' + } + }) + }), + new ol.layer.Vector({ + source: vectorSource + }) + ], + renderer: 'canvas', + target: 'map', + view: new ol.View2D({ + projection: 'EPSG:4326', + center: [0, 0], + zoom: 2 + }) +}); + + +var radius = 800000; +for (var x = -180; x < 180; x += 30) { + for (var y = -90; y < 90; y += 30) { + var geometry = ol.sphere.WGS84.circle([x, y], radius, 64); + vectorSource.addFeature(new ol.Feature(geometry)); + } +} diff --git a/src/ol/sphere/sphere.exports b/src/ol/sphere/sphere.exports new file mode 100644 index 0000000000..3d47177b3b --- /dev/null +++ b/src/ol/sphere/sphere.exports @@ -0,0 +1 @@ +@exportProperty ol.Sphere.prototype.circle diff --git a/src/ol/sphere/wgs84sphere.exports b/src/ol/sphere/wgs84sphere.exports new file mode 100644 index 0000000000..955afd150b --- /dev/null +++ b/src/ol/sphere/wgs84sphere.exports @@ -0,0 +1 @@ +@exportSymbol ol.sphere.WGS84