• GIS工具maptalks开发手册(二)02——渲染线


    GIS工具maptalks开发手册(二)02——渲染线

    效果

    在这里插入图片描述

    1、html版本

    LineString.html

    DOCTYPE html>
    <html>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>图形 - LineStringtitle>
    <style type="text/css">
        html,
        body {
            margin: 0px;
            height: 100%;
            width: 100%;
        }
    
        .container {
            width: 900px;
            height: 500px;
            margin: 50px;
        }
    style>
    <link rel="stylesheet" href="https://unpkg.com/maptalks/dist/maptalks.css">
    <script type="text/javascript" src="https://unpkg.com/maptalks/dist/maptalks.min.js">script>
    
    <body>
    
        <div id="map" class="container">div>
    
        <script>
            var map = new maptalks.Map('map', {
                center: [-0.113049, 51.498568],
                zoom: 14,
                baseLayer: new maptalks.TileLayer('base', {
                    urlTemplate: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
                    subdomains: ['a', 'b', 'c', 'd'],
                    attribution: OpenStreetMap contributors, © CARTO'
                })
            });
    
            var line = new maptalks.LineString([
                [-0.131049, 51.498568],
                [-0.107049, 51.498568]
            ], {
                arrowStyle: null, // arrow-style : now we only have classic  箭头样式:现在我们只有经典
                // 箭头位置
                arrowPlacement: 'vertex-last', // arrow's placement: vertex-first, vertex-last, vertex-firstlast, point
                visible: true, // 可见的
                editable: true, // 可编辑的
                cursor: null, // 光标
                shadowBlur: 0, // 阴影模糊
                shadowColor: 'black', // 阴影颜色
                draggable: false, // 是否可拖动
                // 拖动阴影 
                dragShadow: false, // display a shadow during dragging (拖动时显示阴影)
                // 轴上绘图
                drawOnAxis: null,  // force dragging stick on a axis, can be: x, y (轴上的力拖动杆,可以是:x,y)
                symbol: {
                    'lineColor': '#1bbc9b',
                    'lineWidth': 3
                }
            });
    
            new maptalks.VectorLayer('vector', line).addTo(map);
    
        script>
    body>
    
    html>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    2、vue版本
    
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
  • 相关阅读:
    【python基础】format格式化函数的使用
    MyBatis-Plus-入门操作(1)
    SAP UI5 里的 Busy Dialog 控件使用概述
    springboot+vue美容院美妆化妆品商城管理系统nodejs
    RocketMQ集群监控平台rocketmq-console
    windows常见的命令操作大全
    性能优化-中间件tomcat调优
    GameFrameWork框架(Unity3D)使用笔记(六)游戏主流程ProcedureMain——从数据表加载出所需实体
    On-Device Neural Net Inference with Mobile GPUs
    Field Play:Runge-Kutta
  • 原文地址:https://blog.csdn.net/weixin_44867717/article/details/128140409