当前位置:网站首页>GeoServer + openlayers
GeoServer + openlayers
2022-07-30 15:32:00 【Study hard and love you hard!】
GeoServer 安装
前提有java环境
安装地址
https://geoserver.org/release/stable/
Here is an example of binary download
下载后解压
D:\Program Files (x86)\geoserver-2.21.0-bin\bin
http://localhost:8080/geoserver 进入服务
使用默认用户名admin和密码geoserver登陆
Source preparation
百度网盘下载 Map software all-around map
链接:https://pan.baidu.com/s/1UZGx86R1b4VBDO9HOD-gFw
提取码:0125
下载后解压
Except for choosing the installation location 一路next
Almighty map downloader to use
打开后 先试用一个月
A map source can be selected I chose the map -》谷歌地图-》混合
地图级别 我选择的是12 可以自行选择
Download First select an area with the rectangle tool or other tools
Click on the task list to customize the name
地图下载 设置 定义格式 Click on the map to download 开始 开始下载
The format, etc. can be defaulted
选择是 拼接
Select these three and click Splicing
Put the image source in geoServer服务器上

Creative workspace
Select a repository 点击geoTIFF 栅格数据上传
The workspace selection has just been created
数据源名称 自己填写
下面地址 To select the image source address just now tif文件
点击发布
然后保存即可
图层预览-》Select the layer you just created 点击openlayers进行预览
部署成功 ,The latitude and longitude are displayed in the lower right corner
openlayers 使用
Since our deployment is using wmsway so choosewmsSample loading image source
我选择的是https://openlayers.org/en/latest/examples/epsg-4326.html
vueThe project needs to run npm install ol 导入openlayers
in the sample main.js放到mounted函数中
Extract the page and place it on top
The writing of this example is extracted as follows
<template>
<div id="map" class="map"></div>
</template>
<script> import Map from "ol/Map"; import TileLayer from "ol/layer/Tile"; import TileWMS from "ol/source/TileWMS"; import View from "ol/View"; import {
ScaleLine, defaults as defaultControls } from "ol/control"; export default {
mounted() {
const layers = [ new TileLayer({
source: new TileWMS({
url: "http://localhost:8080/geoserver/ouc/wms", //To change the address to your own, see below params: {
LAYERS: "ouc:google mix07292025", //Layers too See below TILED: true, }, }), }), ]; new Map({
controls: defaultControls().extend([ new ScaleLine({
units: "degrees", }), ]), layers: layers, target: "map", view: new View({
projection: "EPSG:4326", center: [120.44, 36.13], zoom: 12, }), }); }, }; </script>
<style> .map {
height: 400px; width: 100%; } </style>
in the layer preview F12 network ctrl+RCall out the request

url Prefix to the requestwms

图层为
启动服务 运行成功
作者声明
如有问题,欢迎指正!
边栏推荐
- Smart Contract Security - Private Data Access
- Could not acquire management access for administration
- Office Automation | Office Software and Edraw MindMaster Shortcuts
- 学习 MySQL 需要知道的 28 个小技巧
- Lock wait timeout exceeded解决方案
- 定时任务 corn
- The evolution of content products has three axes: traffic, technology, and product form
- 【云原生】服务行业案例-不可预测的并发场景解决方案
- 第十一章 api mgmnt API 参考
- MySQL客户端工具的使用与MySQL SQL语句
猜你喜欢

Meta首份元宇宙白皮书9大看点,瞄准80万亿美元市场

(科普文)什么是碎片化NFT(Fractional NFT)

使用 protobuf 进行数据序列化

JVM performance tuning

DocuWare 文件管理与工作流程自动化案例研究——DocuWare 工作流程功能使在家工作的员工能够保持沟通和高效工作,支持混合环境

去腾讯面试,直接让人出门左拐 :幂等性都不知道!

Understand Chisel language. 28. Chisel advanced finite state machine (2) - Mealy state machine and comparison with Moore state machine

嵌入式开发:嵌入式基础知识——正确启动固件项目的 10 条建议

In-depth analysis of Kubernetes application management

那些破釜沉舟入局Web3.0的互联网精英都怎么样了?
随机推荐
极验深知v2分析
(Crypto必备干货)详细分析目前NFT的几大交易市场
ESP32 Repeated Reboot Issue Arduino Shield Power Outage Detector
golang图片处理库image简介
MongoDB启动报错 Process: 29784 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=14)
Web3创始人和建设者必备指南:如何构建适合的社区?
1700. 无法吃午餐的学生数量
Mysql数据库查询好慢,除了索引,还能因为什么?
关于MySQL主从复制的数据同步延迟问题
超T动力 盈运天下——中国重汽黄河/豪沃WP14T产品首发荣耀上市!
微服务该如何拆分?
Flink优化
English语法_不定代词 - both / either / neither
4 senior experts share the insider architecture design and implementation principles of Flink technology with years of experience in large factories
Lock wait timeout exceeded解决方案
国内数字藏品的乱象与未来
MySql报错:SqlError(Unable to execute query“, “Can‘t create/write to file OS errno 2 - No such file...
DocuWare 文件管理与工作流程自动化案例研究——DocuWare 工作流程功能使在家工作的员工能够保持沟通和高效工作,支持混合环境
华为云重磅发布开源软件治理服务——软件成分分析
学习 MySQL 需要知道的 28 个小技巧