Add a getMap function to ol.FeatureOverlay
This commit is contained in:
@@ -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
|
* @private
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,10 +25,18 @@ describe('ol.FeatureOverlay', function() {
|
|||||||
expect(featureOverlay.getStyleFunction()()).to.eql(style);
|
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.Feature');
|
||||||
goog.require('ol.FeatureOverlay');
|
goog.require('ol.FeatureOverlay');
|
||||||
|
goog.require('ol.Map');
|
||||||
goog.require('ol.geom.Point');
|
goog.require('ol.geom.Point');
|
||||||
goog.require('ol.style.Style');
|
goog.require('ol.style.Style');
|
||||||
|
|||||||
Reference in New Issue
Block a user