diff --git a/views/ajax/charactergroupsqueststations/index.tpl b/views/ajax/charactergroupsqueststations/index.tpl index 4a15f972..ef03b88d 100644 --- a/views/ajax/charactergroupsqueststations/index.tpl +++ b/views/ajax/charactergroupsqueststations/index.tpl @@ -12,9 +12,19 @@ floatval($station['latitude']) ); $coordinates[] = $coordinate; + // Marker $features[] = array( 'type' => 'Feature', 'id' => $station['id'], + 'geometry' => array( + 'type' => 'Point', + 'coordinates' => $coordinate + ) + ); + // Label + $features[] = array( + 'type' => 'Feature', + 'id' => $station['id'].'-label', 'properties' => array( 'name' => $station['title'], ), diff --git a/views/html/charactergroupsquests/quest.tpl b/views/html/charactergroupsquests/quest.tpl index 835aab69..60481c04 100644 --- a/views/html/charactergroupsquests/quest.tpl +++ b/views/html/charactergroupsquests/quest.tpl @@ -171,20 +171,36 @@ var styles = []; var geometry = feature.getGeometry(); if(geometry instanceof ol.geom.Point) { - // Point styling - styles.push( - new ol.style.Style({ - text: new ol.style.Text({ - //text: '\uf041', - text: '\uf276', - font: 'normal 28px FontAwesome', - textBaseline: 'Bottom', - fill: new ol.style.Fill({ - color: '#0F373C' + var name = feature.get('name'); + if(name) { + // Label styling + styles.push( + new ol.style.Style({ + text: new ol.style.Text({ + text: name, + textBaseline: 'Bottom', + offsetY: 14, + scale: 1.2 }) }) - }) - ); + ); + } + else { + // Point styling + styles.push( + new ol.style.Style({ + text: new ol.style.Text({ + //text: '\uf041', + text: '\uf276', + font: 'normal 28px FontAwesome', + textBaseline: 'Bottom', + fill: new ol.style.Fill({ + color: '#0F373C' + }) + }) + }) + ); + } } else if(geometry instanceof ol.geom.LineString) { // Line styling