管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2024-09-27 b637dca4802288affff11d528bfb0a6328a8ce79
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
76
77
78
79
80
<!doctype html>
<html lang="en">
<head>
  <meta http-equiv="Expires" content="0" />
  <meta http-equiv="Cache" content="no-cache" />
  <meta http-equiv="Pragma" content="no-cache" />
  <meta http-equiv="Cache-control" content="no-cache" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css">
  <!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
  <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
  <script src="https://openlayers.org/en/v4.6.5/build/ol.js"></script>
  <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.13.0/css/ol.css" type="text/css"> -->
  <style>
    body {
      margin: 0;
      width: 100%;
      height: 100vh;
    }
 
    .map-class {
      height: 100%;
      width: 100%;
    }
  </style>
  <!-- 加载OpenLayers 类库 -->
  <!-- <script src="https://cdn.jsdelivr.net/npm/ol@v7.1.0/dist/ol.js"></script>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ol@v7.1.0/ol.css"> -->
  <!-- <script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.13.0/build/ol.js"></script> -->
  <title>OpenLayers例子</title>
</head>
<body>
  <div id="map" class="map-class"></div>
 
  <script type="text/javascript">
    // 天地图底图
    var source = new ol.source.XYZ({
      url: 'http://127.0.0.1:8088/02/{z}/{x}/{y}.png'
    })
    var tileLayer = new ol.layer.Tile({
      title: '天地图',
      source: source
    });
 
    var tlLayer = new ol.layer.Image({
      source: new ol.source.ImageWMS({
        //url: 'http://localhost:8097/geoserver/dtdt/wms',
        url: "http://127.0.0.1:8088/geoserver/LF/wms",
        params: {
          'FORMAT': 'image/png',
          'VERSION': '1.1.1',
          //"LAYERS": 'dtdt:tl'
          "LAYERS": 'LF:tl'
        }
      })
    });
 
    var map = new ol.Map({
      target: 'map',
      controls: ol.control.defaults({
        attributionOptions: ({
          collapsible: true
        })
      }),
      layers: [
        tileLayer, tlLayer
      ],
      view: new ol.View({
        center: ol.proj.transform([105.02, 34.9], 'EPSG:4326', 'EPSG:3857'),
        zoom: 4,
        minZoom: 0,
        maxZoom: 18,
        //projection: "EPSG:4326"
        projection: "EPSG:3857"
      })
    });
  </script>
</body>
</html>