Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var styles = {
- 'lines': new ol.style.Style({
- stroke: new ol.style.Stroke({
- color: 'blue',
- width: 1.25
- })
- }),
- 'labels': new ol.style.Style({
- text: new ol.style.Text({
- text: '',
- font: '15px sans-serif',
- fill: new ol.style.Fill({
- color: 'red'
- }),
- offsetY: -11,
- placement: 'line',
- maxAngle: 0.25,
- overflow: true
- })
- })
- };
- function style_rivers(feature, resolution) {
- var stylesArray = [];
- stylesArray.push(styles.lines);
- styles.labels.setGeometry(feature.getGeometry().simplify(0.9));
- styles.labels.getText().setText(feature.get('name'));
- stylesArray.push(styles.labels);
- return stylesArray;
- }
Add Comment
Please, Sign In to add comment