Simplify the renderer function API

This commit is contained in:
Andreas Hocevar
2017-08-04 22:52:08 +02:00
parent 67aa1a6dc9
commit 617151c8ff
6 changed files with 63 additions and 46 deletions

View File

@@ -25,7 +25,8 @@ function collectDrawData(letter, x, y, angle) {
}
var style = new ol.style.Style({
renderer: function(coords, geometry, feature) {
renderer: function(coords, context) {
var feature = context.feature;
var text = feature.get('name');
if (text) {
// Only create label when geometry has a long and straight segment