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

Publishing the results as a web application

Now that we have completed our modeling for the site selection of a farmland for conservation, let's take steps to publish this for the Web.

qgis2leaf

qgis2leaf allows us to export our QGIS map to web map formats (JavaScript, HTML, and CSS) using the Leaflet map API. Leaflet is a very lightweight, extensible, and responsive (and trendy) web mapping interface.

qgis2leaf converts all our vector layers to GeoJSON, which is the most common textual way to express the geographic JavaScript objects. As our operational layer is in GeoJSON, Leaflet's click interaction is supported, and we can access the information in the layers by clicking. It is a fully editable HTML and JavaScript file. You can customize and upload it to an accessible web location, as you'll understand in subsequent chapters.

qgis2leaf is very simple to use as long as the layers are prepared properly (for example, with respect to CRS) up to this point. It is also very powerful in creating a good starting application including GeoJSON, HTML, and JavaScript for our Leaflet web map. Perform the following steps:

  1. Make sure to install the qgis2leaf plugin if you haven't already.
  2. Navigate to Web | qgis2leaf | Exports a QGIS Project to a working Leaflet webmap.
  3. Click on the Get Layers button to add the currently displayed layers to the set that qgis2leaf will export.
  4. Choose a basemap and enter the additional details if so desired.
  5. Select Encode to JSON.

These steps will produce a map application similar to the following one. We'll take a look at how to restore the labels in the next chapter:

主站蜘蛛池模板: 宜川县| 博乐市| 吉木萨尔县| 三原县| 门源| 曲水县| 绥滨县| 尼勒克县| 英吉沙县| 嘉黎县| 和政县| 镇平县| 宜宾市| 东平县| 通渭县| 宝丰县| 屏东县| 琼海市| 湛江市| 巴彦淖尔市| 如皋市| 红桥区| 株洲市| 金阳县| 视频| 滨州市| 南雄市| 砚山县| 岑巩县| 安平县| 中牟县| 靖边县| 闵行区| 绍兴县| 华坪县| 微博| 涿鹿县| 疏附县| 偃师市| 乌兰浩特市| 沂源县|