# 十四.OGCMapTile

# 1.瓦片图

查看代码详情
<template>
    <div ref="map" class="map"></div>
  </template>
  
  <script>
  export default {
    mounted() {
      let {
        Map,
        View,
        layer: { Tile: TileLayer },
        source: { OGCMapTile },
      } = ol;
      const map = new Map({
        target: this.$refs.map,
        layers: [
          new TileLayer({
            source: new OGCMapTile({
              url: "https://maps.ecere.com/ogcapi/collections/blueMarble/map/tiles/WorldCRS84Quad",
            }),
          }),
        ],
        view: new View({
          projection: "EPSG:4326",
          center: [12579156, 3274244],
          zoom: 1,
        }),
      });
    },
  };
  </script>
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