Add MultiLineString rendering
This commit is contained in:
@@ -2,6 +2,7 @@ goog.provide('ol.renderer.vector');
|
|||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('ol.geom.LineString');
|
goog.require('ol.geom.LineString');
|
||||||
|
goog.require('ol.geom.MultiLineString');
|
||||||
goog.require('ol.geom.Point');
|
goog.require('ol.geom.Point');
|
||||||
goog.require('ol.geom.Polygon');
|
goog.require('ol.geom.Polygon');
|
||||||
goog.require('ol.replay.IBatchGroup');
|
goog.require('ol.replay.IBatchGroup');
|
||||||
@@ -42,6 +43,27 @@ ol.renderer.vector.renderLineStringGeometry_ =
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ol.replay.IBatchGroup} batchGroup Batch group.
|
||||||
|
* @param {ol.geom.Geometry} geometry Geometry.
|
||||||
|
* @param {ol.style.Style} style Style.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
ol.renderer.vector.renderMultiLineStringGeometry_ =
|
||||||
|
function(batchGroup, geometry, style) {
|
||||||
|
if (goog.isNull(style.stroke)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
goog.asserts.assert(geometry instanceof ol.geom.MultiLineString);
|
||||||
|
var multiLineStringGeometry = /** @type {ol.geom.MultiLineString} */
|
||||||
|
(geometry);
|
||||||
|
var batch = batchGroup.getBatch(
|
||||||
|
style.zIndex, ol.replay.BatchType.STROKE_LINE);
|
||||||
|
batch.setFillStrokeStyle(null, style.stroke);
|
||||||
|
batch.drawMultiLineStringGeometry(multiLineStringGeometry);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.replay.IBatchGroup} batchGroup Batch group.
|
* @param {ol.replay.IBatchGroup} batchGroup Batch group.
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {ol.geom.Geometry} geometry Geometry.
|
||||||
@@ -96,5 +118,6 @@ ol.renderer.vector.renderPolygonGeometry_ =
|
|||||||
ol.renderer.vector.GEOMETRY_RENDERERS_ = {
|
ol.renderer.vector.GEOMETRY_RENDERERS_ = {
|
||||||
'Point': ol.renderer.vector.renderPointGeometry_,
|
'Point': ol.renderer.vector.renderPointGeometry_,
|
||||||
'LineString': ol.renderer.vector.renderLineStringGeometry_,
|
'LineString': ol.renderer.vector.renderLineStringGeometry_,
|
||||||
'Polygon': ol.renderer.vector.renderPolygonGeometry_
|
'Polygon': ol.renderer.vector.renderPolygonGeometry_,
|
||||||
|
'MultiLineString': ol.renderer.vector.renderMultiLineStringGeometry_
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user