当前位置: 首页 > news >正文

OL4加载geowebcache 部署的离线切片

部署离线切片,我们部署到SQLite数据库或者mysql,在这里我们部署到本地切片,切片下载是用的太乐下载器,如果没有买可以参考Gmap.NET 详请及下载器的使用见webgis离线部署

效果:
在这里插入图片描述
部署过程:
1、新建一个空文件夹(arcgis 名字随便起),并配置到geowebcache中的web.xml中
添加如下标签

  <context-param>
        <param-name>GEOWEBCACHE_CACHE_DIR</param-name>
        <param-value>E:/tile/arcgis</param-value>
    </context-param>

param-value是你所建的文件夹
2、启动tomcat,
在启动tomcat 之后我们在arcgis文件夹中可以看到
在这里插入图片描述
上面四个文件,Layers文件是我存储arcgistile图层信息创建,不是tomcat启动后生成的。
3、修改arcgis文件夹中,geowebcache.xml
添加如下代码
代码:

	<!--
    tilingScheme:具体某个瓦片的配置文件的地址
    tileCachePath:具体瓦片图片的文件夹地址
-->
   <arcgisLayer> 
     <name>zhengzhou</name>
       <tilingScheme>E:\\tile\\arcgis\\Layers\\conf.xml</tilingScheme>
      <tileCachePath>E:\\tile\\arcgis\Layers\\_alllayers</tileCachePath>
      <hexZoom>false</hexZoom>
   </arcgisLayer>

在这里插入图片描述
4、geowebcache-core-context需要加

 <bean id="gwcArcGIGridsetConfigutation" class="org.geowebcache.arcgis.layer.ArcGISCacheGridsetConfiguration"/> 

5、启动tomcat就可以,注由于版本问题不一定能预览,但是不妨碍加载数据

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>加载离线切片</title>
    <link href="../script/ol4/ol.css" rel="stylesheet" />
    <script src="../script/ol4/ol.js"></script>
    <style >
        #map {
            height: 100vh;
        }
    </style>
</head>
<body>
    <div id="map"></div>
   <script>
       var format = 'image/png';
       var tiled = new ol.layer.Tile({
           //visible: false,
           source: new ol.source.TileWMS({
               url: 'http://localhost:8888/geowebcache/service/wms',
               params: {
                   'FORMAT': format,
                   'VERSION': '1.1.1',
                   tiled: true,
                   "LAYERS": 'zhengzhou',
                   "exceptions": 'application/vnd.ogc.se_inimage',
                   
               }
           })
       });
       var view = new ol.View({
           projection:"EPSG:4326",
           zoom: 13,
           center: [113.33, 34.01]
       });
       var map = new ol.Map({
           target: 'map',
           layers: [tiled],
           view:view
       });
   </script>
</body>
</html>

注意:
1、首先这个切片肯定偏移,这里加载的高德切片,关于切片纠偏,一些收费的切片下载器,会自动处理,这里只能自己处理,博主还没有解决方案,有了补上。
2、按照原博主部署切片,要用geowebcache1.8版本,如果高版本,无法预览,但是不影响OL或者leaflet加载
3、使用范围有限
4、geowebcache-core-context需要加

 <bean id="gwcArcGIGridsetConfigutation" class="org.geowebcache.arcgis.layer.ArcGISCacheGridsetConfiguration"/> 

如果不加,tomcat启动会出现一下类似错误

10 四月 18:12:15 (main) WARN [support.XmlWebApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gwcXmlConfig' defined in ServletContext resource [/WEB-INF/geowebcache-core-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: No ArcGISCacheGridsetConfiguration could be found
10 四月 18:12:15 (main) ERROR [context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gwcXmlConfig' defined in ServletContext resource [/WEB-INF/geowebcache-core-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: No ArcGISCacheGridsetConfiguration could be found
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)

转载于:https://www.cnblogs.com/tuboshu/p/10752263.html

相关文章:

  • 在Net MVC中应用JsTree
  • nginx代理tcp协议连接mysql
  • markdown操作手册
  • [转载]URI 源码分析
  • HTML之常用标签及属性
  • jmeter 常见问题汇总
  • SPOJ COT3.Combat on a tree(博弈论 Trie合并)
  • HDU 2883 kebab
  • C++学习笔记30,指针的引用(2)
  • fatal error C1010: 在查找预编译头时遇到意外的文件结尾
  • c# Winform dev控件之ChartControl
  • Spring框架学习07——基于传统代理类的AOP实现
  • html迪士尼网页实现代码
  • HDU 2159 FATE
  • es 基于match_phrase/fuzzy的模糊匹配原理及使用
  • 【comparator, comparable】小总结
  • 【剑指offer】让抽象问题具体化
  • 【每日笔记】【Go学习笔记】2019-01-10 codis proxy处理流程
  • Date型的使用
  • Docker 笔记(1):介绍、镜像、容器及其基本操作
  • es6要点
  • JavaScript 一些 DOM 的知识点
  • js数组之filter
  • nodejs:开发并发布一个nodejs包
  • node学习系列之简单文件上传
  • Python_OOP
  • SegmentFault 技术周刊 Vol.27 - Git 学习宝典:程序员走江湖必备
  • Wamp集成环境 添加PHP的新版本
  • 开源SQL-on-Hadoop系统一览
  • 力扣(LeetCode)22
  • 我是如何设计 Upload 上传组件的
  • 原创:新手布局福音!微信小程序使用flex的一些基础样式属性(一)
  • 长三角G60科创走廊智能驾驶产业联盟揭牌成立,近80家企业助力智能驾驶行业发展 ...
  • # .NET Framework中使用命名管道进行进程间通信
  • # 计算机视觉入门
  • # 睡眠3秒_床上这样睡觉的人,睡眠质量多半不好
  • #stm32驱动外设模块总结w5500模块
  • (01)ORB-SLAM2源码无死角解析-(66) BA优化(g2o)→闭环线程:Optimizer::GlobalBundleAdjustemnt→全局优化
  • (1综述)从零开始的嵌入式图像图像处理(PI+QT+OpenCV)实战演练
  • (poj1.2.1)1970(筛选法模拟)
  • (Redis使用系列) Springboot 使用redis的List数据结构实现简单的排队功能场景 九
  • (附源码)spring boot基于Java的电影院售票与管理系统毕业设计 011449
  • (十)c52学习之旅-定时器实验
  • (四)JPA - JQPL 实现增删改查
  • .net core控制台应用程序初识
  • .Net Core与存储过程(一)
  • .net php 通信,flash与asp/php/asp.net通信的方法
  • .NET 中什么样的类是可使用 await 异步等待的?
  • .NET/C# 编译期间能确定的相同字符串,在运行期间是相同的实例
  • .NET/C# 获取一个正在运行的进程的命令行参数
  • .netcore 获取appsettings
  • .NET开发者必备的11款免费工具
  • :not(:first-child)和:not(:last-child)的用法
  • @RequestBody与@ResponseBody的使用
  • [ 隧道技术 ] cpolar 工具详解之将内网端口映射到公网