Difference between revisions of "Template:Location"

From Wayne County, Ohio Online Resource Center
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>{{#arraydefine: mapaddr
 
<includeonly>{{#arraydefine: mapaddr
   |{{#arraymap: Street,City,State|,|@@@|{{#if: {{{@@@|}}}|{{{@@@|}}}, }}|}}{{{Country|United States of America}}}
+
   |{{#arraymap: Street,City,Zipcode,State|,|@@@|{{#if: {{{@@@|}}}|{{{@@@|}}}, }}|}}{{{Country|United States of America}}}
 
   |*
 
   |*
}}<!-- -->{{#subobject:
+
}}<!-- -->{{#vardefine: geo|{{#geocode:location={{{Building number|}}} {{#arrayprint: mapaddr|*}}|format=float|directional=no}}}}<!-- -->{{#subobject:
 
  |Is primary={{{Is primary|}}}
 
  |Is primary={{{Is primary|}}}
 
  |Address label={{{Address label|}}}
 
  |Address label={{{Address label|}}}
Line 17: Line 17:
 
  |Note={{{Note|}}}
 
  |Note={{{Note|}}}
 
  |Address string={{{Building number|}}} {{#arrayprint: mapaddr|*}}
 
  |Address string={{{Building number|}}} {{#arrayprint: mapaddr|*}}
  |Coordinates={{#if:{{{Latitude|}}} {{{Longitude|}}}|{{{Latitude|}}},{{{Longitude|}}}|{{#geocode:location={{{Building number|}}} {{#if:{{{Zipcode|}}}|{{{Street|}}}, {{{Zipcode}}}, {{{Country|United States of America}}}|{{#arrayprint: mapaddr|*}}}}|format=float|directional=no}}}}
+
  |Coordinates={{#if:{{{Latitude|}}} {{{Longitude|}}}
 +
    |{{{Latitude|}}},{{{Longitude|}}}
 +
    |{{#ifeq:{{#var:geo}}|Geocoding failed|{{#geocode:location={{{Zipcode|}}}, {{{State|}}}, {{{Country|United States of America}}}|format=float|directional=no}}}}
 +
  }}
 
}}.</includeonly>
 
}}.</includeonly>

Latest revision as of 17:12, 27 April 2023