nappyjim
(Jim)
February 24, 2024, 5:21pm
1
So I have it working just from copying and pasting. But now I just wondering why it appears like my latitude and longitude is doubled. Can someone explain. Is this necessary? I just copied and pasted example URL from HA website: Show Google Maps as a card - Home Assistant
So in picture below, the highlighted parts are there twice. Why?
Hellis81
(Hellis81)
February 24, 2024, 5:24pm
2
Isn’t one of them the marker and the other the position of the camera?
Try and add + or - a few decimals, like 0.01 or something to one of the templates
nappyjim
(Jim)
February 24, 2024, 7:00pm
3
Where would I add that? Heres the code
https://maps.googleapis.com/maps/api/staticmap?center={{ state_attr('device_tracker.phone_christina','latitude')}},{{ state_attr('device_tracker.phone_christina','longitude')}}&zoom=13&size=500x500&maptype=roadmap&markers=color:red%7Clabel:M%7C{{state_attr('device_tracker.phone_christina','latitude')}},{{ state_attr('device_tracker.phone_christina','longitude')}}&key=abceasyas123simpleasdoeraymeabc123babyyouandmegirl
Hellis81
(Hellis81)
February 24, 2024, 7:43pm
4
https://maps.googleapis.com/maps/api/staticmap?center={{ state_attr('device_tracker.phone_christina','latitude') | float + 0.05}},{{ state_attr('device_tracker.phone_christina','longitude')}}&zoom=13&size=500x500&maptype=roadmap&markers=color:red%7Clabel:M%7C{{state_attr('device_tracker.phone_christina','latitude')}},{{ state_attr('device_tracker.phone_christina','longitude')}}&key=abceasyas123simpleasdoeraymeabc123babyyouandmegirl
I believe this should shift the view position in latitude.
The second lat/lon is probably the marker position, if I could guess what the url does.