Use lineDash in ol.style.Circle's and ol.style.RegularShape's stroke
This commit is contained in:
@@ -3,6 +3,7 @@ goog.provide('ol.style.Circle');
|
|||||||
goog.require('goog.dom');
|
goog.require('goog.dom');
|
||||||
goog.require('goog.dom.TagName');
|
goog.require('goog.dom.TagName');
|
||||||
goog.require('ol.color');
|
goog.require('ol.color');
|
||||||
|
goog.require('ol.has');
|
||||||
goog.require('ol.render.canvas');
|
goog.require('ol.render.canvas');
|
||||||
goog.require('ol.style.Fill');
|
goog.require('ol.style.Fill');
|
||||||
goog.require('ol.style.Image');
|
goog.require('ol.style.Image');
|
||||||
@@ -197,7 +198,7 @@ ol.style.Circle.prototype.unlistenImageChange = goog.nullFunction;
|
|||||||
*/
|
*/
|
||||||
ol.style.Circle.prototype.render_ = function() {
|
ol.style.Circle.prototype.render_ = function() {
|
||||||
var canvas = this.canvas_;
|
var canvas = this.canvas_;
|
||||||
var strokeStyle, strokeWidth;
|
var strokeStyle, strokeWidth, lineDash;
|
||||||
|
|
||||||
if (goog.isNull(this.stroke_)) {
|
if (goog.isNull(this.stroke_)) {
|
||||||
strokeWidth = 0;
|
strokeWidth = 0;
|
||||||
@@ -229,6 +230,10 @@ ol.style.Circle.prototype.render_ = function() {
|
|||||||
}
|
}
|
||||||
if (!goog.isNull(this.stroke_)) {
|
if (!goog.isNull(this.stroke_)) {
|
||||||
context.strokeStyle = strokeStyle;
|
context.strokeStyle = strokeStyle;
|
||||||
|
lineDash = this.stroke_.getLineDash();
|
||||||
|
if (ol.has.CANVAS_LINE_DASH && !goog.isNull(lineDash)) {
|
||||||
|
context.setLineDash(lineDash);
|
||||||
|
}
|
||||||
context.lineWidth = strokeWidth;
|
context.lineWidth = strokeWidth;
|
||||||
context.stroke();
|
context.stroke();
|
||||||
}
|
}
|
||||||
@@ -253,6 +258,10 @@ ol.style.Circle.prototype.render_ = function() {
|
|||||||
context.fill();
|
context.fill();
|
||||||
if (!goog.isNull(this.stroke_)) {
|
if (!goog.isNull(this.stroke_)) {
|
||||||
context.strokeStyle = strokeStyle;
|
context.strokeStyle = strokeStyle;
|
||||||
|
lineDash = this.stroke_.getLineDash();
|
||||||
|
if (ol.has.CANVAS_LINE_DASH && !goog.isNull(lineDash)) {
|
||||||
|
context.setLineDash(lineDash);
|
||||||
|
}
|
||||||
context.lineWidth = strokeWidth;
|
context.lineWidth = strokeWidth;
|
||||||
context.stroke();
|
context.stroke();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ goog.provide('ol.style.RegularShape');
|
|||||||
goog.require('goog.dom');
|
goog.require('goog.dom');
|
||||||
goog.require('goog.dom.TagName');
|
goog.require('goog.dom.TagName');
|
||||||
goog.require('ol.color');
|
goog.require('ol.color');
|
||||||
|
goog.require('ol.has');
|
||||||
goog.require('ol.render.canvas');
|
goog.require('ol.render.canvas');
|
||||||
goog.require('ol.style.Fill');
|
goog.require('ol.style.Fill');
|
||||||
goog.require('ol.style.Image');
|
goog.require('ol.style.Image');
|
||||||
@@ -215,7 +216,7 @@ ol.style.RegularShape.prototype.unlistenImageChange = goog.nullFunction;
|
|||||||
*/
|
*/
|
||||||
ol.style.RegularShape.prototype.render_ = function() {
|
ol.style.RegularShape.prototype.render_ = function() {
|
||||||
var canvas = this.canvas_;
|
var canvas = this.canvas_;
|
||||||
var strokeStyle, strokeWidth;
|
var strokeStyle, strokeWidth, lineDash;
|
||||||
|
|
||||||
if (goog.isNull(this.stroke_)) {
|
if (goog.isNull(this.stroke_)) {
|
||||||
strokeWidth = 0;
|
strokeWidth = 0;
|
||||||
@@ -257,6 +258,10 @@ ol.style.RegularShape.prototype.render_ = function() {
|
|||||||
}
|
}
|
||||||
if (!goog.isNull(this.stroke_)) {
|
if (!goog.isNull(this.stroke_)) {
|
||||||
context.strokeStyle = strokeStyle;
|
context.strokeStyle = strokeStyle;
|
||||||
|
lineDash = this.stroke_.getLineDash();
|
||||||
|
if (ol.has.CANVAS_LINE_DASH && !goog.isNull(lineDash)) {
|
||||||
|
context.setLineDash(lineDash);
|
||||||
|
}
|
||||||
context.lineWidth = strokeWidth;
|
context.lineWidth = strokeWidth;
|
||||||
context.stroke();
|
context.stroke();
|
||||||
}
|
}
|
||||||
@@ -290,6 +295,10 @@ ol.style.RegularShape.prototype.render_ = function() {
|
|||||||
context.fill();
|
context.fill();
|
||||||
if (!goog.isNull(this.stroke_)) {
|
if (!goog.isNull(this.stroke_)) {
|
||||||
context.strokeStyle = strokeStyle;
|
context.strokeStyle = strokeStyle;
|
||||||
|
lineDash = this.stroke_.getLineDash();
|
||||||
|
if (ol.has.CANVAS_LINE_DASH && !goog.isNull(lineDash)) {
|
||||||
|
context.setLineDash(lineDash);
|
||||||
|
}
|
||||||
context.lineWidth = strokeWidth;
|
context.lineWidth = strokeWidth;
|
||||||
context.stroke();
|
context.stroke();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user