Ubuntu16.0.4 TileMill install and simple to use deployment

Statement 1: I Caishuxueqian, with Guo Degang words, "I was a schoolboy," if wrong, welcomed the discussion, do not abuse ^ _ ^.
Statement 2: Keep the original blog when reproduced the original link or add my blog address at the beginning of the article, or the right to retain legal liability.

Brief introduction

TileMill is a modern map design studio. In simple terms, TileMill is a map design, simplifying the complexity of the design with pictures.
GitHub Address: Portal
help documentation: Portal

Environmental requirements

  • Ubuntu 10.04+ (only tested with 18.04.2)
  • Node 8.11.x+ (may work on earlier version, not tested)
  • 2 GB memory
  • A modern browser (Chrome, Firefox)
  • Internet connection for remote datasources

Ready to work

Replacing mirroring Ali cloud mirroring, convenient package download Node.js later reference. (This can refer to my previous article ), this relatively easy to use if you have a ladder or foreign server, you can skip this step.

installation

  1. Installation Node.JS

    sudo apt install curl
    curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
    sudo apt-get install -y nodejs
    
  2. Install gcc

    sudo apt-get install gcc g++ make
    
  3. Download and install git TileMill Warehouse Code

    sudo apt install git
    git clone https://github.com/tilemill-project/tilemill.git
    cd tilemill
    npm install
    
  4. Start TileMill Service

    ./index.js --server=true --listenHost=0.0.0.0 --coreUrl=${_SERVER_IP_}:20009 --tileUrl=${_SERVER_IP_}:20008
    

    Such as: ./ index.js --server = true --listenHost = 0.0.0.0 --coreUrl = 192.168.80.218: 20009 --tileUrl = 192.168.80.218: 20008
    ${SERVER_IP}Replace with 实际的服务器IP, and then input in the browser ${SERVER_IP}:20009can access TileMill up. If the number goes well, you will see the following scenario:
    Here Insert Picture Description

  5. Running in the background (optional)
    running in the background if you want, it is recommended to install screen. Use on screen reference this blog linux screen tool

    apt install screen
    

Simple to use

  1. New Construction
    Here Insert Picture Description
  2. Add data, for example postgis this to me
    Here Insert Picture Description
    # 图层ID,这块我输入的是building,后面配置符号是会使用
    # 数据库连接信息
    host=192.168.90.110 port=5432 user=postgres password=postgres dbname=osm
    # 添加图层SQL,这块您也可以只保留您需要的字段,不建议使用*
    select gid,geom from gis_osm_buildings_a_free_1
    # 设置key Field,这块我的是gid
    # 设置Geometry Field,这块我的是geom
    # 设置Extent,这块我选择的是默认的,这块您也可以指定好具体的范围
    # 设置坐标系SRS,这块我选择的WGS84
    
  3. Configuring sign
    in style.mss file on the right, the configuration symbol, finished configuring the upper right corner click on the savebutton to take effect.
    Here Insert Picture Description
    style.mss file contents are as follows:
    Map {
      background-color: #b8dee6;
    }
    
    #building {
      ::outline {
        line-color: #85c5d3;
        line-width: 2;
        line-join: round;
      }
      polygon-fill: rgb(255,255,0);
    }
    #water {
      ::outline {
        line-color: #85c5d3;
        line-width: 2;
        line-join: round;
      }
      polygon-fill: rgb(0,255,255);
    }
    

The color of this supports input formats of the following:
- RGB format, such as RGB (128,128,128)
- ARGB format, such as RGBA (128,128,128,1)
- 16 hexadecimal color, such as #ffff. ( The RGB color value of a color code conversion hex tool )
5. Export xml format
Here Insert Picture Description

Symbolic

point

line

surface

Conditions symbolic

Draw Order

TileMill layer order can be seen in the left list of layers, the layer jump order may move the mouse to move the icon layer geometry.
Here Insert Picture Description

  1. Layers: "higher" layer fuzzy "lower" layer.
  2. Style sheet from left to right application.
  3. Stylesheet rules from top to bottom applications.

other

To be added

Reference material

  1. Walkthrough: Creating tiles with Mapnik using TileMill
  2. T ileMill Quick Start

Guess you like

Origin blog.csdn.net/yh0503/article/details/89351307