From 96468f9258d10e880b6b8d5a85ebde823bf4f806 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Wed, 19 Jun 2019 23:16:57 +0200 Subject: [PATCH] add a basic clickable pin that opens google maps for now --- htdocs/gfx/google_maps_pin.svg | 77 ++++++++++++++++++++++++++++++++++ htdocs/openwebrx.css | 10 +++++ htdocs/openwebrx.js | 5 ++- 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 htdocs/gfx/google_maps_pin.svg diff --git a/htdocs/gfx/google_maps_pin.svg b/htdocs/gfx/google_maps_pin.svg new file mode 100644 index 0000000..2c54fe1 --- /dev/null +++ b/htdocs/gfx/google_maps_pin.svg @@ -0,0 +1,77 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/htdocs/openwebrx.css b/htdocs/openwebrx.css index 13a1059..5624d79 100644 --- a/htdocs/openwebrx.css +++ b/htdocs/openwebrx.css @@ -1003,3 +1003,13 @@ img.openwebrx-mirror-img .openwebrx-dmr-timeslot-panel * { cursor: pointer; } + +.openwebrx-maps-pin { + background-image: url("gfx/google_maps_pin.svg"); + background-position: center; + background-repeat: no-repeat; + width: 15px; + height: 15px; + background-size: contain; + display: inline-block; +} diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index debd351..27cc8fc 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1351,6 +1351,9 @@ function update_metadata(meta) { if (meta.mode && meta.mode != "") { mode = "Mode: " + meta.mode; source = meta.source || ""; + if (meta.lat && meta.lon) { + source = "" + source; + } up = meta.up ? "Up: " + meta.up : ""; down = meta.down ? "Down: " + meta.down : ""; $(el).find(".openwebrx-meta-slot").addClass("active"); @@ -1358,7 +1361,7 @@ function update_metadata(meta) { $(el).find(".openwebrx-meta-slot").removeClass("active"); } $(el).find(".openwebrx-ysf-mode").text(mode); - $(el).find(".openwebrx-ysf-source").text(source); + $(el).find(".openwebrx-ysf-source").html(source); $(el).find(".openwebrx-ysf-up").text(up); $(el).find(".openwebrx-ysf-down").text(down);