Skip to content

Commit

Permalink
Static Map Templates (#104)
Browse files Browse the repository at this point in the history
* Add support for static map templates

* Add staticmap template property to config

* Remove .json extension

* Remove DotLiquid package

* Move GetAddress to Location class

* Separate staticmap class from utils class file

* Only allow address property being updated within its own class

* Fix templating style for NodeTileserverCache :facepalming:
  • Loading branch information
versx committed Dec 14, 2020
1 parent c365e72 commit 64c97a4
Show file tree
Hide file tree
Showing 40 changed files with 553 additions and 502 deletions.
42 changes: 9 additions & 33 deletions config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,46 +194,22 @@
"eventPokemonIds": [],
"eventMinimumIV": "90",
"urls": {
"staticMap": "http://tiles.example.com:8080/static/klokantech-basic/{0}/{1}/{2}/300/175/1/png",
"staticMap": "http://tiles.example.com:8080",
"scannerMap": "http://map.example.com/@/{0}/{1}/15"
},
"iconStyles": {
"Default": "https://raw.githubusercontent.com/nileplumb/PkmnHomeIcons/ICONS/ICONS/",
"Shuffle": "https://raw.githubusercontent.com/nileplumb/PkmnShuffleMap/master/ICONS_STANDARD/"
},
"staticMaps": {
"pokemon": {
"file": "pokemon.example.json",
"zoom": 15
},
"raids": {
"file": "raids.example.json",
"zoom": 15
},
"quests": {
"file": "quests.example.json",
"zoom": 15
},
"invasions": {
"file": "invasions.example.json",
"zoom": 15
},
"lures": {
"file": "lures.example.json",
"zoom": 15
},
"gyms": {
"file": "gyms.example.json",
"zoom": 11
},
"nests": {
"file": "nests.example.json",
"zoom": 15
},
"weather": {
"file": "weather.example.json",
"zoom": 11
}
"pokemon": "pokemon.example",
"raids": "raids.example",
"gyms": "gyms.example",
"quests": "quests.example",
"invasions": "invasions.example",
"lures": "lures.example",
"weather": "weather.example",
"nests": "nests.example"
},
"twilio": {
"enabled": false,
Expand Down
18 changes: 18 additions & 0 deletions examples/templates/Flo/gyms.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"style": "klokantech-basic",
"latitude": #(lat),
"longitude": #(lon),
"zoom": 15,
"width": 300,
"height": 175,
"scale": 1,
"markers": [{
"url": "#(url2)",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": 0,
"width": 32,
"height": 32
}]
}
26 changes: 26 additions & 0 deletions examples/templates/Flo/invasions.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"style": "klokantech-basic",
"latitude": #(lat),
"longitude": #(lon),
"zoom": 15,
"width": 300,
"height": 175,
"scale": 1,
"markers": [{
"url": "https://raw.githubusercontent.com/versx/WhMgr-Assets/master/original/misc/pokestop_invasion.png",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": 0,
"width": 32,
"height": 32
},{
"url": "#(url2)",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": -25,
"width": 32,
"height": 32
}]
}
26 changes: 26 additions & 0 deletions examples/templates/Flo/lures.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"style": "klokantech-basic",
"latitude": #(lat),
"longitude": #(lon),
"zoom": 15,
"width": 300,
"height": 175,
"scale": 1,
"markers": [{
"url": "https://raw.githubusercontent.com/versx/WhMgr-Assets/master/original/misc/pokestop.png",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": 0,
"width": 32,
"height": 32
},{
"url": "#(url2)",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": -25,
"width": 32,
"height": 32
}]
}
24 changes: 24 additions & 0 deletions examples/templates/Flo/nests.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"style": "klokantech-basic",
"latitude": #(lat),
"longitude": #(lon),
"zoom": 15,
"width": 300,
"height": 175,
"scale": 1,
"markers": [{
"url": "#(url2)",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": 0,
"width": 32,
"height": 32
}],
"polygons": [{
"fill_color": "rgba(100.0%,0.0%,0.0%,0.5)",
"stroke_color": "black",
"stroke_width": 1,
"path": "#(path)"
}]
}
26 changes: 26 additions & 0 deletions examples/templates/Flo/pokemon.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"style": "klokantech-basic",
"latitude": #(lat),
"longitude": #(lon),
"zoom": 15,
"width": 300,
"height": 175,
"scale": 1,
"markers": [{
"url": "https://raw.githubusercontent.com/nileplumb/PkmnHomeIcons/ICONS/ICONS/misc/grass.png",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": 0,
"width": 48,
"height": 48
},{
"url": "#(url2)",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": 0,
"width": 32,
"height": 32
}]
}
26 changes: 26 additions & 0 deletions examples/templates/Flo/quests.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"style": "klokantech-basic",
"latitude": #(lat),
"longitude": #(lon),
"zoom": 15,
"width": 300,
"height": 175,
"scale": 1,
"markers": [{
"url": "https://raw.githubusercontent.com/versx/WhMgr-Assets/master/original/misc/pokestop.png",
"latitude": #(lat),
"longitude": #(lon),
"height": "32",
"width": "32",
"x_offset": 0,
"y_offset": 0
},{
"url": "#(url2)",
"latitude": #(lat),
"longitude": #(lon),
"height": "32",
"width": "32",
"x_offset": 0,
"y_offset": -25
}]
}
26 changes: 26 additions & 0 deletions examples/templates/Flo/raids.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"style": "klokantech-basic",
"latitude": #(lat),
"longitude": #(lon),
"zoom": 15,
"width": 300,
"height": 175,
"scale": 1,
"markers": [{
"url": "https://raw.githubusercontent.com/nileplumb/PkmnHomeIcons/ICONS/ICONS/gym/#(team_id).png",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": 0,
"width": 32,
"height": 32
},{
"url": "#(url2)",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": -25,
"width": 32,
"height": 32
}]
}
24 changes: 24 additions & 0 deletions examples/templates/Flo/weather.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"style": "klokantech-basic",
"latitude": #(lat),
"longitude": #(lon),
"zoom": 15,
"width": 300,
"height": 175,
"scale": 1,
"markers": [{
"url": "#(url2)",
"latitude": #(lat),
"longitude": #(lon),
"x_offset": 0,
"y_offset": 0,
"width": 48,
"height": 48
}],
"polygons": [{
"fill_color": "rgba(100.0%,0.0%,0.0%,0.5)",
"stroke_color": "black",
"stroke_width": 1,
"path": "#(path)"
}]
}
12 changes: 0 additions & 12 deletions examples/templates/gyms.example.json

This file was deleted.

20 changes: 0 additions & 20 deletions examples/templates/invasions.example.json

This file was deleted.

20 changes: 0 additions & 20 deletions examples/templates/lures.example.json

This file was deleted.

12 changes: 0 additions & 12 deletions examples/templates/nests.example.json

This file was deleted.

23 changes: 0 additions & 23 deletions examples/templates/pokemon.example.json

This file was deleted.

20 changes: 0 additions & 20 deletions examples/templates/quests.example.json

This file was deleted.

Loading

0 comments on commit 64c97a4

Please sign in to comment.