diff --git a/examples/graticule.html b/examples/graticule.html new file mode 100644 index 0000000000..c0852ebac6 --- /dev/null +++ b/examples/graticule.html @@ -0,0 +1,51 @@ + + + + + + + + + + + Graticule example + + + + + +
+ +
+
+
+
+
+ +
+ +
+

Graticule example

+

This example shows how to add a graticule overlay to a map.

+
+

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

+
+
graticule
+
+ +
+ +
+ + + + + + + diff --git a/examples/graticule.js b/examples/graticule.js new file mode 100644 index 0000000000..929725a37b --- /dev/null +++ b/examples/graticule.js @@ -0,0 +1,25 @@ +goog.require('ol.Graticule'); +goog.require('ol.Map'); +goog.require('ol.View'); +goog.require('ol.layer.Tile'); +goog.require('ol.proj'); +goog.require('ol.source.OSM'); + + +var map = new ol.Map({ + layers: [ + new ol.layer.Tile({ + source: new ol.source.OSM() + }) + ], + renderer: 'canvas', + target: 'map', + view: new ol.View({ + center: ol.proj.transform([4.8, 47.75], 'EPSG:4326', 'EPSG:3857'), + zoom: 5 + }) +}); + +// Create the graticule component +var graticule = new ol.Graticule(); +graticule.setMap(map);