night199uk - @AdrianP is it possible to set the...
@AdrianP is it possible to set the opacity for a chart/tile layer today in freeboard sk?
63 Replies
No currently...
i'm working to add the layers from nowCoast to my SignalK, and their satellite cloud layer needs opacity to be useful
https://nowcoast.noaa.gov/
NOAA nowCoast weather for the US. really useful to overlay this on freeboard.
okay, i feel like it should be simple to add a property. signalk-charts would need an "opacity" property for the default opacity for a layer, and then freeboard-sk would need to read that from the schema and set the default opacity on the OL tilelayer, right?
(can get fancy and add a slider in FSK later, but an "initial" opacity would be a good start)
As layers are sourced from charts metadata it would be an attribute that could be added so it could be set when it's defined
exactly what i was thinking.
i will take a look to do a PR in the next few days... i will have to figure out how to get an FSK dev environment up, been a while since i did much heavy JS in anger.
Is nowCoast vector data or is it raster tile data
i think they have a combination of raster and vector data
FSK doesn't support vector data yet right?
It certainly does! Vector is not generally an issue for overlays unless there is styling that makes it opaque.

looks pretty great to me. i have radar and tropical cyclone layers working. i have the satellite layer but it's useless without transparency.
the other thing i might want to add is automatic refresh on a layer. so e.g. the weather layers can refresh themselves every couple of minutes.
there are some other layers i want to add, like active weather alert areas. those are vector layers, which will be interesting. and they have "clickable" data.
i'm not sure if those are closer to signalk resources, than chart layers...
I have been toying with the concept of a "live" layer so this weather data is a good first use case.... as for the "active" areas.... there is the concept of resource sets, which are basically GeoJSON layers.... see https://github.com/SignalK/freeboard-sk/wiki/Working-with-Resources
oh interesting
that's sort of exactly what's needed for these active weather alerts I think
so a "chart" endpoint can return a resourceset?
and it looks like resourcesets can be statically defined on the server? so a first step might be to statically create a resourceset from the active weather alert layer to define the mapping process.
if you go here:
https://nowcoast.noaa.gov/
and select only the "active alerts" layer (top right), then look at the US east coast you'll see all the red alert areas that are the fallout from imelda and humberto. those are clickable resources that give you the specific warning (gale, high seas, tropical storm warning, etc).
Chart endpoints cannot return a resource set..... you can set up a resourceset path (via the resources-provider plugin) and then save data into that location.
It can then be configured in FSK to display... which will make it appear in the Ressource layers list.


here?
Yep
After selecting them in FSK settings they should appear here....


do you have a sample resourceset file?
Here you go
tx. will play. just working on a PR to add opacity to chart layers in FSK.
Add opacity in the charts-plugin and use it in Freeboard SK:
https://github.com/SignalK/charts-plugin/pull/39
https://github.com/SignalK/freeboard-sk/pull/298
Ideally, Freeboard SK would have a slider to allow one to adjust the opacity of layers that are already there, but that can be a future add.
I am not sure if having opacity in the charts api is the best solution or cadence. You control what layers are shown and in what order in Freeboard - to me opacity is about the same theme. Opacity by itself, without the order and selection of layers, is out of context
I don't think the weather snapshot is updated every few minutes. More like once every few hours.
If you use the GaladrielCache, it's easy to make transparency and refresh, but it's difficult to deal with image caching by the browser.
i sort of agree with this, i thought the same while i was adding it. opacity is more of a view property so feels more natural in freeboard. but; freeboard doesn't really have any way to store properties for individual layers today, does it?
I think the ideal for me is to have a slider here, where I've marked in red for opacity of each layer; so it can be adjusted on the fly

