• GIS工具maptalks开发手册(二)03——渲染面


    GIS工具maptalks开发手册(二)03——渲染面

    效果

    在这里插入图片描述

    1、html单页面

    index.html

    DOCTYPE html>
    <html>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>图形 - Polygontitle>
    <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 polygon = new maptalks.Polygon([
                [
                    [-0.131049, 51.498568],
                    [-0.107049, 51.498568],
                    [-0.107049, 51.493568],
                    [-0.131049, 51.493568],
                    [-0.131049, 51.498568]
                ]
            ], {
                visible: true,
                editable: true,
                cursor: 'pointer',
                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
                symbol: {
                    'lineColor': '#34495e',
                    'lineWidth': 2,
                    'polygonFill': 'rgb(135,196,240)',
                    'polygonOpacity': 0.6
                }
            });
    
            new maptalks.VectorLayer('vector', polygon).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
    • 67
    • 68
    2、vue版本

    index.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
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
  • 相关阅读:
    JVM学习笔记(四)类加载与字节码技术
    一种基于暗通道先验算法的图像去雾技术研究
    分析报告有样板了-奥威BI数据可视化报表模板
    银行 Zabbix 监控架构分享
    算法:贪心---跳一跳
    Boolean源码解剖学
    【目标追踪】ByteTrack: Multi-Object Tracking by Associating Every Detection Box
    机器学习基础之《回归与聚类算法(1)—线性回归》
    1、如何抓取Modbus TCP/UDP 数据包实战
    「太阁干货」详细解析MPLS转发原理
  • 原文地址:https://blog.csdn.net/weixin_44867717/article/details/128140475