Module talk:Coordinates/sandbox

Latest comment: 1 year ago by Sarang in topic Why not

Examples

edit

Functions:

  • deg2dms(degree, degree_precision, language)
  • {{#invoke:Coordinates/sandbox| deg2dms | 12.3456789}} will display "12° 20′ 44.44″"
  • {{#invoke:Coordinates/sandbox| deg2dms | 12.3456789 |1}} will display "12°"
  • {{#invoke:Coordinates/sandbox| deg2dms | 12.3456789 |1e-1}} will display "12° 21′"
  • {{#invoke:Coordinates/sandbox| deg2dms | 12.3456789 |1e-3}} will display "12° 20′ 44″"
  • {{#invoke:Coordinates/sandbox| deg2dms | 12.3456789 |1e-4}} will display "12° 20′ 44.4″"
  • {{#invoke:Coordinates/sandbox| deg2dms | 12.3456789 |1e-5}} will display "12° 20′ 44.44″"
  • lat_lon
  • {{#invoke:Coordinates/sandbox| lat_lon | lat=51.48 | lon=0}} will display "51° 28′ 48″ N, 0° 00′ 00″ E"
  • GeoHack_link
  • externalLinksSection
    {{#invoke:Coordinates/sandbox| externalLinksSection | globe = Earth| lat=51.48 | lon=0 | lang=en | namespace=File}} displays "OpenStreetMap"
  • {{#invoke:Coordinates/sandbox| externalLinksSection | globe = Earth| lat=51.48 | lon=0 | lang=en | namespace=Category}} displays "OpenStreetMap"
  • {{#invoke:Coordinates/sandbox| externalLinksSection | globe = Earth| lat=51.48 | lon=0 | lang=ru | namespace=Category}} displays "OpenStreetMap"
  • {{#invoke:Coordinates/sandbox| externalLinksSection | globe = Mars| lat=51.48 | lon=0 | lang=en | namespace=File}} displays "Google Maps"
  • {{#invoke:Coordinates/sandbox| externalLinksSection | globe = Moon| lat=51.48 | lon=0 | lang=en | namespace=File}} displays "Google Maps"
  • LocationTemplateCore
  • {{#invoke:Coordinates/sandbox| LocationTemplateCore | globe = Earth| lat=51.48 | lon=0 | lang=en | namespace=File| attributes=elevation:10_heading:W | mode=camera | bare = 1| secondary=1}} displays "
    51° 28′ 48″ N, 0° 00′ 00″ E     View all coordinates using: OpenStreetMap 
    "
  • {{#invoke:Coordinates/sandbox| LocationTemplateCore | globe = Earth| lat=51.48 | lon=0 | lang=en | namespace=File| attributes=elevation:10_heading:W | mode=camera | bare = 0| secondary=1}} displays "
    Camera location51° 28′ 48″ N, 0° 00′ 00″ E     View all coordinates using: OpenStreetMap 
    "
    • {{#invoke:Coordinates/sandbox| LocationTemplateCore | globe = Earth| lat=51.48 | lon=0 | lang=en | namespace=File| attributes=elevation:10_heading:W | mode=camera | bare = 0}} displays
    Camera location51° 28′ 48″ N, 0° 00′ 00″ E     View all coordinates using: OpenStreetMap 
    • {{#invoke:Coordinates/sandbox| LocationTemplateCore | globe = Earth| lat=51.48 | lon=0 | lang=en | namespace=File| attributes=elevation:10_heading:W | mode=camera | heading_style=north}} displays
    Camera location51° 28′ 48″ N, 0° 00′ 00″ E     View all coordinates using: OpenStreetMap 
    • {{#invoke:Coordinates/sandbox| LocationTemplateCore | globe = Earth| lat=51.48 | lon=0 | lang=en | namespace=File| attributes=elevation:10_heading:W | mode=camera | link_style=icons}} displays
    Camera location51° 28′ 48″ N, 0° 00′ 00″ E     View all coordinates using: OpenStreetMap 

    See testcases to see more examples.



    Why not

    edit

    shorten the table defs ? (all linefeeds etc. are contained in the following source code)
    stmt 114ff: -- files to use for different headings local heading_icon = { [ 1] = 'N', [ 2] = 'NbE', [ 3] = 'NNE', [ 4] = 'NEbN', [ 5] = 'NE', [ 6] = 'NEbE', [ 7] = 'ENE', [ 8] = 'EbN', [ 9] = 'E', [10] = 'EbS', [11] = 'ESE', [12] = 'SEbE', [13] = 'SE', [14] = 'SEbS', [15] = 'SSE', [16] = 'SbE', [17] = 'S', [18] = 'SbW', [19] = 'SSW', [20] = 'SWbS', [21] = 'SW', [22] = 'SWbW', [23] = 'WSW', [24] = 'WbS', [25] = 'W', [26] = 'WbN', [27] = 'WNW', [28] = 'NWbW', [29] = 'NW', [30] = 'NWbN', [31] = 'NNW', [32] = 'NbW' }

    stmt 857: local fname = 'File:Compass-icon bb ' .. heading_icon[k] .. '.svg'

    -- sarang사랑 11:51, 16 October 2022 (UTC)Reply

Return to "Coordinates/sandbox" page.