Hot answers tagged

2

Using atan would give better results than atan2: let rotation = -Math.atan((last[1] - first[1])/(last[0] - first[0])); You could also switch to a more recent version of OpenLayers and use the placement: 'line', option in ol.style.Text (introduced in version 4) which avoids having to set rotation


2

There are two possible solutions, that I know: First, is to use a predefined style, saved e.g. in a .qml file. You can than load that .qml file with LAYER_OBJECT.loadNamedStyle(PATH_TO_QML), where PATH_TO_QML obviously point to the file location of the saved style: layer = QgsVectorLayer(uri.uri(), tr(layer_name), "postgres") layer.loadNamedStyle(...


2

Yes, you can create 3 separate styles with a filter that selects only the features you want styled. Or you can create one style with 3 rules each with a filter to select the required filters. In the first case, you will see only on type of polygons at a time (unless you request the layer more than once); in the second case you will see all three types of ...


1

You could try using the color option for the Icon style (it might need to be a semi opaque rgba value) this.styleHomeGreen = new Style({ image: new Icon({ src: 'content/map-icons/home-green.png', color: 'red' }) }); or a style array could provide a background and an icon this.styleHomeGreen = [ new Style({ image: ...


1

In QGIS 3.6 this is not possible if adding the WFS through the browser panel. However, if you add the WFS through Layer > Add Layer > Add WFS Layer you are then able to apply SQL to the layer. So, from scratch, do the following: After you select Layer > Add Layer > Add WFS Layer, in the next window select New to add a new service. Enter a Name and the ...


Only top voted, non community-wiki answers of a minimum length are eligible