Maybe an odd question but not being the specialist. In some cases, usually on the phone, my overlay map loads very slowly. Is it possible to store such a map locally and (say) update this at ones own pace?
Yes it does, these are some maps from the French geoportail and sometimes this is fine, sometimes not (see for example post 80)
So I was thinking if I could get the map local in HA?
The built-in map is also just served from the web, you can just use the same url in the tile_layer_url. To serve it truly local you will need to host a copy of a map somewhere (or have a proxy).
I have added a button to my dashboard to toggle the history lines off and on by trying to use a template for the “history_show_lines” but it doesn’t work even after manually refreshing the browser window after each toggle of my button. The state of the input_boolean is definitely toggling between true and false after each click of my button. Any suggestions to toggle history_show_lines off and on?
type: custom:map-card
entities:
- entity: device_tracker.pet_tracker
circle:
source: gps_accuracy
color: green
history_start: 1 hour ago
history_show_lines: "{{ states('input_boolean.show_map_history') == 'on' }}"
history_line_color: green
color: green
tile_layer_url: >-
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
tile_layer_options:
attribution: Google Satellite
maxZoom: 20
minZoom: 0
Templates are not supported unless it is EXPLICITLY said in docs.
Supporting templates in Frontend - a feature present for SOME cards only (btw, none of stock cards supports templates, except Markdown).
I tried that one. When I place the map-card inside of the config-template-card, it will not show the history lines even when I don’t try to template it. In other words, if I set history_show_lines explicitly to true, it doesn’t show the lines until I remove the config-template-card.
What is the other templatable card that you were referring to? I would like to see if it is compatible with custom:map-card.
The card-templater card located here works! It didn’t even require a browser page refresh like I thought it would. I am posting what worked for me in case anyone is interested:
type: custom:card-templater
card:
type: custom:map-card
entities:
- entity: device_tracker.pet_tracker
circle:
source: gps_accuracy
color: green
history_start: 1 hour ago
history_show_lines_template: "{{ is_state('input_boolean.show_map_history', 'on') }}"
history_show_dots_template: "{{ is_state('input_boolean.show_map_history', 'on') }}"
history_line_color: green
color: green
tile_layer_url: >-
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}&key=xxxxxxxxxxxxxxxxxxxxx
tile_layer_options:
attribution: Google Satellite
maxZoom: 20
minZoom: 0
entities:
- input_boolean.show_map_history
Just one final note about templating. The templater card also allows you to template the entity. So, for example, you can choose from a drop down to switch from one tracker to the other. See below. I love this map-card. Thanks nathan.gs!
You create a helper ‘list’ and populate this with the parameter that is used to either add an overlay or change the whole chart…same as what you did above but then with the chart itself.
In this case I use multiple LAYER that are made available from data.geopf.fr and put them in the input_select…most effort is in finding out which are interesting and also which actually work