概述
基于openlayer实现高德底图(墨卡托投影,3857)和GeoJSON图层(4326坐标系)的叠加显示,并实现GeoJSON图层的数据变换。
一、效果展示

二、代码实现
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/8.1.0/dist/ol.min.js"
integrity="sha512-Lu3mKY4gbgocyIAil/7VhNwTSQuvpcLwDyaNz2yhCymG1GiV98pcRsfePdAK7EarOsKHtEMYjhrAt4brBu3HuQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<title>Document</title>
<style>
body {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right</

本文介绍了如何使用OpenLayers在HTML中实现在墨卡托投影(3857)的高德底图与GeoJSON坐标系(4326)图层的叠加,并演示了如何动态切换GeoJSON数据。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



