Remove useless style method
This commit is contained in:
@@ -436,8 +436,6 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} olx.interaction.ModifyOptions
|
* @typedef {Object} olx.interaction.ModifyOptions
|
||||||
* @property {ol.feature.StyleFunction|undefined} styleFunction
|
|
||||||
* the styleFunction for the feature
|
|
||||||
* @property {number|undefined} pixelTolerance Pixel tolerance for considering
|
* @property {number|undefined} pixelTolerance Pixel tolerance for considering
|
||||||
* the pointer close enough to a vertex for editing. Default is 20 pixels.
|
* the pointer close enough to a vertex for editing. Default is 20 pixels.
|
||||||
* @property {ol.render.FeaturesOverlay} featuresOverlay Features overlay.
|
* @property {ol.render.FeaturesOverlay} featuresOverlay Features overlay.
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ goog.require('ol.MapBrowserEvent.EventType');
|
|||||||
goog.require('ol.ViewHint');
|
goog.require('ol.ViewHint');
|
||||||
goog.require('ol.coordinate');
|
goog.require('ol.coordinate');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.geom.GeometryType');
|
|
||||||
goog.require('ol.geom.LineString');
|
goog.require('ol.geom.LineString');
|
||||||
goog.require('ol.geom.MultiLineString');
|
goog.require('ol.geom.MultiLineString');
|
||||||
goog.require('ol.geom.MultiPoint');
|
goog.require('ol.geom.MultiPoint');
|
||||||
@@ -19,9 +18,6 @@ goog.require('ol.geom.Polygon');
|
|||||||
goog.require('ol.interaction.Drag');
|
goog.require('ol.interaction.Drag');
|
||||||
goog.require('ol.render.FeaturesOverlay');
|
goog.require('ol.render.FeaturesOverlay');
|
||||||
goog.require('ol.structs.RBush');
|
goog.require('ol.structs.RBush');
|
||||||
goog.require('ol.style.Circle');
|
|
||||||
goog.require('ol.style.Fill');
|
|
||||||
goog.require('ol.style.Stroke');
|
|
||||||
goog.require('ol.style.Style');
|
goog.require('ol.style.Style');
|
||||||
|
|
||||||
|
|
||||||
@@ -117,65 +113,6 @@ ol.interaction.Modify = function(options) {
|
|||||||
goog.inherits(ol.interaction.Modify, ol.interaction.Drag);
|
goog.inherits(ol.interaction.Modify, ol.interaction.Drag);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {ol.Feature} feature Feature.
|
|
||||||
* @param {number} resolution Resolution.
|
|
||||||
* @return {Array.<ol.style.Style>} Styles.
|
|
||||||
*/
|
|
||||||
ol.interaction.Modify.defaultStyleFunction = (function() {
|
|
||||||
/** @type {Object.<ol.geom.GeometryType, Array.<ol.style.Style>>} */
|
|
||||||
var styles = {};
|
|
||||||
styles[ol.geom.GeometryType.POLYGON] = [
|
|
||||||
new ol.style.Style({
|
|
||||||
fill: new ol.style.Fill({
|
|
||||||
color: [255, 255, 255, 0.5]
|
|
||||||
})
|
|
||||||
})
|
|
||||||
];
|
|
||||||
styles[ol.geom.GeometryType.MULTI_POLYGON] =
|
|
||||||
styles[ol.geom.GeometryType.POLYGON];
|
|
||||||
|
|
||||||
styles[ol.geom.GeometryType.LINE_STRING] = [
|
|
||||||
new ol.style.Style({
|
|
||||||
stroke: new ol.style.Stroke({
|
|
||||||
color: [255, 255, 255, 1],
|
|
||||||
width: 5
|
|
||||||
})
|
|
||||||
}),
|
|
||||||
new ol.style.Style({
|
|
||||||
stroke: new ol.style.Stroke({
|
|
||||||
color: [0, 153, 255, 1],
|
|
||||||
width: 3
|
|
||||||
})
|
|
||||||
})
|
|
||||||
];
|
|
||||||
styles[ol.geom.GeometryType.MULTI_LINE_STRING] =
|
|
||||||
styles[ol.geom.GeometryType.LINE_STRING];
|
|
||||||
|
|
||||||
styles[ol.geom.GeometryType.POINT] = [
|
|
||||||
new ol.style.Style({
|
|
||||||
image: new ol.style.Circle({
|
|
||||||
radius: 7,
|
|
||||||
fill: new ol.style.Fill({
|
|
||||||
color: [0, 153, 255, 1]
|
|
||||||
}),
|
|
||||||
stroke: new ol.style.Stroke({
|
|
||||||
color: [255, 255, 255, 0.75],
|
|
||||||
width: 1.5
|
|
||||||
})
|
|
||||||
}),
|
|
||||||
zIndex: 100000
|
|
||||||
})
|
|
||||||
];
|
|
||||||
styles[ol.geom.GeometryType.MULTI_POINT] =
|
|
||||||
styles[ol.geom.GeometryType.POINT];
|
|
||||||
|
|
||||||
return function(feature, resolution) {
|
|
||||||
return styles[feature.getGeometry().getType()];
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user