Get rid of ol.FeatureOverlay

This also introduces a wrapX option to the Draw, Modify and Select
interaction.
This commit is contained in:
Andreas Hocevar
2015-06-09 13:25:51 +02:00
parent 54da473991
commit 53d5d8c1d9
28 changed files with 177 additions and 676 deletions

View File

@@ -1,4 +1,3 @@
goog.require('ol.FeatureOverlay');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.GeoJSON');
@@ -60,7 +59,8 @@ var map = new ol.Map({
var highlightStyleCache = {};
var featureOverlay = new ol.FeatureOverlay({
var featureOverlay = new ol.layer.Vector({
source: new ol.source.Vector(),
map: map,
style: function(feature, resolution) {
var text = resolution < 5000 ? feature.get('name') : '';
@@ -106,10 +106,10 @@ var displayFeatureInfo = function(pixel) {
if (feature !== highlight) {
if (highlight) {
featureOverlay.removeFeature(highlight);
featureOverlay.getSource().removeFeature(highlight);
}
if (feature) {
featureOverlay.addFeature(feature);
featureOverlay.getSource().addFeature(feature);
}
highlight = feature;
}