File tree Expand file tree Collapse file tree 4 files changed +76
-0
lines changed Expand file tree Collapse file tree 4 files changed +76
-0
lines changed Original file line number Diff line number Diff line change @@ -93,3 +93,8 @@ ColorBlock* AdafruitIO_Dashboard::addColorBlock(AdafruitIO_Feed *feed)
93
93
{
94
94
return new ColorBlock (this , feed);
95
95
}
96
+
97
+ MapBlock* AdafruitIO_Dashboard::addMapBlock (AdafruitIO_Feed *feed)
98
+ {
99
+ return new MapBlock (this , feed);
100
+ }
Original file line number Diff line number Diff line change 21
21
#include " blocks/TextBlock.h"
22
22
#include " blocks/ChartBlock.h"
23
23
#include " blocks/ColorBlock.h"
24
+ #include " blocks/MapBlock.h"
24
25
25
26
// forward declaration
26
27
class AdafruitIO ;
@@ -44,6 +45,7 @@ class AdafruitIO_Dashboard {
44
45
TextBlock* addTextBlock (AdafruitIO_Feed *feed);
45
46
ChartBlock* addChartBlock (AdafruitIO_Feed *feed);
46
47
ColorBlock* addColorBlock (AdafruitIO_Feed *feed);
48
+ MapBlock* addMapBlock (AdafruitIO_Feed *feed);
47
49
48
50
private:
49
51
AdafruitIO *_io;
Original file line number Diff line number Diff line change
1
+ //
2
+ // Adafruit invests time and resources providing this open source code.
3
+ // Please support Adafruit and open source hardware by purchasing
4
+ // products from Adafruit!
5
+ //
6
+ // Copyright (c) 2015-2016 Adafruit Industries
7
+ // Authors: Tony DiCola, Todd Treece
8
+ // Licensed under the MIT license.
9
+ //
10
+ // All text above must be included in any redistribution.
11
+ //
12
+ #include " MapBlock.h"
13
+
14
+ MapBlock::MapBlock (AdafruitIO_Dashboard *d, AdafruitIO_Feed *f) : AdafruitIO_Block(d, f)
15
+ {
16
+ historyHours = 0 ;
17
+ tile = " contrast" ;
18
+ }
19
+
20
+ MapBlock::~MapBlock (){}
21
+
22
+ String MapBlock::properties ()
23
+ {
24
+
25
+ if (tile != " contrast" && tile != " street" && tile != " sat" ) {
26
+ tile = " contrast" ;
27
+ }
28
+
29
+ String props = " {\" historyHours\" :\" " ;
30
+ props += historyHours;
31
+ props += " \" ,\" tile\" :" ;
32
+ props += tile;
33
+ props += " \" }" ;
34
+
35
+ return props;
36
+ }
Original file line number Diff line number Diff line change
1
+ //
2
+ // Adafruit invests time and resources providing this open source code.
3
+ // Please support Adafruit and open source hardware by purchasing
4
+ // products from Adafruit!
5
+ //
6
+ // Copyright (c) 2015-2016 Adafruit Industries
7
+ // Authors: Tony DiCola, Todd Treece
8
+ // Licensed under the MIT license.
9
+ //
10
+ // All text above must be included in any redistribution.
11
+ //
12
+ #ifndef ADAFRUITIO_MAPBLOCK_H
13
+ #define ADAFRUITIO_MAPBLOCK_H
14
+
15
+ #include " AdafruitIO_Block.h"
16
+
17
+ class MapBlock : public AdafruitIO_Block {
18
+
19
+ public:
20
+ MapBlock (AdafruitIO_Dashboard *d, AdafruitIO_Feed *f);
21
+ ~MapBlock ();
22
+
23
+ int historyHours;
24
+ const char *tile;
25
+
26
+ String properties ();
27
+
28
+ private:
29
+ const char *_visual_type = " map" ;
30
+
31
+ };
32
+
33
+ #endif // ADAFRUITIO_MAPBLOCK_H
You can’t perform that action at this time.
0 commit comments