openlayers:实现显示瓦片网格信息
要在OpenLayers中实现显示瓦片网格信息,可以通过添加一个额外的矢量图层来实现。以下是一个示例代码,展示如何在OpenLayers中实现显示瓦片网格信息:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenLayers Tile Grid Information</title>
<!-- 引入 OpenLayers 库 -->
<link rel="stylesheet" href="https://openlayers.org/en/latest/css/ol.css" type="text/css">
<script src="https://openlayers.org/en/latest/build/ol.js"></script>
<style>
#map {
width: 100%;
height: 400px;
}
.tile-grid {
stroke: rgba(0