Hallo,
wir sind 3 Personen im Haushalt und jeder bekommt von seinem iPhone die Geokoordinaten übermittelt.
In den Code-Schnipseln habe ich einen kleinen Code von Rudi gefunden, der die Location auf eine OpenStreetMap anzeigt.
htmlCode {
my ($la,$lo)=(ReadingsVal('Tracker_Gabi','latitude','50.112'),ReadingsVal('Tracker_Gabi','longitude','8.686'));
'<iframe width="480" height="480" name="Gabi_Map1" src="https://www.openstreetmap.org/export/embed.html?'.
sprintf("bbox=%f,%f,%f,%f,",$lo-0.001,$la-0.001,$lo+0.001,$la+0.001).
sprintf("&marker=%f,%f",$la,$lo).'"></iframe>'}
Ein list vom Device sieht so aus:
Internals:
CFGFN
DEF htmlCode {
my ($la,$lo)=(ReadingsVal('Tracker_Gabi','latitude','50.112'),ReadingsVal('Tracker_Gabi','longitude','8.686'));
'<iframe width="480" height="480" name="Gabi_Map1" src="https://www.openstreetmap.org/export/embed.html?'.
sprintf("bbox=%f,%f,%f,%f,",$lo-0.001,$la-0.001,$lo+0.001,$la+0.001).
sprintf("&marker=%f,%f",$la,$lo).'"></iframe>'}
FUUID 66ba1c9f-f33f-21e6-698b-bec17d2ccd97e1f9
LINK {
my ($la,$lo)=(ReadingsVal('Tracker_Gabi','latitude','50.112'),ReadingsVal('Tracker_Gabi','longitude','8.686'));
'<iframe width="480" height="480" name="Gabi_Map1" src="https://www.openstreetmap.org/export/embed.html?'.
sprintf("bbox=%f,%f,%f,%f,",$lo-0.001,$la-0.001,$lo+0.001,$la+0.001).
sprintf("&marker=%f,%f",$la,$lo).'"></iframe>'}
NAME Gabi_Map
NR 8399
STATE initialized
TYPE weblink
WLTYPE htmlCode
Attributes:
nodetaillink 0
room Residents
Das klappt auch wunderbar, jedoch finde ich keinen Weg, um die Karten zu unterscheiden. Es wird nur die Karte angezeigt, kein Device name oder ähnliches.
Kann mir bitte jemand einen Tipp geben?
Danke im voraus,
Wolfgang
Hallo,
eine Möglichkeit und auch nur der erste Gedanke dazu, jeder Person eine Farbe zuweisen und den Rahmen in jeder Definition entsprechend einfärben.
htmlCode {
my ($la,$lo)=(ReadingsVal('Tracker_Gabi','latitude','50.112'),ReadingsVal('Tracker_Gabi','longitude','8.686'));
'<iframe width="480" height="480" name="Gabi_Map1" style="border: 2px solid red;border-radius: 10px;" src="https://www.openstreetmap.org/export/embed.html?'.
sprintf("bbox=%f,%f,%f,%f,",$lo-0.001,$la-0.001,$lo+0.001,$la+0.001).
sprintf("&marker=%f,%f",$la,$lo).'"></iframe>'}
Gruß Thomas
edit:
zweiter Gedanke ::) . Einfach den Namen der Person unter das iframe schreiben ?
htmlCode {
my ($la,$lo)=(ReadingsVal('Tracker_Gabi','latitude','50.112'),ReadingsVal('Tracker_Gabi','longitude','8.686'));
'<iframe width="480" height="480" name="Gabi_Map1" style="border: 2px solid red;border-radius: 10px;" src="https://www.openstreetmap.org/export/embed.html?'.
sprintf("bbox=%f,%f,%f,%f,",$lo-0.001,$la-0.001,$lo+0.001,$la+0.001).
sprintf("&marker=%f,%f",$la,$lo).'"></iframe><div>Ich bin Gabis iframe</div>'}
Hallo TomLee,
ganz herzlichen Dank für Deine Anregungen. Klappt einwandfrei.
Liebe Grüße
Wolfgang