...
Add a WMS layer via the Google Earth user interface
Add a WMS layer by editing a kml file
If you save the WMS layer you created via the GUI, you can save that to a separate *.kml
file. IF you save as a *.kmz
, that is simply a zipped *.kml
. You can now edit the *.kml
in an ASCII edit such as notepad, wordpad or textpad, to see what the syntax is for showing a WMS layer in Google Earth.
Once saved, you will see that kml uses a so-called GroundOverlay
element.
...
- Note that you need to replace all
&
symbols in the url with the html encoding for that "& a m p ;
" (without spaces).Code Block any & should become &
- Note that the
href
element contains a full valid WMS url EXCEPT thebbox
keyword. Google Earth will automatically use thebbox
keyword depending on where you zoomed. This makes sure that you always see the WMS when you are in the correct region, and that the resolution will be better when you zoom in. Leaving out thebbox
will result in an INVALID url if you open it on a browser:http://data.ncof.co.uk/thredds/wms/METOFFICE-NWS-AF-BIO-DAILY?VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&WIDTH=512&HEIGHT=512&LAYERS=N3n&STYLES=boxfill/rainbow&TRANSPARENT=TRUE&FORMAT=image/gif&
- The
LatLonBox
is only optional to bring the GroundOverlay into your view and prevent fruitless WMS calls or fruitless waiting. - The
GroundOverlay
subelement<viewRefreshMode>
is essential for this, only when you stop zooming, Google Earth will update the image.
...
With the previous manual editing of kml files, you can add any WMS to your Google Earth. However, often you will not see nice WMS images, but a 'request in progress' arrow.
You can prevent this by switching of the automatic updating of WMS, and simply download the WMS image and refer to a local file, or use WMS as a means to refer to images as if they were static images on the web. You can do this by making sure
...