Difference between revisions of "Widget:SpaceAPI"

From Hackerspace ACKspace
Jump to: navigation, search
m (spotted icon array typo)
m (fixed https support)
Line 115: Line 115:
 
                     this._beacon.map = L.map( mapNode ).setView( this._beacon.point, 11);
 
                     this._beacon.map = L.map( mapNode ).setView( this._beacon.point, 11);
  
                     L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
+
                     L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
                         attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
+
                         attribution: '&copy; <a href="//openstreetmap.org/copyright">OpenStreetMap</a> contributors'
 
                     }).addTo( this._beacon.map );
 
                     }).addTo( this._beacon.map );
  
Line 125: Line 125:
 
                     this._beacon.icons = {
 
                     this._beacon.icons = {
 
                         "HoaB" : L.icon( {
 
                         "HoaB" : L.icon( {
                             iconUrl: 'http://maps.google.com/intl/en_us/mapfiles/ms/micons/cycling.png',
+
                             iconUrl: '//maps.google.com/intl/en_us/mapfiles/ms/micons/cycling.png',
 
                             iconSize: [32, 32],
 
                             iconSize: [32, 32],
 
                             iconAnchor: [16, 26],
 
                             iconAnchor: [16, 26],
 
                             popupAnchor: [0, -26],
 
                             popupAnchor: [0, -26],
                             shadowUrl: 'http://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],
 
                             shadowSize: [59, 32],
 
                             shadowAnchor: [16, 26]
 
                             shadowAnchor: [16, 26]

Revision as of 17:07, 11 May 2016

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
}}

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.