[style] add missing references to new custom class names in helpers.ts
Browse files
static/src/components/helpers.ts
CHANGED
@@ -65,10 +65,13 @@ const getCustomIconMarker = (
|
|
65 |
}
|
66 |
|
67 |
/** get an the leaflet editor geoman.io toolbar with the custom actions to draw/edit/move point and rectangle layers */
|
68 |
-
const getCustomGeomanActionsObject = (
|
|
|
|
|
69 |
return {
|
70 |
name: actionName,
|
71 |
block: 'custom',
|
|
|
72 |
title: descriptionAction,
|
73 |
actions: arrayActions
|
74 |
}
|
@@ -92,22 +95,33 @@ export function setGeomanControls(localMap: LMap) {
|
|
92 |
name: 'actionName'
|
93 |
}]
|
94 |
const includeMarkerControl = localMap.pm.Toolbar.copyDrawControl('Marker',
|
95 |
-
getCustomGeomanActionsObject(
|
|
|
|
|
|
|
|
|
|
|
96 |
)
|
|
|
97 |
includeMarkerControl.drawInstance.setOptions({
|
98 |
markerStyle: { icon: getCustomIconMarker('/marker-icon-include') }
|
99 |
})
|
100 |
const excludeMarkerControl = localMap.pm.Toolbar.copyDrawControl('Marker',
|
101 |
-
getCustomGeomanActionsObject(
|
|
|
|
|
|
|
|
|
|
|
102 |
)
|
103 |
excludeMarkerControl.drawInstance.setOptions({
|
104 |
markerStyle: { icon: getCustomIconMarker('/marker-icon-exclude') }
|
105 |
})
|
106 |
localMap.pm.Toolbar.copyDrawControl('Rectangle', {
|
107 |
-
|
108 |
block: 'custom',
|
109 |
-
|
110 |
-
|
111 |
})
|
112 |
localMap.pm.setPathOptions({
|
113 |
color: "green",
|
@@ -157,10 +171,10 @@ export const getGeoJSONRequest = async (
|
|
157 |
const { geojson, n_predictions, n_shapes_geojson } = parsed.output
|
158 |
|
159 |
const parsedGeojson = JSON.parse(geojson)
|
160 |
-
|
161 |
numberOfPolygonsRef.value = n_shapes_geojson
|
162 |
numberOfPredictedMasksRef.value = n_predictions
|
163 |
-
|
164 |
return parsedGeojson
|
165 |
} catch (errParseOutput1) {
|
166 |
console.error("errParseOutput1::", errParseOutput1)
|
@@ -250,4 +264,4 @@ const removeEventFromArrayByIndex = (arr: Array<LEvented>, e: LEvented) => {
|
|
250 |
return arr.filter((el: LEvented) => {
|
251 |
return el.id != e.layer._leaflet_id
|
252 |
})
|
253 |
-
}
|
|
|
65 |
}
|
66 |
|
67 |
/** get an the leaflet editor geoman.io toolbar with the custom actions to draw/edit/move point and rectangle layers */
|
68 |
+
const getCustomGeomanActionsObject = (
|
69 |
+
actionName: string, descriptionAction: string, arrayActions: Array<object>, customClassName: string
|
70 |
+
) => {
|
71 |
return {
|
72 |
name: actionName,
|
73 |
block: 'custom',
|
74 |
+
className: customClassName,
|
75 |
title: descriptionAction,
|
76 |
actions: arrayActions
|
77 |
}
|
|
|
95 |
name: 'actionName'
|
96 |
}]
|
97 |
const includeMarkerControl = localMap.pm.Toolbar.copyDrawControl('Marker',
|
98 |
+
getCustomGeomanActionsObject(
|
99 |
+
'IncludeMarkerPrompt',
|
100 |
+
'Marker point that add recognition regions from SAM prompt requests',
|
101 |
+
actionArray,
|
102 |
+
'control-icon leaflet-pm-icon-marker-include'
|
103 |
+
)
|
104 |
)
|
105 |
+
// custom marker icon on map
|
106 |
includeMarkerControl.drawInstance.setOptions({
|
107 |
markerStyle: { icon: getCustomIconMarker('/marker-icon-include') }
|
108 |
})
|
109 |
const excludeMarkerControl = localMap.pm.Toolbar.copyDrawControl('Marker',
|
110 |
+
getCustomGeomanActionsObject(
|
111 |
+
'ExcludeMarkerPrompt',
|
112 |
+
'Marker point that remove recognition regions from SAM prompt requests',
|
113 |
+
actionArray,
|
114 |
+
'control-icon leaflet-pm-icon-marker-exclude'
|
115 |
+
)
|
116 |
)
|
117 |
excludeMarkerControl.drawInstance.setOptions({
|
118 |
markerStyle: { icon: getCustomIconMarker('/marker-icon-exclude') }
|
119 |
})
|
120 |
localMap.pm.Toolbar.copyDrawControl('Rectangle', {
|
121 |
+
actions: actionArray,
|
122 |
block: 'custom',
|
123 |
+
name: 'RectanglePrompt',
|
124 |
+
title: 'Rectangular recognition regions for SAM prompt requests'
|
125 |
})
|
126 |
localMap.pm.setPathOptions({
|
127 |
color: "green",
|
|
|
171 |
const { geojson, n_predictions, n_shapes_geojson } = parsed.output
|
172 |
|
173 |
const parsedGeojson = JSON.parse(geojson)
|
174 |
+
durationRef.value = parsed.duration_run
|
175 |
numberOfPolygonsRef.value = n_shapes_geojson
|
176 |
numberOfPredictedMasksRef.value = n_predictions
|
177 |
+
responseMessageRef.value = ''
|
178 |
return parsedGeojson
|
179 |
} catch (errParseOutput1) {
|
180 |
console.error("errParseOutput1::", errParseOutput1)
|
|
|
264 |
return arr.filter((el: LEvented) => {
|
265 |
return el.id != e.layer._leaflet_id
|
266 |
})
|
267 |
+
}
|