title: OpenLayers 3 : Drawing a polygon feature over the dateline
body: <p>I am attempting to draw a simple box polygon that overlaps the international dateline.  Currently when creating the polygon it wraps in the opposite direction.</p>
  
  <p>Full example : <a href="http://jsfiddle.net/mcroteau/dkk2yu3L/" rel="nofollow noreferrer">http://jsfiddle.net/mcroteau/dkk2yu3L/</a></p>
  
  <p><strong>Desired Output :</strong></p>
  
  <p><a href="https://i.stack.imgur.com/DJzHh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DJzHh.jpg" alt="Desired Polygon"></a></p>
  
  <p><strong>Actual Output :</strong></p>
  
  <p><a href="https://i.stack.imgur.com/tUGLk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tUGLk.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Javascript:</strong> </p>
  
  <pre><code>var wgs84Proj = new ol.proj.Projection({ code : "EPSG:4326" });
  var origProj = new ol.proj.Projection({ code : "EPSG:900913" });
  
  var mapTile = new ol.layer.Tile({
      source: new ol.source.OSM()
  });
  
  
  var convertedCoordinates = [];            
  var unformattedCoordinates = [[175, 70], [175, 60], [-160, 60], [-160, 70]];
  
  
  $(unformattedCoordinates).each(function(index, coordinate){
      var lat = coordinate[0];
      var lon = coordinate[1];
  
      var circle = new ol.geom.Circle([lat, lon])
      circle.transform(wgs84Proj, origProj);
  
      convertedCoordinates.push(circle.getCenter());
  });
  
  var polygonGeometry = new ol.geom.Polygon([convertedCoordinates])
  var polygonFeature = new ol.Feature({ geometry : polygonGeometry });
  
  var vectorSource = new ol.source.Vector();
  vectorSource.addFeature(polygonFeature);
  
  var vectorLayer = new ol.layer.Vector({
      source: vectorSource
  }); 
  
  
  var mapView = new ol.View({
      center: [-19000000, 9500000],
      zoom: 3
  })
  
  var map = new ol.Map({
      layers : [mapTile],
      target : 'map',
      view   : mapView
  });
  
  map.addLayer(vectorLayer);
  </code></pre>
  
  <p>I'm not sure if there is a config setting that I missed in the OpenLayers 3 API or a conversion that must be made on the data points.  Any guidance would be most appreciated.</p>
  
  <p><strong>Updated Working Example</strong></p>
  
  <p><a href="http://jsfiddle.net/mcroteau/edt92p23/" rel="nofollow noreferrer">http://jsfiddle.net/mcroteau/edt92p23/</a></p>