the nowcoast weather radar map seems to be updated every 3-5 minutes.
https://nowcoast.noaa.gov/
I originally pushed it through my GaladrielCache instance, but it didn't seem to be that useful to send it through GaladrielCache since I don't need/want to cache it given the change frequency. was running it with $ttl = 0;
i think this is not about transparency but opacity of the OpenLayers, as all of their layers have sections that overlay and block the main map.
I don't think GaladrielCache can do anything with opacity, right?
one thing i think is that some of these layers make more sense as freeboard-sk only, perhaps as plugins. for example for the weather radar it's possible to query forwards/backwards through time - play with the nowcoast website. i think it would be great to be able to add sliders (for time range) etc to freeboard-sk to view the weather over time; but that's not possible today. and these weather layers are not "charts" per-se. so in my mind perhaps these weather layers completely exist as freeboard-sk plugins long term.
i guess freeboard-sk already adds OSM layer and and World Map layers statically. perhaps thats the way to go, and instead of me adding these to signalk "charts" (which is really for maps), the better way is to add them directly to freeboard-sk so that we can add more custom functionality like time sliders and things that would require more knowledge of the tilelayer itself?
i'm thinking out loud here, would appreciate your thoughts.
$ttl=1; ,sec. The 0 is don't update at all.
I don't think GaladrielCache can do anything with opacity, right?No. The prepareTileImg hook present. See C-MAP_raster1.php for example. But I think that extra controls on the chartplotter screen are a bad thing. They usually set up the card once, and then use it. Why the extra controls?
maybe i agree with this too. but perhaps that depends on the layer - maybe there are some (such as the satellite view) where you might want to adjust opacity depending on the content diaplayed.
that said, i think putting an opacity slider in the charts view is not too crowded?
now i think about it more though, it feels like some of these layers would exist better as freeboard-sk plugins, as they are not 'charts' per-se. and e.g. the weather radar map could use more controls: such as scrolling forward and backward through time to watch the track of rain, like you can do on the nowcoast site itself. that kind of additional functionality could never be exposed just through the charts API.
like all of these "live" tile layers are not charts in the traditional sense and are really view overlays with additional metadata. so the whole thing feels like a view side (i.e. freeboard-sk) thing to me.
i would like to get them somewhere though, it is super useful to be able to overlay live weather directly on freeboard SK 😄
oh!
i did not know it was possible to add WMS layers directly to freeboard-sk. i just found this button.
🤦♂️
that feels like it's probably the right place to add this layer instead of signalk-charts, is exactly inline with what i was saying above.

But it is for GaladrielMap origin only.
But this is a purely custom map, without interfering with the GaladrielMap code. See
Weather.php.
Yes, this is the kind of map I would love to display in Freeboard too; with similar configuration properties.
anyway, i am going to try now adding an opacity slider where i suggested in the freeboard SK charts list. i think this will be better and more useful than the PRs I had opened before.

Opacity slider in the Chart List... needs a bit more work & polish yet; but works better. Can tweak the opacity of layers on the fly.
Showing satellite cloud cover over Navionics SonarCharts...
with Active Alert areas too.

