You are here

public function GeofieldFormatterTest::latLonFormatterProvider in Geofield 8

Provides test data for testLatLonFormatter().

File

tests/src/Kernel/GeofieldFormatterTest.php, line 106

Class

GeofieldFormatterTest
Tests the geofield formatters functionality.

Namespace

Drupal\Tests\geofield\Kernel

Code

public function latLonFormatterProvider() {
  return [
    'DMS Value' => [
      'POINT (40 -3)',
      'dms',
      "<span class=\"dms dms-lat\">\n    3°\n    0'\n          0\"\n        S\n  </span>\n      ,\n    <span class=\"dms dms-lon\">\n    40°\n    0'\n          0\"\n        E\n  </span>",
    ],
    'DM Value' => [
      'POINT (40 -3)',
      'dm',
      "<span class=\"dms dms-lat\">\n    3°\n    0.00000'\n        S\n  </span>\n      ,\n    <span class=\"dms dms-lon\">\n    40°\n    0.00000'\n        E\n  </span>",
    ],
    'LatLon Value' => [
      'POINT (40 -3)',
      'decimal',
      '<span class="latlon latlon-lat">-3</span>, <span class="latlon latlon-lon">40</span>',
    ],
    'DMS Value long' => [
      'POINT (85.24587 45.625358)',
      'dms',
      "<span class=\"dms dms-lat\">\n    45°\n    37'\n          31\"\n        N\n  </span>\n      ,\n    <span class=\"dms dms-lon\">\n    85°\n    14'\n          45\"\n        E\n  </span>",
    ],
    'DM Value long' => [
      'POINT (85.24587 45.625358)',
      'dm',
      "<span class=\"dms dms-lat\">\n    45°\n    37.51667'\n        N\n  </span>\n      ,\n    <span class=\"dms dms-lon\">\n    85°\n    14.75000'\n        E\n  </span>",
    ],
    'LatLon Value long' => [
      'POINT (85.24587 45.625358)',
      'decimal',
      '<span class="latlon latlon-lat">45.625358</span>, <span class="latlon latlon-lon">85.24587</span>',
    ],
    'DMS Arnedo' => [
      'POINT (-2.1021 42.2257)',
      'dms',
      "<span class=\"dms dms-lat\">\n    42°\n    13'\n          33\"\n        N\n  </span>\n      ,\n    <span class=\"dms dms-lon\">\n    2°\n    6'\n          8\"\n        W\n  </span>",
    ],
    'DM Arnedo' => [
      'POINT (-2.1021 42.2257)',
      'dm',
      "<span class=\"dms dms-lat\">\n    42°\n    13.55000'\n        N\n  </span>\n      ,\n    <span class=\"dms dms-lon\">\n    2°\n    6.13333'\n        W\n  </span>",
    ],
    'Decimal Arnedo' => [
      'POINT (-2.1021 42.2257)',
      'decimal',
      '<span class="latlon latlon-lat">42.2257</span>, <span class="latlon latlon-lon">-2.1021</span>',
    ],
    'Polygon' => [
      'POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))',
      'wkt',
      'POINT (25.454545454545 26.969696969697)',
    ],
  ];
}