title: How do I rotate the complete view in Openlayers?
body: <p>I have a map I have created in QGIS 3.8. It is using OSM as the base map and I have a simple raster layer which is a georeferenced map.</p>
  
  <p>QGIS has a useful plugin qgis2web that exports a complete set of files for Openlayers (and Leaflet).</p>
  
  <p>Once in Openlayer format and viewed in a browser it is possible to rotate the complete view to rotate say the north-point 40 degrees (i.e. about 0.7 Radians) east by using Alt+Shift+Drag. You can see a demo of this working here: <a href="https://openlayers.org/en/latest/examples/rotation.html" rel="nofollow noreferrer">https://openlayers.org/en/latest/examples/rotation.html</a></p>
  
  <p>What I am trying to do is to modify the generated code to show the map already rotated to the required angle. (This is because the georeferenced map does not have its north point at the top of the page.)</p>
  
  <p>This is the layers.js code that I am trying to modify, presumably, I need a rotation: 0.7 but I cannot figure out where!</p>
  
  <hr>
  
  <p>var wms_layers = [];</p>
  
  <pre><code>    var lyr_OpenStreetMap_0 = new ol.layer.Tile({
          'title': 'OpenStreetMap',
          'type': 'base',
          'opacity': 1.000000,
  
  
          source: new ol.source.XYZ({
  attributions: '&lt;a href=""&gt;&lt;/a&gt;',
              url: 'http://a.tile.openstreetmap.org/{z}/{x}/{y}.png'
          })
      });var lyr_MyMap = new ol.layer.Image({
                          opacity: 1,
                          title: "King's Park",
  
  
                          source: new ol.source.ImageStatic({
                             url: "./layers/MyMap.png",
  attributions: '&lt;a href=""&gt;&lt;/a&gt;',
                              projection: 'EPSG:3857',
                              alwaysInRange: true,
                              imageExtent: [-100073.533268, 6847294.601171, -93832.319311, 6852417.437192]
                          })
                      });
  
  lyr_OpenStreetMap_0.setVisible(true);lyr_MyMap.setVisible(true);
  var layersList = [lyr_OpenStreetMap_0,lyr_MyMap];
  </code></pre>
  
  <hr>