quickstart.rst 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. .. _google_earth_quickstart:
  2. Quickstart
  3. ==========
  4. .. note:: If you are using GeoServer locally, the GEOSERVER_URL is usually ``http://localhost:8080/geoserver``
  5. Viewing a layer
  6. ---------------
  7. Once GeoServer is installed and running, open up a web browser and go to the web admin console (:ref:`web_admin`). Navigate to the :ref:`layerpreview` by clicking on the Layer Preview link at the bottom of the left sidebar. You will be presented with a list of the currently configured layers in your GeoServer instance. Find the row that says ``topp:states``. To the right of the layer click on the link that says **KML**.
  8. .. figure:: ../../../data/webadmin/img/preview_list.png
  9. The Map Preview page
  10. If Google Earth is correctly installed on your computer, you will see a dialog asking how to open the file. Select **Open with Google Earth**.
  11. .. figure:: openingkml.png
  12. Open with Google Earth
  13. When Google Earth is finished loading the result will be similar to below.
  14. .. figure:: googleearth.jpg
  15. The topp:states layer rendered in Google Earth
  16. Direct access to KML
  17. --------------------
  18. All of the configured FeatureTypes are available to be output as KML (and thus loaded into Google Earth). The URL structure for KMLs is::
  19. http://GEOSERVER_URL/wms/kml?layers=<layername>
  20. For example, the topp:states layer URL is::
  21. http://GEOSERVER_URL/wms/kml?layers=topp:states
  22. Adding a Network Link
  23. ---------------------
  24. An alternative to serving KML directly into Google Earth is to use a Network Link. A Network Link allows for better integration into Google Earth. For example, using a Network Link enables the user to refresh the data within Google Earth, without having to retype a URL, or click on links in the GeoServer Map Preview again.
  25. To add a Network Link, pull down the **Add** menu, and go to **Network Link**. The **New Network Link** dialog box will appear.
  26. Name your layer in the **Name** field. (This will show up in **My Places** on the main Google Earth screen.) Set **Link** to::
  27. http://GEOSERVER_URL/wms/kml?layers=topp:states
  28. (Don't forget to replace the GEOSERVER_URL.) Click **OK**. You can now save this layer in your **My Places**.
  29. .. figure:: networklink.png
  30. Adding a network link
  31. Check out the sections on :ref:`google-earth-tutorials` and the :ref:`google-earth-kml-styling` for more information.