File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,3 +93,8 @@ ColorBlock* AdafruitIO_Dashboard::addColorBlock(AdafruitIO_Feed *feed)
9393{
9494 return new ColorBlock (this , feed);
9595}
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 2121#include " blocks/TextBlock.h"
2222#include " blocks/ChartBlock.h"
2323#include " blocks/ColorBlock.h"
24+ #include " blocks/MapBlock.h"
2425
2526// forward declaration
2627class AdafruitIO ;
@@ -44,6 +45,7 @@ class AdafruitIO_Dashboard {
4445 TextBlock* addTextBlock (AdafruitIO_Feed *feed);
4546 ChartBlock* addChartBlock (AdafruitIO_Feed *feed);
4647 ColorBlock* addColorBlock (AdafruitIO_Feed *feed);
48+ MapBlock* addMapBlock (AdafruitIO_Feed *feed);
4749
4850 private:
4951 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