Reading-eScience-Centre / ncwms

ncWMS - A Web Map Service for displaying environmental data over the web
Other
62 stars 30 forks source link

Configuration of the initial Base Map for Godiva3 #91

Open LorenzoCorgnati opened 2 years ago

LorenzoCorgnati commented 2 years ago

Is it possible to configure the background map of Godiva3 viewer in some configuration files (i.e. without using the button in the browser page)? I'd like to have Demis WMS as the default map, but NAtural Earth is the one that is always displayed.

guygriffiths commented 2 years ago

You can add custom layers and define one of them to be the default, but I don't think you can define one of the pre-existing ones to be the default. If you edit ~/.ncWMS2/godiva.properties you can add a layer named <whatever> by setting the properties:

<whatever>URL=http://wmsurl.com/with/query/separator/wms?
# The Title for the layer switcher. Defaults to the ID (i.e. "user" in this case)
<whatever>Title=My WMS Layer
# The layer(s) to plot.  MANDATORY
<whatever>Layers=wmslayer1,wmslayer2
# The projection to use.  Defaults to "CRS:84"
<whatever>Projection=EPSG:4326
# The WMS version to use.  Defaults to "1.1.1"
<whatever>Version=1.3.0
# The image format to use.  Defaults to "image/png"
<whatever>Format=image/png
# Whether a layer should be switched on at load.  Can be defined for multiple overlays, but only for one base layer
<whatever>OnByDefault=true
# Whether to use as an overlay (as opposed to a base map).  Defaults to false
<whatever>IsOverlay=false
LorenzoCorgnati commented 2 years ago

Dear Guy,

thanks for your help.

I cannot find any .ncWMS2 folder in my installation: does it mean that I have to install ncWMS (i.e. it is not embedded in the THREDDS package)?

Where can I find the URLs of the maps that I will use?

Cheers.

L

On 01/04/22 14:21, Guy Griffiths wrote:

You can add custom layers and define one of them to be the default, but I don't think you can define one of the pre-existing ones to be the default. If you edit |~/.ncWMS2/godiva.properties| you can add a layer named || by setting the properties:

|URL=http://wmsurl.com/with/query/separator/wms? # The Title for the layer switcher. Defaults to the ID (i.e. "user" in this case)

Title=My WMS Layer # The layer(s) to plot. MANDATORY Layers=wmslayer1,wmslayer2 # The projection to use. Defaults to "CRS:84" Projection=EPSG:4326 # The WMS version to use. Defaults to "1.1.1" Version=1.3.0 # The image format to use. Defaults to "image/png" Format=image/png # Whether a layer should be switched on at load. Can be defined for multiple overlays, but only for one base layer OnByDefault=true # Whether to use as an overlay (as opposed to a base map). Defaults to false IsOverlay=false | — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you authored the thread.Message ID: ***@***.***> -- _________________________________________

Lorenzo Corgnati

Consiglio Nazionale delle Ricerche

ISMAR - Istituto di Scienze Marine

Sede Secondaria di Lerici

Forte Santa Teresa – 19032 Lerici (SP), Italy

tel: +39 0187 1788921

fax: +39 0187 970585

Sito web:www.ismar.cnr.it