How do you get the NOAA charts onto freeeboardsk?
You can add the URLs for the WMS layers directly to Freeboard SK
But without opacity they are more or less useful right now because overwise they just overlay the map
Ah got it, with opacity do you think a time scrubber would be good as well?
And/or possible. the WMS Service looks like it allows for a time dimension
Or maybe weather should just be another resource? But I don't necessarily understand that framework yet
There is work in progress to add (WMS, WMTS) layers on top of charts that can be refreshed at regular intervals to cater for weather type use cases
Would this have a slider like the noaa app?
Not familiar with the NOAA app but or what dataset is used to provide it's features, the MVP for the current work is to provide the ability to overlay data using WMS/ WMTS.
You already can overlay data like this, you just have no control over the time portion. From what I know freeboardsk doesnt cache the charts it gets from online sources, so wouldn’t that refresh them?
The current functionality creates a chart metadata definition, and yes refreshing the chart will reload it (which is fine for slowly changing data). The new functionality will place layers over the topmost chart and provide options for refreshing at more frequent intervals.
@AdrianP Let me know if I can help at all with that work. I see WMTS/WMS/JSON layers are already implemented client side in FreeboardSK (I missed this initially). I had a better proof-of-concept for opacity that was all client side, but it needs some work.
@Day Yes, I think a time slider would be super-useful; as NOAA and other weather sources implement such time sliders... but it might be confusing if it only works with those layers. I think FreeboardSK/SignalK have a history API; so I guess it might be possible to make the time slider work with the SignalK history API as well? I've done zero research on that so I'm guessing.
Time is a dimension in the wms capabilities I believe?
@Day oh it is? nice. i'm not a wms geek at all; I've done a lot of work in leaflet in the past but with custom data sources.
For the record I’m not good at this stuff at all, I’m just trying to remember what i saw
yeah. i'm not done in the weeds on any of the particular sources, but i've done a lot of gis/geo stuff in the past.
Overlays feature is progressing, which will allow feature layers to be overlayed on top of charts which can:
- Be refreshed at a configurable interval
- Have opacity set 10% - 100%
A time slider would only apply to specific layers with the associated capability.
I'm not a WMS / WMTS expert but I think there are opportunities to surface the capabilities provided by these sources.
@AdrianP this will be awesome!
https://docs.geoserver.org/main/en/user/services/wms/time.html
@night199uk Freeboard-SK v2.19.0-beta.1 available which has inital support for WMS and WMTS overlays.
I suggest updating the
resources-provider plugin prior to using the FSK beta as it will auto-create the required resource path on the server.... Note: you need to be authenticated to the server for auto-creation to workjust updated my freeboard SK and got overlay support. I have to say, this is AWESOME.
i now have a self refreshing US weather and cloud overlay on top of my chart plotter. this blows away what I see on my raymarine MFD 🙂
if i can just figure out mayara and radar next...

thanks so much 🙂
oh, i found a bug though
after adding the NOAA tropical cycle tracker:
https://nowcoast.noaa.gov/geoserver/tropical_cyclones/wms
the checkbox for "enabling" layers disappeared. i think it might have got pushed to the right of the fixed width box

@Karl-Erik Gustafsson any idea if we could have something similar from fmi?
@Teppo Kurki the NOAA source has some global satellite imagery.
try adding this:
https://nowcoast.noaa.gov/geoserver/satellite/wms
and look at the global_* layers?
global_visible_imagery_mosaic seems decent
also the tropical cycle tracker is global i believe
https://nowcoast.noaa.gov/geoserver/tropical_cyclones/wms
@Teppo Kurki http://openwms.fmi.fi/geoserver/wms
E.g.
- Radar:suomi_rr_eureffin
- Radar:suomi_rr12h_eureffin
- Radar:suomi_rr1h_eureffin
- Radar:suomi_dbz_eureffin
Picture is from
Radar:suomi_rr1h_eureffin
What about opacity on regular charts, like ofr satellite overlay?
I'll look into it
I have published
2.19.1-beta.1 which has the fix. If you could test and confirm the issue is resolved I will release it to the wild.@AdrianP what's the easiest way to grab a beta?
i'm actually out on the water right now, let me update when i get to my destination in a day or two
npm i @signalk/freeboard-sk@betaI am currently developing a time slider for WMS and WMTS overlays that have time as a dimension. I was wondering if the changing the time and such should be local, or for all devices and be stored within the resource manager on the server
State for overlays is stored in the resource record.
I assume the time is an offset so that is what will be persisted.
What is the expected behaviour with regards the "time slider" when a reload or refresh of resources occurs?
with WMTS/WMS, they give a time dimension. THis has default time (most recent) , and a list of some times from the past 6 hours or so. The slider would default to the current time, then a user could slide it to make it show a different time which is just used by specifying the dimension in the WMTS/WMS request. I have a POC right now but am struggling on the refreshing of the time dimension metadata (list of times that are possible). Although I didnt think about not giving the user specific times and just an offset, that might work better. I think keeping offset the same on a refresh would be best, so if a refresh happened and the user has the time offset at like an hour then it would display the weather an hour off ofwhen the refresh happens
Just created the PR, https://github.com/SignalK/freeboard-sk/pull/300. I assume it will need some reworking but I figured I should get it on github quick.