官术网_书友最值得收藏!

The KML preview

We have seen that other than OpenLayers, several preview formats are available. Now we will use another popular format: Keyhole Markup Language (KML). This time, GeoServer will not open up an application as you select the layer to preview. In fact, KML is a data format and you will need another piece of software to display it on a map. Perform the following steps:

  1. If you have not already installed Google Earth, you can download it from http://www.google.com//earth/desktop.
Google also delivers a web version of Google Earth; it does not require you to install anything on your computer. You just need to have a recent release of the Google Chrome browser. Unfortunately, the online version of Google Earth does not allow you to load external KML files.
  1. Accept the license agreement and save the installation file. Then, execute it and install Google Earth on your personal computer.
  2. Point your browser to the Layer Preview page, scroll to the topp:states layer, and click on the KML link.
  3. You are prompted to save or open the KML output file. Save it on your filesystem.
  4. Open the KML file in Google Earth. Consider the following screenshot:

OK, that was pretty cool. We had GeoServer displaying layers on Google Earth. Drop the book and play around with Google Earth. Zoom in and out, and notice how it streams data from GeoServer. In fact, the KML file does not contain any data, just a reference to them. Any operation on the map triggers a request to GeoServer, and its response is a stream of data to the Google Earth client.

主站蜘蛛池模板: 鹤山市| 突泉县| 望奎县| 肥东县| 霍林郭勒市| 西宁市| 塘沽区| 巍山| 新巴尔虎右旗| 绍兴县| 陆良县| 云安县| 天祝| 沅陵县| 沽源县| 丰台区| 西丰县| 邵阳县| 西乌珠穆沁旗| 高州市| 衡阳县| 赤水市| 林周县| 玉环县| 乐亭县| 张家界市| 罗城| 辛集市| 南靖县| 城口县| 喜德县| 咸阳市| 崇礼县| 丰镇市| 颍上县| 丹凤县| 兴安盟| 蓬安县| 兖州市| 枝江市| 溧阳市|