Going with point, line, and polygon symbolizers
Separate fill and stroke symbolizers make a nicer API, but less efficient rendering
This commit is contained in:
@@ -1,27 +0,0 @@
|
|||||||
goog.provide('ol.style.LiteralFill');
|
|
||||||
|
|
||||||
goog.require('ol.style.LiteralSymbolizer');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{color: (string),
|
|
||||||
* opacity: (number)}}
|
|
||||||
*/
|
|
||||||
ol.style.LiteralFillConfig;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
* @implements {ol.style.LiteralSymbolizer}
|
|
||||||
* @param {ol.style.LiteralFillConfig} config Symbolizer properties.
|
|
||||||
*/
|
|
||||||
ol.style.LiteralFill = function(config) {
|
|
||||||
|
|
||||||
/** @type {string} */
|
|
||||||
this.color = config.color;
|
|
||||||
|
|
||||||
/** @type {number} */
|
|
||||||
this.opacity = config.opacity;
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
goog.provide('ol.style.LiteralLine');
|
||||||
|
|
||||||
|
goog.require('ol.style.LiteralSymbolizer');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {{strokeStyle: (string),
|
||||||
|
* strokeWidth: (number),
|
||||||
|
* opacity: (number)}}
|
||||||
|
*/
|
||||||
|
ol.style.LiteralLineConfig;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
* @implements {ol.style.LiteralSymbolizer}
|
||||||
|
* @param {ol.style.LiteralLineConfig} config Symbolizer properties.
|
||||||
|
*/
|
||||||
|
ol.style.LiteralLine = function(config) {
|
||||||
|
|
||||||
|
/** @type {string} */
|
||||||
|
this.strokeStyle = config.strokeStyle;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
this.strokeWidth = config.strokeWidth;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
this.opacity = config.opacity;
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
goog.provide('ol.style.LiteralPoint');
|
||||||
|
|
||||||
|
goog.require('ol.style.LiteralSymbolizer');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @interface
|
||||||
|
* @implements {ol.style.LiteralSymbolizer}
|
||||||
|
*/
|
||||||
|
ol.style.LiteralPoint = function() {};
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
goog.provide('ol.style.LiteralPolygon');
|
||||||
|
|
||||||
|
goog.require('ol.style.LiteralSymbolizer');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {{fillStyle: (string),
|
||||||
|
* strokeStyle: (string),
|
||||||
|
* strokeWidth: (number),
|
||||||
|
* opacity: (number)}}
|
||||||
|
*/
|
||||||
|
ol.style.LiteralPolygonConfig;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
* @implements {ol.style.LiteralSymbolizer}
|
||||||
|
* @param {ol.style.LiteralPolygonConfig} config Symbolizer properties.
|
||||||
|
*/
|
||||||
|
ol.style.LiteralPolygon = function(config) {
|
||||||
|
|
||||||
|
/** @type {string} */
|
||||||
|
this.fillStyle = config.fillStyle;
|
||||||
|
|
||||||
|
/** @type {string} */
|
||||||
|
this.strokeStyle = config.strokeStyle;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
this.strokeWidth = config.strokeWidth;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
this.opacity = config.opacity;
|
||||||
|
|
||||||
|
};
|
||||||
+17
-10
@@ -1,8 +1,7 @@
|
|||||||
goog.provide('ol.style.LiteralShape');
|
goog.provide('ol.style.LiteralShape');
|
||||||
|
goog.provide('ol.style.ShapeType');
|
||||||
|
|
||||||
goog.require('ol.style.LiteralFill');
|
goog.require('ol.style.LiteralPoint');
|
||||||
goog.require('ol.style.LiteralStroke');
|
|
||||||
goog.require('ol.style.LiteralSymbolizer');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,8 +15,10 @@ ol.style.ShapeType = {
|
|||||||
/**
|
/**
|
||||||
* @typedef {{type: (ol.style.ShapeType),
|
* @typedef {{type: (ol.style.ShapeType),
|
||||||
* size: (number),
|
* size: (number),
|
||||||
* fill: (ol.style.LiteralFill),
|
* fillStyle: (string),
|
||||||
* stroke: (ol.style.LiteralStroke)}}
|
* strokeStyle: (string),
|
||||||
|
* strokeWidth: (number),
|
||||||
|
* opacity: (number)}}
|
||||||
*/
|
*/
|
||||||
ol.style.LiteralShapeConfig;
|
ol.style.LiteralShapeConfig;
|
||||||
|
|
||||||
@@ -25,7 +26,7 @@ ol.style.LiteralShapeConfig;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @implements {ol.style.LiteralSymbolizer}
|
* @implements {ol.style.LiteralPoint}
|
||||||
* @param {ol.style.LiteralShapeConfig} config Symbolizer properties.
|
* @param {ol.style.LiteralShapeConfig} config Symbolizer properties.
|
||||||
*/
|
*/
|
||||||
ol.style.LiteralShape = function(config) {
|
ol.style.LiteralShape = function(config) {
|
||||||
@@ -36,10 +37,16 @@ ol.style.LiteralShape = function(config) {
|
|||||||
/** @type {number} */
|
/** @type {number} */
|
||||||
this.size = config.size;
|
this.size = config.size;
|
||||||
|
|
||||||
/** @type {ol.style.LiteralFill} */
|
/** @type {string} */
|
||||||
this.fill = config.fill;
|
this.fillStyle = config.fillStyle;
|
||||||
|
|
||||||
/** @type {ol.style.LiteralStroke} */
|
/** @type {string} */
|
||||||
this.stroke = config.stroke;
|
this.strokeStyle = config.strokeStyle;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
this.strokeWidth = config.strokeWidth;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
this.opacity = config.opacity;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
goog.provide('ol.style.LiteralStroke');
|
|
||||||
|
|
||||||
goog.require('ol.style.LiteralSymbolizer');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{width: (number),
|
|
||||||
* color: (string),
|
|
||||||
* opacity: (number)}}
|
|
||||||
*/
|
|
||||||
ol.style.LiteralStrokeConfig;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
* @implements {ol.style.LiteralSymbolizer}
|
|
||||||
* @param {ol.style.LiteralStrokeConfig} config Symbolizer properties.
|
|
||||||
*/
|
|
||||||
ol.style.LiteralStroke = function(config) {
|
|
||||||
|
|
||||||
/** @type {string} */
|
|
||||||
this.color = config.color;
|
|
||||||
|
|
||||||
/** @type {number} */
|
|
||||||
this.opacity = config.opacity;
|
|
||||||
|
|
||||||
/** @type {number} */
|
|
||||||
this.width = config.width;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user