Ejemplo n.º 1
0
 it("should compute longitude tick labels when dimension=lon", () => {
   const obj = new MercatorTickFormatter({dimension: 'lon'})
   for (const lat of [-72, -60.5, -30, -2, 1, -0.5, 0, 0.5, 1, 10, 33.7, 42.123, 50]) {
     for (const lon of [-120, -90, -88, -32.7, -10, -1, 0, 0.5, 1, 5, 12.3, 57, 60.123, 95, 110.1, 120, 130]) {
       const [mlon, mlat] = wgs84_mercator.forward([lon, lat])
       const labels = obj.doFormat([mlon], {loc: mlat})
       expect(labels[0]).to.equal(`${lon}`)
     }
   }
 })
Ejemplo n.º 2
0
 expect(() => obj.doFormat([30, 60, 90], {loc: 90})).to.throw(Error)
Ejemplo n.º 3
0
 it("should throw exception if dimension not configured", () => {
   const obj = new MercatorTickFormatter()
   expect(() => obj.doFormat([30, 60, 90], {loc: 90})).to.throw(Error)
 })