Replace ol.geom.GeometryType with ol.geom.Type
This commit is contained in:
@@ -15,11 +15,11 @@ goog.require('ol.symbol');
|
|||||||
var image = ol.symbol.renderCircle(5, null, {color: 'red', width: 1});
|
var image = ol.symbol.renderCircle(5, null, {color: 'red', width: 1});
|
||||||
var styleFunction = function(feature) {
|
var styleFunction = function(feature) {
|
||||||
switch (feature.getGeometry().getType()) {
|
switch (feature.getGeometry().getType()) {
|
||||||
case ol.geom.GeometryType.POINT:
|
case ol.geom.Type.POINT:
|
||||||
return {
|
return {
|
||||||
image: image
|
image: image
|
||||||
};
|
};
|
||||||
case ol.geom.GeometryType.POLYGON:
|
case ol.geom.Type.POLYGON:
|
||||||
return {
|
return {
|
||||||
stroke: {
|
stroke: {
|
||||||
color: 'blue',
|
color: 'blue',
|
||||||
@@ -29,14 +29,14 @@ var styleFunction = function(feature) {
|
|||||||
color: 'rgba(0, 0, 255, 0.1)'
|
color: 'rgba(0, 0, 255, 0.1)'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
case ol.geom.GeometryType.MULTI_LINE_STRING:
|
case ol.geom.Type.MULTI_LINE_STRING:
|
||||||
return {
|
return {
|
||||||
stroke: {
|
stroke: {
|
||||||
color: 'green',
|
color: 'green',
|
||||||
width: 1
|
width: 1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
case ol.geom.GeometryType.MULTI_POLYGON:
|
case ol.geom.Type.MULTI_POLYGON:
|
||||||
return {
|
return {
|
||||||
stroke: {
|
stroke: {
|
||||||
color: 'yellow',
|
color: 'yellow',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ goog.require('ol.extent');
|
|||||||
/**
|
/**
|
||||||
* @enum {string}
|
* @enum {string}
|
||||||
*/
|
*/
|
||||||
ol.geom.GeometryType = {
|
ol.geom.Type = {
|
||||||
POINT: 'Point',
|
POINT: 'Point',
|
||||||
LINE_STRING: 'LineString',
|
LINE_STRING: 'LineString',
|
||||||
POLYGON: 'Polygon',
|
POLYGON: 'Polygon',
|
||||||
@@ -156,7 +156,7 @@ ol.geom.Geometry.prototype.getStride = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {ol.geom.GeometryType} Geometry type.
|
* @return {ol.geom.Type} Geometry type.
|
||||||
*/
|
*/
|
||||||
ol.geom.Geometry.prototype.getType = goog.abstractMethod;
|
ol.geom.Geometry.prototype.getType = goog.abstractMethod;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ ol.geom.LineString.prototype.getCoordinates = function() {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString.prototype.getType = function() {
|
ol.geom.LineString.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.LINE_STRING;
|
return ol.geom.Type.LINE_STRING;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ ol.geom.MultiLineString.prototype.getEnds = function() {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.getType = function() {
|
ol.geom.MultiLineString.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.MULTI_LINE_STRING;
|
return ol.geom.Type.MULTI_LINE_STRING;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ ol.geom.MultiPoint.prototype.getCoordinates = function() {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPoint.prototype.getType = function() {
|
ol.geom.MultiPoint.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.MULTI_POINT;
|
return ol.geom.Type.MULTI_POINT;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ ol.geom.MultiPolygon.prototype.getEndss = function() {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.getType = function() {
|
ol.geom.MultiPolygon.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.MULTI_POLYGON;
|
return ol.geom.Type.MULTI_POLYGON;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ ol.geom.Point.prototype.getExtent = function(opt_extent) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.geom.Point.prototype.getType = function() {
|
ol.geom.Point.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.POINT;
|
return ol.geom.Type.POINT;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ ol.geom.Polygon.prototype.getEnds = function() {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.getType = function() {
|
ol.geom.Polygon.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.POLYGON;
|
return ol.geom.Type.POLYGON;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ ol.render.canvas.Immediate.prototype.setImageStyle = function(imageStyle) {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @private
|
* @private
|
||||||
* @type {Object.<ol.geom.GeometryType,
|
* @type {Object.<ol.geom.Type,
|
||||||
* function(this: ol.render.canvas.Immediate, ol.geom.Geometry)>}
|
* function(this: ol.render.canvas.Immediate, ol.geom.Geometry)>}
|
||||||
*/
|
*/
|
||||||
ol.render.canvas.Immediate.GEOMETRY_RENDERES_ = {
|
ol.render.canvas.Immediate.GEOMETRY_RENDERES_ = {
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ ol.renderer.vector.renderPolygonGeometry_ =
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @private
|
* @private
|
||||||
* @type {Object.<ol.geom.GeometryType,
|
* @type {Object.<ol.geom.Type,
|
||||||
* function(ol.render.IReplayReplayGroup, ol.geom.Geometry,
|
* function(ol.render.IReplayReplayGroup, ol.geom.Geometry,
|
||||||
* ol.style.Style)>}
|
* ol.style.Style)>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user