Add a getMap function to ol.FeatureOverlay

This commit is contained in:
Bart van den Eijnden
2015-01-27 19:54:34 +01:00
parent 43f84e798f
commit bc5f81cfa0
2 changed files with 17 additions and 0 deletions

View File

@@ -112,6 +112,15 @@ ol.FeatureOverlay.prototype.getFeatures = function() {
};
/**
* @return {?ol.Map} The map with which this feature overlay is associated.
* @api
*/
ol.FeatureOverlay.prototype.getMap = function() {
return this.map_;
};
/**
* @private
*/

View File

@@ -25,10 +25,18 @@ describe('ol.FeatureOverlay', function() {
expect(featureOverlay.getStyleFunction()()).to.eql(style);
});
it('takes a map', function() {
var map = new ol.Map({});
var featureOverlay = new ol.FeatureOverlay({
map: map
});
expect(featureOverlay.getMap()).to.eql(map);
});
});
});
goog.require('ol.Feature');
goog.require('ol.FeatureOverlay');
goog.require('ol.Map');
goog.require('ol.geom.Point');
goog.require('ol.style.Style');