OpenLayers和Wkhtmltopdf

问题描述

使用wkhtmltopdf将带有Openlayers映射的网页转换为pdf时遇到问题。我已在转换脚本中允许使用javascript,因此顶级脚本有效。我的问题是底部没有。目前,我使用type="module"来构建地图。该地图可以在pdf之前的版本中很好地构建,但是在pdf之后的转换中会出现空白。

这是对基本put javascript的测试...

    <script type="text/javascript">
        document.getElementById('body').innerHTML="new cont1ent";
    </script>
    

但这不是(这只是创建地图的整个脚本的一部分)...

    <script type="module">
        document.getElementById('body').innerHTML="new content";
    
      var Feature = ol.Feature; //import Feature from 'ol/Feature.js';
      var Map = ol.Map; //import Map from 'ol/Map.js';
      var View = ol.View; //import View from 'ol/View.js';
      var Polyline = ol.format.Polyline; //import Polyline from 'ol/format/Polyline.js';
      var GeoJSON = ol.format.GeoJSON;
      var Point = ol.geom.Point; //import Point from 'ol/geom/Point.js';
      var {Tile,Vector} = ol.layer; //import {Tile as TileLayer,Vector as VectorLayer} from 'ol/layer.js';
      var TileLayer = Tile;
      var Select = ol.interaction.Select;
      var VectorLayer = Vector;
      var {OSM} = ol.source;
      var {altKeyOnly,click,pointerMove} = ol.events.condition;
      var {equalTo} = ol.format.filter;

有人可以提出任何建议来帮助我创建地图并将页面(上面有其他数据)转换为pdf吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)