From 0272659118a8d8a46ad0ac30cf760e4197d12d3d Mon Sep 17 00:00:00 2001 From: Antoine Abt Date: Thu, 6 Feb 2014 15:43:27 +0100 Subject: [PATCH] Remove useless style method --- src/objectliterals.jsdoc | 2 - src/ol/interaction/modifyinteraction.js | 63 ------------------------- 2 files changed, 65 deletions(-) diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index fe3528acfc..1bd4f39684 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -436,8 +436,6 @@ /** * @typedef {Object} olx.interaction.ModifyOptions - * @property {ol.feature.StyleFunction|undefined} styleFunction - * the styleFunction for the feature * @property {number|undefined} pixelTolerance Pixel tolerance for considering * the pointer close enough to a vertex for editing. Default is 20 pixels. * @property {ol.render.FeaturesOverlay} featuresOverlay Features overlay. diff --git a/src/ol/interaction/modifyinteraction.js b/src/ol/interaction/modifyinteraction.js index 10eeaa3de3..f550c54e42 100644 --- a/src/ol/interaction/modifyinteraction.js +++ b/src/ol/interaction/modifyinteraction.js @@ -9,7 +9,6 @@ goog.require('ol.MapBrowserEvent.EventType'); goog.require('ol.ViewHint'); goog.require('ol.coordinate'); goog.require('ol.extent'); -goog.require('ol.geom.GeometryType'); goog.require('ol.geom.LineString'); goog.require('ol.geom.MultiLineString'); goog.require('ol.geom.MultiPoint'); @@ -19,9 +18,6 @@ goog.require('ol.geom.Polygon'); goog.require('ol.interaction.Drag'); goog.require('ol.render.FeaturesOverlay'); 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'); @@ -117,65 +113,6 @@ ol.interaction.Modify = function(options) { goog.inherits(ol.interaction.Modify, ol.interaction.Drag); -/** - * @param {ol.Feature} feature Feature. - * @param {number} resolution Resolution. - * @return {Array.} Styles. - */ -ol.interaction.Modify.defaultStyleFunction = (function() { - /** @type {Object.>} */ - 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 */