Difference between revisions of "Template:Spot"
m (Using https for hitchwiki maps API) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude> | + | <includeonly>==== {{{title}}} ==== |
+ | {{#if: {{{mapID|}}} | {{#clear_external_data:}} | ||
+ | {{#get_web_data: url=https://hitchwiki.org/maps/api/?place={{{mapID}}}&who=HW_spot_template | ||
+ | |format=JSON | ||
+ | |data=lat=lat,lon=lon,link=link,rating=rating,exact_rating=exact_rating,ratingCount=rating_count,time=avg_textual,waitingCount=count | ||
+ | }} | ||
+ | '''[{{#external_value:link}}&zoom=16 Spot at the map]''' | ||
+ | • '''Hitchability:''' {{hitchability | {{#iferror: {{#expr: {{#external_value:exact_rating}} >= 1}} | {{#expr: 6 - {{#external_value:rating}} }} | {{#expr: ( 6 - {{#external_value:exact_rating}} ) round 1}}}}| {{#if: {{#for_external_table:{{{ratingCount}}} }} | {{#expr: ({{#for_external_table:+{{{ratingCount}}}}}) / 2}} | 1 }} }} | ||
+ | • '''Average waiting time:''' {{#ifeq: {{#external_value:time}} | Unknown | ''unknown'' | {{#external_value:time}} <sup>''based on {{#external_value:waitingCount}} experience{{#ifeq: 1 | {{#external_value:waitingCount}} ||s}}''</sup>}} | ||
+ | <!--• '''Gps coordinates:''' {{#external_value:lat}} {{#external_value:lon}}--><br /> | ||
+ | {{{description}}}<br /> | ||
+ | <!--"Comments:"-->{{#clear_external_data:}} | {{{description}}}}}</includeonly><noinclude> | ||
+ | == Under development == | ||
+ | This template is under development. Please suggest design. Comments from maps are planned to be added to the folding box under description. | ||
+ | |||
== How to use this Template? == | == How to use this Template? == | ||
− | + | === Option 1: Popular spot === | |
− | |||
<pre> | <pre> | ||
{{Spot | {{Spot | ||
− | | | + | |title = Option 1: Popular spot |
− | | | + | |mapID = 8695 |
− | |description = | + | |description = First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From metro "Opatov" (red line C) exit straight out of the station and take a left following the winding red ramp up to street level/the road above. Look on the bus stop... |
}} | }} | ||
</pre> | </pre> | ||
+ | {{Spot | ||
+ | |title = Option 1: Popular spot | ||
+ | |mapID = 8695 | ||
+ | |description = First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From metro "Opatov" (red line C) exit straight out of the station and take a left following the winding red ramp up to street level/the road above. Look on the bus stop... | ||
+ | }} | ||
+ | === Option 2: Unrated spot === | ||
+ | <pre>{{Spot | ||
+ | |title = Option 2: Unrated spot | ||
+ | |mapID = 10715 | ||
+ | |description = First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From... | ||
+ | }}</pre> | ||
{{Spot | {{Spot | ||
− | | | + | |title = Option 2: Unrated spot |
− | | | + | |mapID = 10715 |
− | |description = | + | |description = First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From... |
}} | }} | ||
+ | === Option 3: Place not connected with map === | ||
+ | <pre>{{Spot | ||
+ | |title = Option 3: Place not connected with map | ||
+ | |mapID = | ||
+ | |description = First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From... | ||
+ | }}</pre> | ||
{{Spot | {{Spot | ||
− | | | + | |title = Option 3: Place not connected with map |
− | | | + | |mapID = |
− | |description = | + | |description = First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From... |
}} | }} | ||
+ | |||
+ | [[Category:Templates]] | ||
</noinclude> | </noinclude> | ||
− | |||
− | |||
− |
Latest revision as of 16:44, 30 October 2019
Contents
Under development
This template is under development. Please suggest design. Comments from maps are planned to be added to the folding box under description.
How to use this Template?
Option 1: Popular spot
{{Spot |title = Option 1: Popular spot |mapID = 8695 |description = First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From metro "Opatov" (red line C) exit straight out of the station and take a left following the winding red ramp up to street level/the road above. Look on the bus stop... }}
Option 1: Popular spot
Error: No contents found at URL https://hitchwiki.org/maps/api/?place=8695&who=HW_spot_template.
[Error: no local variable "link" was set.&zoom=16 Spot at the map]
• Hitchability: Expression error: Unexpected < operator.
• Average waiting time: Error: no local variable "time" was set. based on Error: no local variable "waitingCount" was set. experiences
First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From metro "Opatov" (red line C) exit straight out of the station and take a left following the winding red ramp up to street level/the road above. Look on the bus stop...
Option 2: Unrated spot
{{Spot |title = Option 2: Unrated spot |mapID = 10715 |description = First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From... }}
Option 2: Unrated spot
Error: No contents found at URL https://hitchwiki.org/maps/api/?place=10715&who=HW_spot_template.
[Error: no local variable "link" was set.&zoom=16 Spot at the map]
• Hitchability: Expression error: Unexpected < operator.
• Average waiting time: Error: no local variable "time" was set. based on Error: no local variable "waitingCount" was set. experiences
First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From...
Option 3: Place not connected with map
{{Spot |title = Option 3: Place not connected with map |mapID = |description = First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From... }}
Option 3: Place not connected with map
First motorway petrol station behind Prague, really good hitchhiking but takes extra time to get there. From...