openlayers的很多概念我都不明白
I don't understand the many concepts of openlayers
我不是英语国家,所以语法可能有误。敬请谅解。
如果你能给我一个例子,我将不胜感激。
1) ol.source : I'm curious about the role of the source.
2) ol.feature : I wonder what is "feature"..
3) layer.getSource().clear() : Is this a function that exists in the
ol library?
对了,我有一个测距码,
代码很简单,就是不知道怎么用
Layer.getSource().start
- 什么是 "start" 函数..?
openlayers库中有"start"吗?还是有人制作和使用的?
我觉得"source"有各种功能..
var Btn = document.getElementById('button');
function distance() {
Layer.getSource().start({
map : map,
type : 'LineString'
});
}
Btn.addEventListener('click', distance);
没有错误,但是有没有办法查看"start"的内部?
搜索没找到
要查看 OpenLayers 函数,请查看 official API。
要开始使用 OpenLayers,您可以找到 basic concepts and good tutorials here.
1.) ol.source
是特征的容器(见下文),通常是 a 的数据源。 ol.layer
。这些图层是您在地图上看到的。大多数地图至少有一个 BaseLayer 和一些其他图层。考虑将街道作为 BaseLayer(背景)并将餐馆和酒吧的图标作为另一层(例如 ol.layer.vector
)的地图。
2.) feature
是一个地理对象。它具有几何图形(例如点、线、多边形)、属性(例如名称、数量、营业时间)和样式。在上面的示例中,餐厅可以是具有点几何、名称和营业时间作为属性以及 Icon
作为样式的要素。
3.) layer.getSource().clear()
确实是一个ol函数,它删除一个源的内容,例如vectorSource
: https://openlayers.org/en/latest/apidoc/module-ol_source_Vector-VectorSource.html#clear
您的 start
-方法不是官方的 OpenLayers 方法,它看起来是自制的。
我不是英语国家,所以语法可能有误。敬请谅解。 如果你能给我一个例子,我将不胜感激。
1) ol.source : I'm curious about the role of the source.
2) ol.feature : I wonder what is "feature"..
3) layer.getSource().clear() : Is this a function that exists in the
ol library?
对了,我有一个测距码, 代码很简单,就是不知道怎么用
Layer.getSource().start
- 什么是 "start" 函数..?
openlayers库中有"start"吗?还是有人制作和使用的?
我觉得"source"有各种功能..
var Btn = document.getElementById('button');
function distance() {
Layer.getSource().start({
map : map,
type : 'LineString'
});
}
Btn.addEventListener('click', distance);
没有错误,但是有没有办法查看"start"的内部? 搜索没找到
要查看 OpenLayers 函数,请查看 official API。
要开始使用 OpenLayers,您可以找到 basic concepts and good tutorials here.
1.) ol.source
是特征的容器(见下文),通常是 a 的数据源。 ol.layer
。这些图层是您在地图上看到的。大多数地图至少有一个 BaseLayer 和一些其他图层。考虑将街道作为 BaseLayer(背景)并将餐馆和酒吧的图标作为另一层(例如 ol.layer.vector
)的地图。
2.) feature
是一个地理对象。它具有几何图形(例如点、线、多边形)、属性(例如名称、数量、营业时间)和样式。在上面的示例中,餐厅可以是具有点几何、名称和营业时间作为属性以及 Icon
作为样式的要素。
3.) layer.getSource().clear()
确实是一个ol函数,它删除一个源的内容,例如vectorSource
: https://openlayers.org/en/latest/apidoc/module-ol_source_Vector-VectorSource.html#clear
您的 start
-方法不是官方的 OpenLayers 方法,它看起来是自制的。