You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/reference/plugins.en.md
+28-2Lines changed: 28 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,9 @@ QField ships with a number of utilities objects to manipulate features and geome
53
53
54
54
To familiarize yourself with these, visit QField’s source code’s [utilities directory](https://github.com/opengisch/QField/tree/master/src/core/utils) where .h\[eader\] files will provide documentation for all invokable functions.
55
55
56
-
## Search bar integration
56
+
## Plugin code snippets
57
+
58
+
### Search bar integration
57
59
58
60
The plugin framework empowers you to integrate custom searches into the QField search bar through the `QFieldLocatorFilter` item which can be added into a plugin's root item:
59
61
@@ -119,7 +121,7 @@ Item {
119
121
120
122
This [QField OpenStreetMap Nomination plugin](https://github.com/opengisch/qfield-nominatim-locator) is a good example to learn more about search bar integration.
121
123
122
-
## Configuration button within the plugin manager
124
+
###Configuration button within the plugin manager
123
125
124
126
For plugins requiring user configuration, QField allows for these to add a configuration button within its plugin manager.
125
127
@@ -148,3 +150,27 @@ Item {
148
150
}
149
151
}
150
152
```
153
+
154
+
### Geometry highlighter canvas overlay
155
+
156
+
Plugins can make use of QField's geometry highlighter item to flash created or fetched geometries through the following code:
157
+
158
+
```
159
+
import QtQuick
160
+
import org.qfield
161
+
162
+
Item {
163
+
// ...
164
+
165
+
property var geometryHighlighter: iface.findItemByObjectName('geometryHighlighter')
166
+
167
+
function demo() {
168
+
// Flash Null Island geometry
169
+
let geom = GeometryUtils.createGeometryFromWkt("POINT(0 0)")
170
+
let crs = CoordinateReferenceSystemUtils.fromDescription("EPSG:4326")
0 commit comments