Difference between revisions of "Widget:SpaceAPI"
m (fixed vark) |
m (Added Hackers on Tour SpaceAPI preparations (just for fun)) |
||
Line 19: | Line 19: | ||
This will give the following result:<br/> | This will give the following result:<br/> | ||
{{#widget:{{PAGENAME}} | {{#widget:{{PAGENAME}} | ||
− | |url=/spaceAPI/?beacon_log= | + | |url=/spaceAPI/?beacon_log=HoT |
|width=260px | |width=260px | ||
|height=20px | |height=20px | ||
Line 414: | Line 414: | ||
popupAnchor: [0, -26], | popupAnchor: [0, -26], | ||
shadowUrl: '//maps.google.com/intl/en_us/mapfiles/ms/micons/cycling.shadow.png', | shadowUrl: '//maps.google.com/intl/en_us/mapfiles/ms/micons/cycling.shadow.png', | ||
+ | shadowSize: [59, 32], | ||
+ | shadowAnchor: [16, 26] | ||
+ | } ), | ||
+ | "HoT" : L.icon( { | ||
+ | iconUrl: '//maps.google.com/intl/en_us/mapfiles/ms/micons/bus.png', | ||
+ | iconSize: [32, 32], | ||
+ | iconAnchor: [16, 26], | ||
+ | popupAnchor: [0, -26], | ||
+ | shadowUrl: '//maps.google.com/intl/en_us/mapfiles/ms/micons/bus.shadow.png', | ||
shadowSize: [59, 32], | shadowSize: [59, 32], | ||
shadowAnchor: [16, 26] | shadowAnchor: [16, 26] | ||
Line 419: | Line 428: | ||
}; | }; | ||
this._leaflet.descriptions = { | this._leaflet.descriptions = { | ||
− | "HoaB" : "Hackers on a Bike" | + | "HoaB" : "Hackers on a Bike", |
+ | "HoT" : "Hackers on Tour" | ||
}; | }; | ||
Line 665: | Line 675: | ||
// Closure variable | // Closure variable | ||
− | if ( ( delta < 3600 ) && ( _apiBeacon.name === "HoaB" ) ) | + | if ( ( delta < 3600 ) && ( _apiBeacon.name === "HoaB" || _apiBeacon.name === "HoT" ) ) |
bHoaB = true; | bHoaB = true; | ||
Revision as of 07:49, 2 October 2018
This widget allows you to display the Space API data (provided as JSON)
Created by Xopr
Using this widget
To insert this widget, use the following code:
{{#widget:SpaceAPI |url=/spaceAPI/ |width=260px |height=20px |padding=8px |interval=20 |float=right |features=beacon }}
This will give the following result:
Notes
- url is mandatory, the rest is optional (leave out interval to make the data static).
- it also must be written without protocol since colon (:) is not allowed, and may be relative, for example: //ackspace.nl/spaceAPI/ or /spaceAPI/
- You must provide a unit for the sizes (i.e. px, %, etc.)
Copy to your site
To use this widget on your site, just install MediaWiki Widgets extension and copy full source code of this page to your wiki as Widget:SpaceAPI article.