简体   繁体   English

openlayers - 如何使用WebGl在openlayers中渲染矢量图层

[英]openlayers - how to render vector layer in openlayers with WebGl

I was used this tutorial and copy code of tutorial step by step but don't work for me. 我使用本教程并逐步复制教程代码,但对我不起作用。

As mentioned in the tutorial, I was used ?renderer=webgl as a query string. 正如教程中提到的,我使用了?renderer=webgl作为查询字符串。

here is jsfiddle of my code: https://jsfiddle.net/4gvdsjwj/ 这是我的代码的jsfiddlehttpsjsfiddle

What is wrong? 怎么了?

You need to include the 'renderer' option in your map definition. 您需要在地图定义中包含“渲染器”选项。

var map = new ol.Map({
layers: [layer],
renderer: 'webgl',
target: 'map',
view: new ol.View({
  center: [0, 0],
  zoom: 2
})

}); });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM